diff --git a/data-cube-manager/src/app/admin/admin.module.ts b/data-cube-manager/src/app/admin/admin.module.ts
index 47b7725..8e2517a 100644
--- a/data-cube-manager/src/app/admin/admin.module.ts
+++ b/data-cube-manager/src/app/admin/admin.module.ts
@@ -51,6 +51,7 @@ import { BucketsModal } from './pages/create-cube/steps/definition/buckets/bucke
import { MapFieldComponent } from './components/map-field/map-field.component';
import { UpdateCubeDialog } from './components/update-cube-dialog/update-cube-dialog.component';
import { UpdateBandDialogComponent } from './components/update-band-dialog/update-band-dialog.component';
+import { CustomBandDialogComponent } from './pages/create-cube/steps/definition/custom-band-dialog/custom-band-dialog.component';
@NgModule({
imports: [
@@ -105,7 +106,8 @@ import { UpdateBandDialogComponent } from './components/update-band-dialog/updat
UpdateBandDialogComponent,
BucketsModal,
MapFieldComponent,
- UpdateBandDialogComponent
+ UpdateBandDialogComponent,
+ CustomBandDialogComponent
],
providers: [
AdminGuardService
diff --git a/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/custom-band-dialog/custom-band-dialog.component.css b/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/custom-band-dialog/custom-band-dialog.component.css
new file mode 100644
index 0000000..e69de29
diff --git a/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/custom-band-dialog/custom-band-dialog.component.html b/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/custom-band-dialog/custom-band-dialog.component.html
new file mode 100644
index 0000000..a54cde1
--- /dev/null
+++ b/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/custom-band-dialog/custom-band-dialog.component.html
@@ -0,0 +1,10 @@
+
+
Type the index band name
+
+ Band name
+
+
+
+
+
+
\ No newline at end of file
diff --git a/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/custom-band-dialog/custom-band-dialog.component.ts b/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/custom-band-dialog/custom-band-dialog.component.ts
new file mode 100644
index 0000000..8750a49
--- /dev/null
+++ b/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/custom-band-dialog/custom-band-dialog.component.ts
@@ -0,0 +1,20 @@
+import { Component, Inject } from '@angular/core';
+import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
+
+@Component({
+ selector: 'app-custom-band-dialog',
+ templateUrl: './custom-band-dialog.component.html',
+ styleUrls: ['./custom-band-dialog.component.css']
+})
+export class CustomBandDialogComponent {
+
+ constructor(
+ public dialogRef: MatDialogRef,
+ @Inject(MAT_DIALOG_DATA) public data: any,
+ ) { }
+
+ onClose() {
+ this.dialogRef.close(this.data.band ? this.data.band.toUpperCase() : this.data.band)
+ }
+
+}
diff --git a/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/definition.component.html b/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/definition.component.html
index 89fcdd6..3bd3a29 100644
--- a/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/definition.component.html
+++ b/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/definition.component.html
@@ -145,9 +145,15 @@
Indexes
-
- {{ index }}
-
+
+
+ {{ index }}
+
+
+
+
diff --git a/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/definition.component.scss b/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/definition.component.scss
index 584a18f..2ea6c36 100644
--- a/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/definition.component.scss
+++ b/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/definition.component.scss
@@ -9,7 +9,7 @@
.mat-form-field {
width: 100% !important;
}
-
+
.btn_suffix {
margin-left: 5px;
width: 40px;
@@ -27,7 +27,7 @@
padding: 0 5px;
}
.content {
- display: flex;
+ display: flex;
justify-content: space-between;
margin-top: -15px;
}
@@ -43,4 +43,20 @@
padding: 10px 20px;
}
}
+}
+
+footer{
+ border-top:2px solid rgba(0,0,0,0.09);
+ height: 57px;
+ padding-top: 10px;
+ text-align:right;
+
+ button {
+ margin-right: 10px;
+ }
+}
+
+.band-index-panel {
+ max-height: 200px;
+ overflow: auto;
}
\ No newline at end of file
diff --git a/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/definition.component.ts b/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/definition.component.ts
index eddc188..5817f9a 100644
--- a/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/definition.component.ts
+++ b/data-cube-manager/src/app/admin/pages/create-cube/steps/definition/definition.component.ts
@@ -12,6 +12,7 @@ import { EstimateCostModal } from './estimate-cost/estimate-cost.component'
import { FormGroup, FormBuilder, Validators } from '@angular/forms'
import { setDefinition } from 'app/admin/admin.action'
import { BucketsModal } from './buckets/buckets.component'
+import { CustomBandDialogComponent } from './custom-band-dialog/custom-band-dialog.component'
@Component({
selector: 'app-create-cube-definition',
@@ -34,7 +35,8 @@ export class CreateCubeDefinitionComponent implements OnInit {
public wellKnownIndexes = {
'NDVI': '10000. * ((NIR_BAND_HERE - RED_BAND_HERE) / (NIR_BAND_HERE + RED_BAND_HERE))',
- 'EVI': '10000. * 2.5 * (NIR_BAND_HERE - RED_BAND_HERE) / (NIR_BAND_HERE + 6. * RED_BAND_HERE - 7.5 * BLUE_BAND_HERE + 10000)'
+ 'EVI': '10000. * 2.5 * (NIR_BAND_HERE - RED_BAND_HERE) / (NIR_BAND_HERE + 6. * RED_BAND_HERE - 7.5 * BLUE_BAND_HERE + 10000)',
+ 'CUSTOM': 'B1 / B2'
}
public environmentVersion = window['__env'].environmentVersion
@@ -104,6 +106,10 @@ export class CreateCubeDefinitionComponent implements OnInit {
for(let indexValue of value) {
let expression = this.wellKnownIndexes[indexValue];
+ if (expression === undefined) {
+ continue
+ }
+
let redBand = '';
let nirBand = '';
let blueBand = '';
@@ -137,6 +143,23 @@ export class CreateCubeDefinitionComponent implements OnInit {
}
}
+ addCustomIndex() {
+ const dialogRef = this.dialog.open(CustomBandDialogComponent, {
+ width: '250px',
+ data: {},
+ });
+
+ dialogRef.afterClosed().subscribe(result => {
+ if (!!result) {
+ if (!this.indexesAvailable.includes(result)) {
+ this.indexesAvailable.push(result);
+ this.wellKnownIndexes[result] = 'B1 / B2'
+ }
+ }
+
+ });
+ }
+
ngOnInit() {
this.definitonCompleted = false
this.getCompositeFunctions()
diff --git a/data-cube-manager/src/app/admin/pages/create-cube/steps/preview/preview.component.ts b/data-cube-manager/src/app/admin/pages/create-cube/steps/preview/preview.component.ts
index 3eae2db..dfb5bd0 100644
--- a/data-cube-manager/src/app/admin/pages/create-cube/steps/preview/preview.component.ts
+++ b/data-cube-manager/src/app/admin/pages/create-cube/steps/preview/preview.component.ts
@@ -124,9 +124,18 @@ export class CreateCubePreviewComponent implements OnInit {
}
getCubeName(func) {
- return func !== 'IDT' ?
- `${this.definition.name}_${this.getComplementCubeName(this.definition.temporal)}_${func}` :
- `${this.definition.name}_${this.definition.resolution}`
+ let cubeName = this.definition.name
+ let complement = '';
+
+ if (func !== 'IDT') {
+ complement = `_${this.getComplementCubeName(this.definition.temporal)}`;
+
+ if (this.environmentVersion === 'cloud') {
+ complement = `-${complement.split('_')[2]}`
+ }
+ }
+
+ return `${cubeName}${complement}`
}
getComplementCubeName(temporalSchema) {
diff --git a/data-cube-manager/src/app/admin/pages/list-cubes/list-cubes.component.html b/data-cube-manager/src/app/admin/pages/list-cubes/list-cubes.component.html
index a77035a..387e65c 100644
--- a/data-cube-manager/src/app/admin/pages/list-cubes/list-cubes.component.html
+++ b/data-cube-manager/src/app/admin/pages/list-cubes/list-cubes.component.html
@@ -11,7 +11,7 @@
-
{{ cube.name }}
+ {{ cube.name }}-{{ cube.version }}