Skip to content

Commit

Permalink
feat: model upgrade (#125)
Browse files Browse the repository at this point in the history
* feat!: updated internal raster layer models

* chore: added .licrc

* fix: added missing filed to inteface

* feat: update models (#124)

* fix: props fixes (#120)

* chore(release): 10.2.3

* Create .licrc

* fix: sync field names and tooltips (#121)

* fix: sync field names and tooltips

* fix: missing license

* fix: revert license

* chore(release): 10.2.4

* fix: footprint mapping (#123)

* chore(release): 10.2.5

* feat: add accuracy validation

Co-authored-by: Alex Lebinson <[email protected]>
Co-authored-by: Yossi <[email protected]>
Co-authored-by: Ella Martirosyan <[email protected]>
Co-authored-by: Shahar s <[email protected]>
Co-authored-by: shahar shavit 
Co-authored-by: Asaf Masa 

* fix: set region as string

* chore: remove comments

* chore: remove row from change log

* chore: remove row from change log

* fix: cr review fix

* fix: cr review fix

* fix: cr review fix

* fix: fix cr comments

Co-authored-by: shahar shavit <>
Co-authored-by: Alex Lebinson <[email protected]>
Co-authored-by: Yossi <[email protected]>
Co-authored-by: Ella Martirosyan <[email protected]>
Co-authored-by: Shahar s <[email protected]>
Co-authored-by: Asaf Masa
  • Loading branch information
5 people authored Apr 6, 2022
1 parent b5539ff commit 834f443
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 106 deletions.
18 changes: 10 additions & 8 deletions src/models/layerMetadata/bestMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { getPyCSWMapping, IPYCSWMapping, pycsw } from './decorators/property/csw
import { getInputDataMapping, IDataMapping, DataFileType, inputDataMapping } from './decorators/property/shp.decorator';
import { getCatalogDBMapping, ICatalogDBMapping, catalogDB } from './decorators/property/catalogDB.decorator';
import { getTsTypesMapping, ITsTypesMapping, tsTypes, TsTypes } from './decorators/property/tsTypes.decorator';
import { ProductType, SensorType } from './enums';
import { ProductType } from './enums';
import { DiscreteOrder } from './discreteOrder';

export interface IBestMetadata {
Expand Down Expand Up @@ -376,7 +376,7 @@ export class BestMetadata implements IBestMetadata, IMetadataCommonModel {
//#endregion
public accuracyCE90: number | undefined = undefined;

//#region COMMON: sensorType //sensors
//#region COMMON: sensors
@pycsw({
profile: 'mc_best',
xmlElement: 'mc:sensorType',
Expand All @@ -398,7 +398,7 @@ export class BestMetadata implements IBestMetadata, IMetadataCommonModel {
valuePath: '***features[].properties.SensorType***',
})
@tsTypes({
mappingType: TsTypes.SENSORTYPE_ARRAY,
mappingType: TsTypes.STRING_ARRAY,
})
@graphql({
nullable: true,
Expand All @@ -407,9 +407,10 @@ export class BestMetadata implements IBestMetadata, IMetadataCommonModel {
category: FieldCategory.GENERAL,
isManuallyEditable: true,
isAutoGenerated: true,
infoMsgCode: ['info-field-tooltip.sensorType.tooltip'],
})
//#endregion
public sensorType: SensorType[] | undefined = undefined;
public sensors: string[] | undefined = undefined;

//#region COMMON: region
@pycsw({
Expand All @@ -422,21 +423,22 @@ export class BestMetadata implements IBestMetadata, IMetadataCommonModel {
column: {
name: 'region',
type: 'text',
nullable: true,
},
field: {
overrideType: TsTypes.STRING,
},
})
@tsTypes({
mappingType: TsTypes.STRING,
mappingType: TsTypes.STRING_ARRAY,
})
@graphql({
nullable: true,
})
@fieldConfig({
category: FieldCategory.GENERAL,
isAutoGenerated: true,
})
//#endregion
public region: string | undefined = undefined;
public region: string[] | undefined = undefined;

//#region COMMON: productId
@pycsw({
Expand Down
10 changes: 0 additions & 10 deletions src/models/layerMetadata/decorators/property/tsTypes.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,6 @@ export const TsTypes: Record<string, IDescribeTsType> = {
value: 'Link',
type: PropertiesTypes.ARRAY,
},
SENSORTYPE: {
value: 'SensorType',
type: PropertiesTypes.ENUM,
importFromPackage: '@map-colonies/mc-model-types',
},
SENSORTYPE_ARRAY: {
value: 'SensorType',
type: PropertiesTypes.ENUM_ARRAY,
importFromPackage: '@map-colonies/mc-model-types',
},
RECORDTYPE: {
value: 'RecordType',
type: PropertiesTypes.ENUM,
Expand Down
9 changes: 0 additions & 9 deletions src/models/layerMetadata/enums.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
export enum SensorType {
VIS = 'VIS',
RGB = 'RGB',
// eslint-disable-next-line
Pan_Sharpen = 'Pan_Sharpen',
OTHER = 'OTHER',
UNDEFINED = 'UNDEFINED',
}

export enum ProductType {
ORTHOPHOTO = 'Orthophoto',
ORTHOPHOTO_HISTORY = 'OrthophotoHistory',
Expand Down
6 changes: 3 additions & 3 deletions src/models/layerMetadata/interfaces/metadataCommonModel.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GeoJSON } from 'geojson';
import { ProductType, SensorType } from '../enums';
import { ProductType } from '../enums';
import { RecordType } from '../../pycsw/coreEnums';

export interface IMetadataCommonModel {
Expand All @@ -14,8 +14,8 @@ export interface IMetadataCommonModel {
updateDate: Date | undefined;
sourceDateStart: Date | undefined;
sourceDateEnd: Date | undefined;
sensorType: SensorType[] | undefined; //sensors
region: string | undefined;
sensors: string[] | undefined;
region: string[] | undefined;
footprint: GeoJSON | undefined;
productId: string | undefined;
productType: ProductType | undefined;
Expand Down
15 changes: 9 additions & 6 deletions src/models/layerMetadata/layer3DMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { RecordType } from '../pycsw/coreEnums';
import { getPyCSWMapping, IPYCSWMapping, pycsw } from './decorators/property/csw.decorator';
import { tsTypes, TsTypes } from './decorators/property/tsTypes.decorator';
import { ProductType, SensorType } from './enums';
import { ProductType } from './enums';
import { catalogDB } from './decorators/property/catalogDB.decorator';
import { IMetadataCommonModel } from './interfaces/metadataCommonModel';

Expand Down Expand Up @@ -641,7 +641,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel {
//#endregion
public visualAccuracy: number | undefined = undefined;

//#region 3D: sensorsType
//#region 3D: sensors
@pycsw({
profile: 'mc3d',
xmlElement: 'mc:sensors',
Expand All @@ -658,7 +658,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel {
},
})
@tsTypes({
mappingType: TsTypes.SENSORTYPE_ARRAY,
mappingType: TsTypes.STRING_ARRAY,
})
@graphql({
nullable: true,
Expand All @@ -674,7 +674,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel {
],
})
//#endregion
public sensorType: SensorType[] | undefined = undefined;
public sensors: string[] | undefined = undefined;

//#region 3D: footprint
@pycsw({
Expand Down Expand Up @@ -872,9 +872,12 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel {
type: 'text',
nullable: true,
},
field: {
overrideType: TsTypes.STRING,
},
})
@tsTypes({
mappingType: TsTypes.STRING,
mappingType: TsTypes.STRING_ARRAY,
})
@graphql({
nullable: true,
Expand All @@ -890,7 +893,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel {
],
})
//#endregion
public region: string | undefined = 'UNKNOWN';
public region: string[] | undefined = ['UNKNOWN'];

//#region 3D: classification
@pycsw({
Expand Down
17 changes: 9 additions & 8 deletions src/models/layerMetadata/layerDEMMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { IMetadataCommonModel } from './interfaces/metadataCommonModel';
import { getPyCSWMapping, IPYCSWMapping, pycsw } from './decorators/property/csw.decorator';
import { getCatalogDBMapping, ICatalogDBMapping, catalogDB } from './decorators/property/catalogDB.decorator';
import { getTsTypesMapping, tsTypes, TsTypes } from './decorators/property/tsTypes.decorator';
import { ProductType, SensorType } from './enums';
import { ProductType } from './enums';

export interface ILayerMetadata {
resolutionDegree: number | undefined;
Expand Down Expand Up @@ -344,7 +344,7 @@ export class LayerDemMetadata implements ILayerMetadata, IMetadataCommonModel {
//#endregion
public sourceDateEnd: Date | undefined = undefined;

//#region COMMON: sensorType //sensors
//#region COMMON: sensors
@pycsw({
profile: 'mc_dem',
xmlElement: 'mc:sensors',
Expand All @@ -355,14 +355,13 @@ export class LayerDemMetadata implements ILayerMetadata, IMetadataCommonModel {
column: {
name: 'sensor_type',
type: 'text',
nullable: true,
},
field: {
overrideType: TsTypes.STRING,
},
})
@tsTypes({
mappingType: TsTypes.SENSORTYPE_ARRAY,
mappingType: TsTypes.STRING_ARRAY,
})
@graphql({
nullable: true,
Expand All @@ -372,7 +371,7 @@ export class LayerDemMetadata implements ILayerMetadata, IMetadataCommonModel {
infoMsgCode: ['info-field-tooltip.sensorType.tooltip'],
})
//#endregion
public sensorType: SensorType[] | undefined = undefined;
public sensors: string[] | undefined = undefined;

//#region COMMON: region
@pycsw({
Expand All @@ -385,11 +384,13 @@ export class LayerDemMetadata implements ILayerMetadata, IMetadataCommonModel {
column: {
name: 'region',
type: 'text',
nullable: true,
},
field: {
overrideType: TsTypes.STRING,
},
})
@tsTypes({
mappingType: TsTypes.STRING,
mappingType: TsTypes.STRING_ARRAY,
})
@graphql({
nullable: true,
Expand All @@ -405,7 +406,7 @@ export class LayerDemMetadata implements ILayerMetadata, IMetadataCommonModel {
],
})
//#endregion
public region: string | undefined = undefined;
public region: string[] | undefined = undefined;

//#region COMMON: productId
@pycsw({
Expand Down
Loading

0 comments on commit 834f443

Please sign in to comment.