diff --git a/angular.json b/angular.json index 32b9018..14cd9ca 100644 --- a/angular.json +++ b/angular.json @@ -55,6 +55,7 @@ } ], "styles": [ + "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", "src/styles.scss", "node_modules/leaflet/dist/leaflet.css" ], @@ -122,6 +123,7 @@ "src/assets" ], "styles": [ + "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css", "src/styles.scss" ], "scripts": [] @@ -159,4 +161,4 @@ "cli": { "analytics": false } -} +} \ No newline at end of file diff --git a/package.json b/package.json index c633f94..b548676 100644 --- a/package.json +++ b/package.json @@ -59,11 +59,13 @@ "private": true, "dependencies": { "@angular/animations": "~9.1.1", + "@angular/cdk": "9.2.4", "@angular/common": "~9.1.1", "@angular/compiler": "~9.1.1", "@angular/core": "~9.1.1", "@angular/forms": "~9.1.1", "@angular/localize": "^9.1.1", + "@angular/material": "9.2.4", "@angular/platform-browser": "~9.1.1", "@angular/platform-browser-dynamic": "~9.1.1", "@angular/router": "~9.1.1", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 1ca00ea..bc1081b 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,27 +1,29 @@ -import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; +import {BrowserModule} from '@angular/platform-browser'; +import {NgModule} from '@angular/core'; -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; -import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; -import { LoadConfigComponent } from './load-config/load-config.component'; -import { ExportConfigComponent } from './export-config/export-config.component'; -import { FontAwesomeModule, FaIconLibrary } from '@fortawesome/angular-fontawesome'; -import { HashLocationStrategy, LocationStrategy } from '@angular/common'; +import {AppRoutingModule} from './app-routing.module'; +import {AppComponent} from './app.component'; +import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; +import {LoadConfigComponent} from './load-config/load-config.component'; +import {ExportConfigComponent} from './export-config/export-config.component'; +import {FaIconLibrary, FontAwesomeModule} from '@fortawesome/angular-fontawesome'; +import {HashLocationStrategy, LocationStrategy} from '@angular/common'; -import { FormsModule } from '@angular/forms'; -import { LoadConfigCsvComponent } from './load-config-csv/load-config-csv.component'; -import { LoadConfigTxtComponent } from './load-config-txt/load-config-txt.component'; -import { LoadConfigEmptyComponent } from './load-config-empty/load-config-empty.component'; -import { LicenseInfoComponent } from './license-info/license-info.component'; -import { GcpsMapComponent } from './gcps-map/gcps-map.component'; -import { ImagesTaggerComponent } from './images-tagger/images-tagger.component'; -import { LeafletModule } from '@asymmetrik/ngx-leaflet'; -import { fas } from '@fortawesome/free-solid-svg-icons'; -import { far } from '@fortawesome/free-regular-svg-icons'; -import { SmartimageComponent } from './smartimage/smartimage.component'; -import { ConfirmDialogComponent } from './confirm-dialog/confirm-dialog.component'; -import { NgOpenCVModule, OpenCVOptions } from "ng-open-cv"; +import {FormsModule} from '@angular/forms'; +import {LoadConfigCsvComponent} from './load-config-csv/load-config-csv.component'; +import {LoadConfigTxtComponent} from './load-config-txt/load-config-txt.component'; +import {LoadConfigEmptyComponent} from './load-config-empty/load-config-empty.component'; +import {LicenseInfoComponent} from './license-info/license-info.component'; +import {GcpsMapComponent} from './gcps-map/gcps-map.component'; +import {ImagesTaggerComponent} from './images-tagger/images-tagger.component'; +import {LeafletModule} from '@asymmetrik/ngx-leaflet'; +import {fas} from '@fortawesome/free-solid-svg-icons'; +import {far} from '@fortawesome/free-regular-svg-icons'; +import {SmartimageComponent} from './smartimage/smartimage.component'; +import {ConfirmDialogComponent} from './confirm-dialog/confirm-dialog.component'; +import {NgOpenCVModule, OpenCVOptions} from 'ng-open-cv'; +import {MatSlideToggleModule} from '@angular/material/slide-toggle'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; const openCVConfig: OpenCVOptions = { scriptUrl: `assets/opencv/opencv.js`, @@ -51,6 +53,8 @@ const openCVConfig: OpenCVOptions = { FormsModule, LeafletModule.forRoot(), NgOpenCVModule.forRoot(openCVConfig), + MatSlideToggleModule, + BrowserAnimationsModule ], providers: [ { diff --git a/src/app/export-config/export-config.component.html b/src/app/export-config/export-config.component.html index 47c83a2..2e723df 100644 --- a/src/app/export-config/export-config.component.html +++ b/src/app/export-config/export-config.component.html @@ -13,7 +13,7 @@ X Y - Z + Z NaN -> 0 ImageX ImageY Filename @@ -32,7 +32,7 @@ {{ imgGcp.geoY }} - {{ imgGcp.geoZ }} + {{ (imgGcp.geoZ !== imgGcp.geoZ) && replaceNanZ ? 0 : imgGcp.geoZ }} {{ imgGcp.imX }} @@ -60,11 +60,11 @@ -
+
-
\ No newline at end of file +
diff --git a/src/app/export-config/export-config.component.ts b/src/app/export-config/export-config.component.ts index 92f872a..9bac292 100644 --- a/src/app/export-config/export-config.component.ts +++ b/src/app/export-config/export-config.component.ts @@ -1,9 +1,8 @@ -import { Component, OnInit } from '@angular/core'; -import { Router } from '@angular/router'; -import { StorageService } from '../storage.service'; -import { ImageGcp, GCP, Projection, GcpsUtilsService } from '../gcps-utils.service'; +import {Component, OnInit} from '@angular/core'; +import {Router} from '@angular/router'; +import {StorageService} from '../storage.service'; +import {GCP, GcpsUtilsService, ImageGcp, Projection} from '../gcps-utils.service'; import * as FileSaver from 'file-saver'; -import { stringify } from 'querystring'; @Component({ selector: 'app-export-config', @@ -16,6 +15,7 @@ export class ExportConfigComponent implements OnInit { public gcps: GCP[]; public projection: Projection; public extras: string[]; + public replaceNanZ: boolean; constructor(private router: Router, public storage: StorageService, private utils: GcpsUtilsService) { @@ -33,6 +33,7 @@ export class ExportConfigComponent implements OnInit { this.gcps = storage.gcps; this.projection = storage.projection; this.extras = utils.generateExtrasNames(this.imageGcps); + this.replaceNanZ = false; } ngOnInit(): void { @@ -47,7 +48,8 @@ export class ExportConfigComponent implements OnInit { let content = this.projection.str + '\n'; for (const img of this.imageGcps) { - content += `${img.geoX}\t${img.geoY}\t${img.geoZ}\t${img.imX}\t${img.imY}\t${img.imgName}\t${img.gcpName}\t${img.extras.join('\t')}`.trim() + '\n'; + const geoZ = (img.geoZ !== img.geoZ) && this.replaceNanZ ? 0 : img.geoZ; + content += `${img.geoX}\t${img.geoY}\t${geoZ}\t${img.imX}\t${img.imY}\t${img.imgName}\t${img.gcpName}\t${img.extras.join('\t')}`.trim() + '\n'; } return content; diff --git a/src/index.html b/src/index.html index 8493f1b..a40e501 100644 --- a/src/index.html +++ b/src/index.html @@ -10,6 +10,8 @@ + +