diff --git a/src/models/common/decorators/fieldConfig/fieldConfig.decorator.ts b/src/models/common/decorators/fieldConfig/fieldConfig.decorator.ts index 237593c8..eed1703d 100644 --- a/src/models/common/decorators/fieldConfig/fieldConfig.decorator.ts +++ b/src/models/common/decorators/fieldConfig/fieldConfig.decorator.ts @@ -31,6 +31,8 @@ export interface IFieldConfigInfo { isRequired?: boolean; // is field mandatory, deprecated should be implemeted by validation type='required' isAutoGenerated?: boolean; // is field non relevant as input field for ingestion, but should be presented as a part of the model. isLifecycleEnvolved?: boolean; // is field might be changed during external processes, outside of the app's form. + isCreateEssential?: boolean; // is field should participate in create process + isUpdateEssential?: boolean; // is field should participate in update process lookupTable?: string; // lookup table name where from comes allowed values (should participate in server-side validations) autocomplete?: { type: 'domain' | 'service'; diff --git a/src/models/index.ts b/src/models/index.ts index 5262b516..544e50a9 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -5,4 +5,5 @@ export * from './discreteIngestion/index'; export * from './pycsw/index'; export * from './rasterCatalog/index'; export * from './3dCatalog/index'; +export * from './raster/ingestion/index'; export * from './polygonParts/index'; diff --git a/src/models/layerMetadata/bestMetadata.ts b/src/models/layerMetadata/bestMetadata.ts index 42a1024d..6b7db79d 100644 --- a/src/models/layerMetadata/bestMetadata.ts +++ b/src/models/layerMetadata/bestMetadata.ts @@ -18,6 +18,7 @@ import { ProductType } from './enums'; import { DiscreteOrder } from './discreteOrder'; export interface IBestMetadata { + srsId: string | undefined; productVersion: string | undefined; maxResolutionDeg: number | undefined; rms: number | undefined; diff --git a/src/models/layerMetadata/interfaces/metadataCommonModel.ts b/src/models/layerMetadata/interfaces/metadataCommonModel.ts index 2bd677f3..9604ee2e 100644 --- a/src/models/layerMetadata/interfaces/metadataCommonModel.ts +++ b/src/models/layerMetadata/interfaces/metadataCommonModel.ts @@ -8,7 +8,6 @@ export interface IMetadataCommonModel { classification: string | undefined; productName: string | undefined; description: string | undefined; - srsId: string | undefined; srsName: string | undefined; producerName: string | undefined; updateDate: Date | undefined; diff --git a/src/models/layerMetadata/layer3DMetadata.ts b/src/models/layerMetadata/layer3DMetadata.ts index facdce12..0c95c893 100644 --- a/src/models/layerMetadata/layer3DMetadata.ts +++ b/src/models/layerMetadata/layer3DMetadata.ts @@ -15,6 +15,7 @@ import { catalogDB, ORMColumnType } from './decorators/property/catalogDB.decora import { IMetadataCommonModel } from './interfaces/metadataCommonModel'; export interface ILayer3DMetadata { + srsId: string | undefined; productVersion: number | undefined; creationDate: Date | undefined; minResolutionMeter: number | undefined; diff --git a/src/models/layerMetadata/layerDEMMetadata.ts b/src/models/layerMetadata/layerDEMMetadata.ts index b6e14287..38ab6208 100644 --- a/src/models/layerMetadata/layerDEMMetadata.ts +++ b/src/models/layerMetadata/layerDEMMetadata.ts @@ -16,6 +16,7 @@ import { getTsTypesMapping, tsTypes, TsTypes } from './decorators/property/tsTyp import { ProductType, RecordStatus } from './enums'; export interface ILayerMetadata { + srsId: string | undefined; resolutionDegree: number | undefined; resolutionMeter: number | undefined; absoluteAccuracyLEP90: number | undefined; diff --git a/src/models/layerMetadata/layerMetadata.ts b/src/models/layerMetadata/layerMetadata.ts index e48e779c..32903b9c 100644 --- a/src/models/layerMetadata/layerMetadata.ts +++ b/src/models/layerMetadata/layerMetadata.ts @@ -10,6 +10,7 @@ import { IPropFieldConfigInfo, } from '../common/decorators/fieldConfig/fieldConfig.decorator'; import { RecordType } from '../pycsw/coreEnums'; +import { NewRasterLayerMetadata, UpdateRasterLayerMetadata } from '../raster/ingestion'; import { IMetadataCommonModel } from './interfaces/metadataCommonModel'; import { getPyCSWMapping, IPYCSWMapping, pycsw } from './decorators/property/csw.decorator'; import { getInputDataMapping, IDataMapping, DataFileType, inputDataMapping, IPropSHPMapping } from './decorators/property/shp.decorator'; @@ -18,6 +19,7 @@ import { getTsTypesMapping, tsTypes, TsTypes } from './decorators/property/tsTyp import { ProductType, Transparency, TileOutputFormat } from './enums'; export interface ILayerMetadata { + srs: string | undefined; productVersion: string | undefined; maxResolutionDeg: number | undefined; rms: number | undefined; @@ -188,7 +190,7 @@ export class LayerMetadata implements ILayerMetadata, IMetadataCommonModel { //#endregion public description: string | undefined = undefined; - //#region COMMON: srsId + //#region COMMON: srs @pycsw({ profile: 'mc_raster', xmlElement: 'mc:SRS', @@ -221,7 +223,7 @@ export class LayerMetadata implements ILayerMetadata, IMetadataCommonModel { ], }) //#endregion - public srsId: string | undefined = undefined; + public srs: string | undefined = undefined; //#region COMMON: producerName @pycsw({ @@ -775,12 +777,12 @@ export class LayerMetadata implements ILayerMetadata, IMetadataCommonModel { { errorMsgCode: 'validation-field.maxResolutionDeg.min', valueType: 'value', - min: 0.00000009, + min: 1.67638e-7, }, { errorMsgCode: 'validation-field.maxResolutionDeg.max', valueType: 'value', - max: 0.072, + max: 0.703125, }, ], isLifecycleEnvolved: true, @@ -822,12 +824,12 @@ export class LayerMetadata implements ILayerMetadata, IMetadataCommonModel { { errorMsgCode: 'validation-field.maxResolutionMeter.min', valueType: 'value', - min: 0.01, + min: 0.0185, }, { errorMsgCode: 'validation-field.maxResolutionMeter.max', valueType: 'value', - max: 8000, + max: 78273, }, ], isLifecycleEnvolved: true, @@ -1200,6 +1202,8 @@ export class LayerMetadata implements ILayerMetadata, IMetadataCommonModel { public static getFieldConfigs(): IPropFieldConfigInfo[] { const ret = []; + const newLayerMetadataProps = Object.keys(new NewRasterLayerMetadata()); + const updatedLayerMetadataProps = Object.keys(new UpdateRasterLayerMetadata()); const layer = new LayerMetadata(); for (const prop in layer) { const fieldConfigMap = getFieldConfig(layer, prop); @@ -1207,6 +1211,8 @@ export class LayerMetadata implements ILayerMetadata, IMetadataCommonModel { ret.push({ prop: prop, ...fieldConfigMap, + isCreateEssential: newLayerMetadataProps.includes(prop), + isUpdateEssential: updatedLayerMetadataProps.includes(prop), }); } } diff --git a/src/models/layerMetadata/pycswLayerCatalogRecord.ts b/src/models/layerMetadata/pycswLayerCatalogRecord.ts index c87f2162..738f65ff 100644 --- a/src/models/layerMetadata/pycswLayerCatalogRecord.ts +++ b/src/models/layerMetadata/pycswLayerCatalogRecord.ts @@ -5,6 +5,7 @@ import { graphql } from '../common/decorators/graphQL/graphql.decorator'; import { graphqlClass } from '../common/decorators/graphQL/classGraphql.decorator'; import { FieldCategory, fieldConfig, getFieldConfig, IPropFieldConfigInfo } from '../common/decorators/fieldConfig/fieldConfig.decorator'; import { getFieldConfigClassInfo } from '../common/decorators/fieldConfig/classFieldConfig.decorator'; +import { NewRasterLayerMetadata, UpdateRasterLayerMetadata } from '../raster/ingestion'; import { Link } from './link'; import { catalogDB, getCatalogDBMapping } from './decorators/property/catalogDB.decorator'; import { getTsTypesMapping, TsTypes, tsTypes } from './decorators/property/tsTypes.decorator'; @@ -232,11 +233,18 @@ export class PycswLayerCatalogRecord extends LayerMetadata implements IPycswCore public static getFieldConfigs(): IPropFieldConfigInfo[] { const ret = []; + const newLayerMetadataProps = Object.keys(new NewRasterLayerMetadata()); + const updatedLayerMetadataProps = Object.keys(new UpdateRasterLayerMetadata()); const layer = new PycswLayerCatalogRecord(); for (const prop in layer) { const fieldConfigMap = getFieldConfig(layer, prop); if (fieldConfigMap) { - const fieldConfig = { prop: prop, ...fieldConfigMap }; + const fieldConfig = { + prop: prop, + ...fieldConfigMap, + isCreateEssential: newLayerMetadataProps.includes(prop), + isUpdateEssential: updatedLayerMetadataProps.includes(prop), + }; if (fieldConfigMap.complexType) { fieldConfig.subFields = getFieldConfigClassInfo(fieldConfigMap.complexType.value); } diff --git a/src/models/layerMetadata/quantizedMeshBestMetadata.ts b/src/models/layerMetadata/quantizedMeshBestMetadata.ts index b3398009..60aff9e9 100644 --- a/src/models/layerMetadata/quantizedMeshBestMetadata.ts +++ b/src/models/layerMetadata/quantizedMeshBestMetadata.ts @@ -18,6 +18,7 @@ import { IPropSHPMapping } from './decorators/property/shp.decorator'; export interface IQuantizedMeshBestMetadata { // Based on 3D Entity fields + srsId: string | undefined; productVersion: number | undefined; creationDate: Date | undefined; minResolutionMeter: number | undefined; diff --git a/src/models/polygonParts/polygonPart.ts b/src/models/polygonParts/polygonPart.ts deleted file mode 100644 index 6c6d80e4..00000000 --- a/src/models/polygonParts/polygonPart.ts +++ /dev/null @@ -1,501 +0,0 @@ -import { GeoJSON } from 'geojson'; -import { IPropCatalogDBMapping } from '../common/interfaces/propCatalogDBMapping.interface'; -import { graphql } from '../common/decorators/graphQL/graphql.decorator'; -import { - FieldCategory, - fieldConfig, - getFieldConfig, - IFieldConfigInfo, - IPropFieldConfigInfo, -} from '../common/decorators/fieldConfig/fieldConfig.decorator'; -import { - getInputDataMapping, - IDataMapping, - DataFileType, - inputDataMapping, - IPropSHPMapping, -} from '../layerMetadata/decorators/property/shp.decorator'; -import { getCatalogDBMapping, ICatalogDBMapping, catalogDB } from '../layerMetadata/decorators/property/catalogDB.decorator'; -import { getTsTypesMapping, tsTypes, TsTypes } from '../layerMetadata/decorators/property/tsTypes.decorator'; -import { IPYCSWMapping } from '../layerMetadata/decorators/property/csw.decorator'; - -export interface IPolygonPart { - id: string | undefined; - classification: string | undefined; - name: string | undefined; - description: string | undefined; - resolutionDegree: number | undefined; - resolutionMeter: number | undefined; - horizontalAccuracyCE90: number | undefined; - countries: string[] | undefined; - cities: string[] | undefined; - sensors: string[] | undefined; - imagingTimeBeginUTC: Date | undefined; - imagingTimeEndUTC: Date | undefined; - geometry: GeoJSON | undefined; -} - -export interface IPropPYCSWMapping extends IPYCSWMapping { - prop: string; -} - -export class PolygonPart implements IPolygonPart { - //#region METADATA: id - @catalogDB({ - column: { - name: 'id', - type: 'text', - nullable: true, - }, - }) - @inputDataMapping({ - dataFile: DataFileType.SHAPE_METADATA, - valuePath: 'properties.Source', - }) - @tsTypes({ - mappingType: TsTypes.STRING, - }) - @graphql() - @fieldConfig({ - category: FieldCategory.MAIN, - }) - //#endregion - public id: string | undefined = undefined; - - //#region METADATA: classification - @catalogDB({ - column: { - name: 'classification', - type: 'text', - nullable: false, - }, - }) - @tsTypes({ - mappingType: TsTypes.STRING, - }) - @graphql({ - nullable: false, - }) - @fieldConfig({ - category: FieldCategory.GENERAL, - lookupTable: 'classification', - }) - //#endregion - public classification: string | undefined = undefined; - - //#region METADATA: name - @catalogDB({ - column: { - name: 'name', - type: 'text', - nullable: true, - }, - }) - @inputDataMapping({ - dataFile: DataFileType.SHAPE_METADATA, - valuePath: 'properties.SourceName', - }) - @tsTypes({ - mappingType: TsTypes.STRING, - }) - @graphql() - @fieldConfig({ - category: FieldCategory.MAIN, - }) - //#endregion - public name: string | undefined = undefined; - - //#region METADATA: description - @catalogDB({ - column: { - name: 'description', - type: 'text', - nullable: true, - }, - }) - @inputDataMapping({ - dataFile: DataFileType.SHAPE_METADATA, - valuePath: 'properties.Dsc', - }) - @tsTypes({ - mappingType: TsTypes.STRING, - }) - @graphql({ - nullable: true, - }) - @fieldConfig({ - category: FieldCategory.GENERAL, - }) - //#endregion - public description: string | undefined = undefined; - - //#region METADATA: imagingTimeBeginUTC - @catalogDB({ - column: { - name: 'imagingTimeBeginUTC', - type: 'timestamp with time zone', - nullable: false, - }, - }) - @inputDataMapping({ - isCustomLogic: false, - dataFile: DataFileType.SHAPE_METADATA, - valuePath: 'properties.UpdateDate', - }) - @tsTypes({ - mappingType: TsTypes.DATE, - }) - @graphql() - @fieldConfig({ - category: FieldCategory.GENERAL, - infoMsgCode: ['info-general-tooltip.required', 'info-field-tooltip.sourceDateStart.max'], - validation: [ - { - errorMsgCode: 'validation-general.required', - required: true, - }, - { - errorMsgCode: 'validation-field.sourceDateStart.max', - valueType: 'field', - max: 'imagingTimeEndUTC', - }, - ], - isLifecycleEnvolved: true, - }) - //#endregion - public imagingTimeBeginUTC: Date | undefined = undefined; - - //#region METADATA: imagingTimeEndUTC - @catalogDB({ - column: { - name: 'imagingTimeEndUTC', - type: 'timestamp without time zone', - nullable: false, - }, - }) - @inputDataMapping({ - isCustomLogic: false, - dataFile: DataFileType.SHAPE_METADATA, - valuePath: 'properties.UpdateDate', - }) - @tsTypes({ - mappingType: TsTypes.DATE, - }) - @graphql() - @fieldConfig({ - category: FieldCategory.GENERAL, - infoMsgCode: ['info-general-tooltip.required'], - validation: [ - { - errorMsgCode: 'validation-general.required', - required: true, - }, - ], - isLifecycleEnvolved: true, - }) - //#endregion - public imagingTimeEndUTC: Date | undefined = undefined; - - //#region METADATA: horizontalAccuracyCE90 - @catalogDB({ - column: { - name: 'horizontalAccuracyCE90', - type: 'real', - }, - }) - @inputDataMapping({ - dataFile: DataFileType.SHAPE_METADATA, - valuePath: 'properties.Ep90', - }) - @tsTypes({ - mappingType: TsTypes.NUMBER, - }) - @graphql() - @fieldConfig({ - category: FieldCategory.GEO_INFO, - infoMsgCode: ['info-general-tooltip.required'], - validation: [ - { - errorMsgCode: 'validation-general.required', - required: true, - }, - { - errorMsgCode: 'validation-field.minHorizontalAccuracyCE90.min', - valueType: 'value', - min: 0.01, - }, - { - errorMsgCode: 'validation-field.minHorizontalAccuracyCE90.max', - valueType: 'value', - max: 4000, - }, - ], - isLifecycleEnvolved: true, - }) - //#endregion - public horizontalAccuracyCE90: number | undefined = undefined; - - //#region METADATA: sensors - @catalogDB({ - column: { - name: 'sensors', - type: 'text', - }, - field: { - overrideType: TsTypes.STRING, - }, - }) - @inputDataMapping({ - isCustomLogic: false, - dataFile: DataFileType.SHAPE_METADATA, - valuePath: 'properties.SensorType', - }) - @tsTypes({ - mappingType: TsTypes.STRING_ARRAY, - }) - @graphql() - @fieldConfig({ - category: FieldCategory.GENERAL, - isLifecycleEnvolved: true, - infoMsgCode: ['info-field-tooltip.sensors.tooltip', 'info-general-tooltip.required'], - validation: [ - { - errorMsgCode: 'validation-general.required', - required: true, - }, - ], - }) - //#endregion - public sensors: string[] | undefined = undefined; - - //#region METADATA: countries - @catalogDB({ - column: { - name: 'countries', - type: 'text', - nullable: true, - }, - field: { - overrideType: TsTypes.STRING, - }, - }) - @inputDataMapping({ - isCustomLogic: false, - dataFile: DataFileType.SHAPE_METADATA, - valuePath: 'properties.Countries', - }) - @tsTypes({ - mappingType: TsTypes.STRING_ARRAY, - }) - @graphql({ - nullable: true, - }) - @fieldConfig({ - category: FieldCategory.GENERAL, - infoMsgCode: ['info-field-tooltip.region.tooltip'], - }) - //#endregion - public countries: string[] | undefined = undefined; - - //#region **TO_VERIFY_CITIES?** METADATA: cities - @catalogDB({ - column: { - name: 'cities', - type: 'text', - nullable: true, - }, - field: { - overrideType: TsTypes.STRING, - }, - }) - @inputDataMapping({ - isCustomLogic: false, - dataFile: DataFileType.SHAPE_METADATA, - valuePath: 'properties.Cities', - }) - @tsTypes({ - mappingType: TsTypes.STRING_ARRAY, - }) - @graphql({ - nullable: true, - }) - @fieldConfig({ - category: FieldCategory.GENERAL, - }) - //#endregion - public cities: string[] | undefined = undefined; - - //#region METADATA: resolutionDegree - @catalogDB({ - column: { - name: 'resolutionDegree', - type: 'numeric', - }, - }) - @tsTypes({ - mappingType: TsTypes.NUMBER, - }) - @graphql() - @fieldConfig({ - category: FieldCategory.MAIN, - infoMsgCode: [ - 'info-field-tooltip.maxResolutionDeg.tooltip', - 'info-general-tooltip.required', - 'info-field-tooltip.maxResolutionDeg.min', - 'info-field-tooltip.maxResolutionDeg.max', - ], - validation: [ - { - errorMsgCode: 'validation-general.required', - required: true, - }, - { - errorMsgCode: 'validation-field.maxResolutionDeg.min', - valueType: 'value', - min: 0.00000009, - }, - { - errorMsgCode: 'validation-field.maxResolutionDeg.max', - valueType: 'value', - max: 0.072, - }, - ], - }) - //#endregion - public resolutionDegree: number | undefined = undefined; - - //#region METADATA: resolutionMeter - @catalogDB({ - column: { - name: 'resolutionMeter', - type: 'numeric', - }, - }) - @inputDataMapping({ - dataFile: DataFileType.SHAPE_METADATA, - valuePath: 'properties.Resolution', - }) - @tsTypes({ - mappingType: TsTypes.NUMBER, - }) - @graphql() - @fieldConfig({ - category: FieldCategory.MAIN, - infoMsgCode: ['info-general-tooltip.required', 'info-field-tooltip.maxResolutionMeter.min', 'info-field-tooltip.maxResolutionMeter.max'], - validation: [ - { - errorMsgCode: 'validation-general.required', - required: true, - }, - { - errorMsgCode: 'validation-field.maxResolutionMeter.min', - valueType: 'value', - min: 0.01, - }, - { - errorMsgCode: 'validation-field.maxResolutionMeter.max', - valueType: 'value', - max: 8000, - }, - ], - }) - //#endregion - public resolutionMeter: number | undefined = undefined; - - //#region METADATA: geometry - @catalogDB({ - column: { - name: 'geometry', - type: 'text', - }, - }) - @inputDataMapping({ - dataFile: DataFileType.PRODUCT, - valuePath: 'geometry', - }) - @tsTypes({ - mappingType: TsTypes.OBJECT, - }) - @graphql() - @fieldConfig({ - category: FieldCategory.GEO_INFO, - infoMsgCode: ['info-general-tooltip.required'], - validation: [ - { - errorMsgCode: 'validation-general.required', - required: true, - }, - { - errorMsgCode: 'validation-field.footprint.json', - json: true, - }, - ], - }) - //#endregion - public geometry: GeoJSON | undefined = undefined; - - public static getShpMapping(prop: string): IDataMapping | undefined { - return getInputDataMapping(new PolygonPart(), prop); - } - - public static getCatalogDBMapping(prop: string): ICatalogDBMapping | undefined { - return getCatalogDBMapping(new PolygonPart(), prop); - } - - public static getFieldConfig(prop: string): IFieldConfigInfo | undefined { - return getFieldConfig(new PolygonPart(), prop); - } - - public static getPyCSWMappings(): IPropPYCSWMapping[] { - return []; - } - - public static getCatalogDBMappings(): IPropCatalogDBMapping[] { - const ret = []; - const layer = new PolygonPart(); - for (const prop in layer) { - const catalogDbMap = getCatalogDBMapping(layer, prop); - const tsTypesMap = getTsTypesMapping(layer, prop); - if (catalogDbMap && tsTypesMap) { - ret.push({ - prop: prop, - ...catalogDbMap, - ...tsTypesMap, - }); - } - } - return ret; - } - - public static getShpMappings(includeCustomLogic = false): IPropSHPMapping[] { - const ret = []; - const layer = new PolygonPart(); - for (const prop in layer) { - const shpMap = getInputDataMapping(layer, prop); - const tsTypesMap = getTsTypesMapping(layer, prop); - if (shpMap && tsTypesMap && (includeCustomLogic || shpMap.isCustomLogic === undefined || !shpMap.isCustomLogic)) { - ret.push({ - prop: prop, - ...shpMap, - ...tsTypesMap, - }); - } - } - return ret; - } - - public static getFieldConfigs(): IPropFieldConfigInfo[] { - const ret = []; - const layer = new PolygonPart(); - for (const prop in layer) { - const fieldConfigMap = getFieldConfig(layer, prop); - if (fieldConfigMap) { - ret.push({ - prop: prop, - ...fieldConfigMap, - }); - } - } - return ret; - } -} diff --git a/src/models/polygonParts/polygonPartRecord.ts b/src/models/polygonParts/polygonPartRecord.ts index b3e6d963..7fd39ba4 100644 --- a/src/models/polygonParts/polygonPartRecord.ts +++ b/src/models/polygonParts/polygonPartRecord.ts @@ -1,22 +1,410 @@ -import { IPycswCoreModel } from '../pycsw/interfaces/pycswCoreModel'; -import { IPropCatalogDBMapping } from '../common/interfaces/propCatalogDBMapping.interface'; -import { IOrmCatalog } from '../common/interfaces/ormCatalog.interface'; +import { GeoJSON } from 'geojson'; import { graphql } from '../common/decorators/graphQL/graphql.decorator'; -import { graphqlClass } from '../common/decorators/graphQL/classGraphql.decorator'; -import { FieldCategory, fieldConfig, getFieldConfig, IPropFieldConfigInfo } from '../common/decorators/fieldConfig/fieldConfig.decorator'; -import { getFieldConfigClassInfo } from '../common/decorators/fieldConfig/classFieldConfig.decorator'; +import { FieldCategory, IPropFieldConfigInfo, fieldConfig, getFieldConfig } from '../common/decorators/fieldConfig/fieldConfig.decorator'; +import { DataFileType, IPropSHPMapping, getInputDataMapping, inputDataMapping } from '../layerMetadata/decorators/property/shp.decorator'; import { catalogDB, getCatalogDBMapping } from '../layerMetadata/decorators/property/catalogDB.decorator'; -import { getTsTypesMapping, TsTypes, tsTypes } from '../layerMetadata/decorators/property/tsTypes.decorator'; -import { getCatalogDBEntityMapping, catalogDBEntity, ICatalogDBEntityMapping } from '../layerMetadata/decorators/class/catalogDBEntity.decorator'; -import { getInputDataMapping, IPropSHPMapping } from '../layerMetadata/decorators/property/shp.decorator'; -import { IPropPYCSWMapping, PolygonPart } from './polygonPart'; - -@catalogDBEntity({ - table: 'records', - className: 'RecordEntity', -}) +import { getTsTypesMapping, tsTypes, TsTypes } from '../layerMetadata/decorators/property/tsTypes.decorator'; +import { ICatalogDBEntityMapping, IOrmCatalog, IPYCSWMapping } from '../layerMetadata'; +import { graphqlClass, IPropCatalogDBMapping } from '../common'; +import { getCatalogDBEntityMapping } from '../layerMetadata/decorators/class/catalogDBEntity.decorator'; + +interface IPropPYCSWMapping extends IPYCSWMapping { + prop: string; +} + @graphqlClass({ alias: 'PolygonPartRecord' }) -export class PolygonPartRecord extends PolygonPart implements IOrmCatalog { +export class PolygonPartRecord implements IPolygonPart, IOrmCatalog { + //#region METADATA: id + @catalogDB({ + column: { + name: 'id', + type: 'text', + nullable: true, + }, + }) + @inputDataMapping({ + dataFile: DataFileType.SHAPE_METADATA, + valuePath: 'properties.Source', + }) + @tsTypes({ + mappingType: TsTypes.STRING, + }) + @graphql() + @fieldConfig({ + category: FieldCategory.MAIN, + }) + //#endregion + public id: string | undefined = undefined; + + //#region METADATA: name + @catalogDB({ + column: { + name: 'name', + type: 'text', + nullable: true, + }, + }) + @inputDataMapping({ + dataFile: DataFileType.SHAPE_METADATA, + valuePath: 'properties.SourceName', + }) + @tsTypes({ + mappingType: TsTypes.STRING, + }) + @graphql() + @fieldConfig({ + category: FieldCategory.MAIN, + }) + //#endregion + public name: string | undefined = undefined; + + //#region METADATA: description + @catalogDB({ + column: { + name: 'description', + type: 'text', + nullable: true, + }, + }) + @inputDataMapping({ + dataFile: DataFileType.SHAPE_METADATA, + valuePath: 'properties.Dsc', + }) + @tsTypes({ + mappingType: TsTypes.STRING, + }) + @graphql({ + nullable: true, + }) + @fieldConfig({ + category: FieldCategory.GENERAL, + }) + //#endregion + public description: string | undefined = undefined; + + //#region METADATA: imagingTimeBeginUTC + @catalogDB({ + column: { + name: 'imagingTimeBeginUTC', + type: 'timestamp with time zone', + nullable: false, + }, + }) + @inputDataMapping({ + isCustomLogic: false, + dataFile: DataFileType.SHAPE_METADATA, + valuePath: 'properties.UpdateDate', + }) + @tsTypes({ + mappingType: TsTypes.DATE, + }) + @graphql() + @fieldConfig({ + category: FieldCategory.GENERAL, + infoMsgCode: ['info-general-tooltip.required', 'info-field-tooltip.sourceDateStart.max'], + validation: [ + { + errorMsgCode: 'validation-general.required', + required: true, + }, + { + errorMsgCode: 'validation-field.sourceDateStart.max', + valueType: 'field', + max: 'imagingTimeEndUTC', + }, + ], + isLifecycleEnvolved: true, + }) + //#endregion + public imagingTimeBeginUTC: Date | undefined = undefined; + + //#region METADATA: imagingTimeEndUTC + @catalogDB({ + column: { + name: 'imagingTimeEndUTC', + type: 'timestamp without time zone', + nullable: false, + }, + }) + @inputDataMapping({ + isCustomLogic: false, + dataFile: DataFileType.SHAPE_METADATA, + valuePath: 'properties.UpdateDate', + }) + @tsTypes({ + mappingType: TsTypes.DATE, + }) + @graphql() + @fieldConfig({ + category: FieldCategory.GENERAL, + infoMsgCode: ['info-general-tooltip.required'], + validation: [ + { + errorMsgCode: 'validation-general.required', + required: true, + }, + ], + isLifecycleEnvolved: true, + }) + //#endregion + public imagingTimeEndUTC: Date | undefined = undefined; + + //#region METADATA: horizontalAccuracyCE90 + @catalogDB({ + column: { + name: 'horizontalAccuracyCE90', + type: 'real', + }, + }) + @inputDataMapping({ + dataFile: DataFileType.SHAPE_METADATA, + valuePath: 'properties.Ep90', + }) + @tsTypes({ + mappingType: TsTypes.NUMBER, + }) + @graphql() + @fieldConfig({ + category: FieldCategory.GEO_INFO, + infoMsgCode: ['info-general-tooltip.required'], + validation: [ + { + errorMsgCode: 'validation-general.required', + required: true, + }, + { + errorMsgCode: 'validation-field.minHorizontalAccuracyCE90.min', + valueType: 'value', + min: 0.01, + }, + { + errorMsgCode: 'validation-field.minHorizontalAccuracyCE90.max', + valueType: 'value', + max: 4000, + }, + ], + isLifecycleEnvolved: true, + }) + //#endregion + public horizontalAccuracyCE90: number | undefined = undefined; + + //#region METADATA: sensors + @catalogDB({ + column: { + name: 'sensors', + type: 'text', + }, + field: { + overrideType: TsTypes.STRING, + }, + }) + @inputDataMapping({ + isCustomLogic: false, + dataFile: DataFileType.SHAPE_METADATA, + valuePath: 'properties.SensorType', + }) + @tsTypes({ + mappingType: TsTypes.STRING_ARRAY, + }) + @graphql() + @fieldConfig({ + category: FieldCategory.GENERAL, + isLifecycleEnvolved: true, + infoMsgCode: ['info-field-tooltip.sensors.tooltip', 'info-general-tooltip.required'], + validation: [ + { + errorMsgCode: 'validation-general.required', + required: true, + }, + ], + }) + //#endregion + public sensors: string[] | undefined = undefined; + + //#region METADATA: countries + @catalogDB({ + column: { + name: 'countries', + type: 'text', + nullable: true, + }, + field: { + overrideType: TsTypes.STRING, + }, + }) + @inputDataMapping({ + isCustomLogic: false, + dataFile: DataFileType.SHAPE_METADATA, + valuePath: 'properties.Countries', + }) + @tsTypes({ + mappingType: TsTypes.STRING_ARRAY, + }) + @graphql({ + nullable: true, + }) + @fieldConfig({ + category: FieldCategory.GENERAL, + infoMsgCode: ['info-field-tooltip.region.tooltip'], + }) + //#endregion + public countries: string[] | undefined = undefined; + + //#region **TO_VERIFY_CITIES?** METADATA: cities + @catalogDB({ + column: { + name: 'cities', + type: 'text', + nullable: true, + }, + field: { + overrideType: TsTypes.STRING, + }, + }) + @inputDataMapping({ + isCustomLogic: false, + dataFile: DataFileType.SHAPE_METADATA, + valuePath: 'properties.Cities', + }) + @tsTypes({ + mappingType: TsTypes.STRING_ARRAY, + }) + @graphql({ + nullable: true, + }) + @fieldConfig({ + category: FieldCategory.GENERAL, + }) + //#endregion + public cities: string[] | undefined = undefined; + + //#region METADATA: resolutionDegree??? [from INGESTION PARAMS] + @catalogDB({ + column: { + name: 'resolutionDegree', + type: 'numeric', + }, + }) + @tsTypes({ + mappingType: TsTypes.NUMBER, + }) + @graphql() + @fieldConfig({ + category: FieldCategory.MAIN, + isAutoGenerated: true, + infoMsgCode: [ + 'info-field-tooltip.maxResolutionDeg.tooltip', + 'info-general-tooltip.required', + 'info-field-tooltip.maxResolutionDeg.min', + 'info-field-tooltip.maxResolutionDeg.max', + ], + validation: [ + { + errorMsgCode: 'validation-field.maxResolutionDeg.min', + valueType: 'value', + min: 1.67638e-7, + }, + { + errorMsgCode: 'validation-field.maxResolutionDeg.max', + valueType: 'value', + max: 0.703125, + }, + ], + }) + //#endregion + public resolutionDegree: number | undefined = undefined; + + //#region METADATA: resolutionMeter [from INGESTION PARAMS] + @catalogDB({ + column: { + name: 'resolutionMeter', + type: 'numeric', + }, + }) + @tsTypes({ + mappingType: TsTypes.NUMBER, + }) + @graphql() + @fieldConfig({ + category: FieldCategory.MAIN, + infoMsgCode: ['info-general-tooltip.required', 'info-field-tooltip.maxResolutionMeter.min', 'info-field-tooltip.maxResolutionMeter.max'], + isAutoGenerated: true, + validation: [ + { + errorMsgCode: 'validation-field.maxResolutionMeter.min', + valueType: 'value', + min: 0.0185, + }, + { + errorMsgCode: 'validation-field.maxResolutionMeter.max', + valueType: 'value', + max: 78273, + }, + ], + }) + //#endregion + public resolutionMeter: number | undefined = undefined; + + //#region METADATA: sourceResolutionMeter [READONLY] + @catalogDB({ + column: { + name: 'sourceResolutionMeter', + type: 'numeric', + }, + }) + @tsTypes({ + mappingType: TsTypes.NUMBER, + }) + @inputDataMapping({ + dataFile: DataFileType.SHAPE_METADATA, + valuePath: 'properties.Resolution', + }) + @graphql() + @fieldConfig({ + category: FieldCategory.MAIN, + infoMsgCode: ['info-general-tooltip.required'], + validation: [ + { + errorMsgCode: 'validation-general.required', + required: true, + }, + ], + }) + //#endregion + public sourceResolutionMeter: number | undefined = undefined; + + //#region METADATA: geometry + @catalogDB({ + column: { + name: 'geometry', + type: 'text', + }, + }) + @inputDataMapping({ + dataFile: DataFileType.PRODUCT, + valuePath: 'geometry', + }) + @tsTypes({ + mappingType: TsTypes.OBJECT, + }) + @graphql() + @fieldConfig({ + category: FieldCategory.GEO_INFO, + infoMsgCode: ['info-general-tooltip.required'], + validation: [ + { + errorMsgCode: 'validation-general.required', + required: true, + }, + { + errorMsgCode: 'validation-field.footprint.json', + json: true, + }, + ], + }) + //#endregion + public geometry: GeoJSON | undefined = undefined; + //#region RECORD: internalId_partId @catalogDB({ column: { @@ -76,10 +464,10 @@ export class PolygonPartRecord extends PolygonPart implements IOrmCatalog { //#endregion public recordId: string | undefined = 'UNKNOWN'; - //#region RECORD: version + //#region RECORD: updatedInVersion [Version number of the best layer when it was updated] @catalogDB({ column: { - name: 'version', + name: 'updatedInVersion', type: 'text', nullable: true, }, @@ -93,6 +481,7 @@ export class PolygonPartRecord extends PolygonPart implements IOrmCatalog { @fieldConfig({ category: FieldCategory.MAIN, infoMsgCode: ['info-field-tooltip.productVersion.pattern'], + isAutoGenerated: true, validation: [ { errorMsgCode: 'validation-field.productVersion.pattern', @@ -102,7 +491,7 @@ export class PolygonPartRecord extends PolygonPart implements IOrmCatalog { ], }) //#endregion - public version: string | undefined = undefined; + public updatedInVersion: string | undefined = undefined; //#region RECORD: ingestionDateUTC @catalogDB({ @@ -122,41 +511,36 @@ export class PolygonPartRecord extends PolygonPart implements IOrmCatalog { //#endregion public ingestionDateUTC: Date | undefined = undefined; - public constructor() { - super(); - } - public static getPyCSWMappings(): IPropPYCSWMapping[] { return []; } - public static getFieldConfigs(): IPropFieldConfigInfo[] { + public static getShpMappings(includeCustomLogic = false): IPropSHPMapping[] { const ret = []; const layer = new PolygonPartRecord(); for (const prop in layer) { - const fieldConfigMap = getFieldConfig(layer, prop); - if (fieldConfigMap) { - const fieldConfig = { prop: prop, ...fieldConfigMap }; - if (fieldConfigMap.complexType) { - fieldConfig.subFields = getFieldConfigClassInfo(fieldConfigMap.complexType.value); - } - ret.push(fieldConfig); + const shpMap = getInputDataMapping(layer, prop); + const tsTypesMap = getTsTypesMapping(layer, prop); + if (shpMap && tsTypesMap && (includeCustomLogic || shpMap.isCustomLogic === undefined || !shpMap.isCustomLogic)) { + ret.push({ + prop: prop, + ...shpMap, + ...tsTypesMap, + }); } } - return ret as IPropFieldConfigInfo[]; + return ret; } - public static getShpMappings(includeCustomLogic = false): IPropSHPMapping[] { + public static getFieldConfigs(): IPropFieldConfigInfo[] { const ret = []; - const layer = new PolygonPart(); + const layer = new PolygonPartRecord(); for (const prop in layer) { - const shpMap = getInputDataMapping(layer, prop); - const tsTypesMap = getTsTypesMapping(layer, prop); - if (shpMap && tsTypesMap && (includeCustomLogic || shpMap.isCustomLogic === undefined || !shpMap.isCustomLogic)) { + const fieldConfigMap = getFieldConfig(layer, prop); + if (fieldConfigMap) { ret.push({ prop: prop, - ...shpMap, - ...tsTypesMap, + ...fieldConfigMap, }); } } @@ -184,3 +568,19 @@ export class PolygonPartRecord extends PolygonPart implements IOrmCatalog { return getCatalogDBEntityMapping(PolygonPartRecord); } } + +export interface IPolygonPart { + id: string | undefined; + name: string | undefined; + description: string | undefined; + resolutionDegree: number | undefined; + resolutionMeter: number | undefined; + sourceResolutionMeter: number | undefined; + horizontalAccuracyCE90: number | undefined; + countries: string[] | undefined; + cities: string[] | undefined; + sensors: string[] | undefined; + imagingTimeBeginUTC: Date | undefined; + imagingTimeEndUTC: Date | undefined; + geometry: GeoJSON | undefined; +} diff --git a/src/models/raster/ingestion/index.ts b/src/models/raster/ingestion/index.ts new file mode 100644 index 00000000..97acce18 --- /dev/null +++ b/src/models/raster/ingestion/index.ts @@ -0,0 +1 @@ +export * from './ingestionTypes'; diff --git a/src/models/raster/ingestion/ingestionTypes.ts b/src/models/raster/ingestion/ingestionTypes.ts new file mode 100644 index 00000000..5d42dc38 --- /dev/null +++ b/src/models/raster/ingestion/ingestionTypes.ts @@ -0,0 +1,85 @@ +import { LayerMetadata, ProductType, Transparency } from '../../layerMetadata'; +import { PolygonPartRecord } from '../../polygonParts'; + +export type IUpdateRasterLayerMetadata = Pick; + +export class UpdateRasterLayerMetadata implements IUpdateRasterLayerMetadata { + public productSubType: string | undefined; + public description: string | undefined; + public region: string[] | undefined; + public classification: string | undefined; + public scale: number | undefined; + + public constructor(productSubType?: string, description?: string, region?: string[], classification?: string, scale?: number) { + this.productSubType = productSubType; + this.description = description; + this.region = region; + this.classification = classification; + this.scale = scale; + } +} + +export type INewRasterLayerMetadata = UpdateRasterLayerMetadata & + Pick; + +export class NewRasterLayerMetadata extends UpdateRasterLayerMetadata implements INewRasterLayerMetadata { + public productId: string | undefined; + public producerName: string | undefined; + public productType: ProductType | undefined; + public srs: string | undefined; + public srsName: string | undefined; + public transparency: Transparency | undefined; + public productName: string | undefined; + + public constructor( + productId?: string, + producerName?: string, + productType?: ProductType, + srs?: string, + srsName?: string, + transparency?: Transparency, + productName?: string, + productSubType?: string, + description?: string, + region?: string[], + classification?: string, + scale?: number + ) { + super(productSubType, description, region, classification, scale); + this.productId = productId; + this.producerName = producerName; + this.productType = productType; + this.srs = srs; + this.srsName = srsName; + this.transparency = transparency; + this.productName = productName; + } +} + +export type PolygonPart = Pick< + PolygonPartRecord, + | 'id' + | 'name' + | 'description' + | 'resolutionDegree' + | 'resolutionMeter' + | 'sourceResolutionMeter' + | 'horizontalAccuracyCE90' + | 'countries' + | 'cities' + | 'sensors' + | 'imagingTimeBeginUTC' + | 'imagingTimeEndUTC' + | 'geometry' +>; + +export interface InputFiles { + originDirectory: string; + fileNames: string[]; +} + +export interface RasterIngestionLayer { + metadata: NewRasterLayerMetadata | UpdateRasterLayerMetadata; + partData: PolygonPart[]; + inputFiles: InputFiles; +} diff --git a/src/yaml/ingestionTrigger/inputFiles/rasterLayerInputFiles.yaml b/src/yaml/ingestionTrigger/inputFiles/rasterLayerInputFiles.yaml new file mode 100644 index 00000000..127845b0 --- /dev/null +++ b/src/yaml/ingestionTrigger/inputFiles/rasterLayerInputFiles.yaml @@ -0,0 +1,24 @@ +openapi: "3.0.1" +info: + title: Layer metadata definitions + version: 1.0.0 +components: + schemas: + InputFiles: + title: 'Layer input files' + type: object + properties: + originDirectory: + type: string + example: 'string' + description: layer source directory + fileNames: + type: array + items: + type: string + pattern: ^.+\.[Gg][Pp][Kk][Gg]$ + description: layer source files + example: ['example.gpkg'] + required: + - originDirectory + - fileNames diff --git a/src/yaml/ingestionTrigger/metadata/rasterLayerMetadata.yaml b/src/yaml/ingestionTrigger/metadata/rasterLayerMetadata.yaml new file mode 100644 index 00000000..c6c5f61b --- /dev/null +++ b/src/yaml/ingestionTrigger/metadata/rasterLayerMetadata.yaml @@ -0,0 +1,71 @@ +openapi: "3.0.1" +info: + title: layer metadata definitions + version: 1.0.0 +components: + schemas: + updateRasterLayerMetadata: + type: object + required: + - region + - classification + description: layer meta data that will override + properties: + productSubType: + type: string + description: Layer's sub type + description: + type: string + description: layer's description + region: + type: string + description: region of record + classification: + type: string + description: Permitted roles + scale: + type: integer + minimum: 0 + maximum: 100000000 + newRasterLayerMetadata: + type: object + allOf: + - $ref: '#/components/schemas/updateRasterLayerMetadata' + - properties: + productId: + type: string + description: Layer's external identifier + pattern: ^[a-zA-Z0-9_-]+$ + productName: + type: string + description: Layer's external name + productType: + $ref: '#/components/schemas/productType' + srs: + type: string + description: geo system id + srsName: + type: string + description: geo system name + transparency: + type: string + enum: + - TRANSPARENT + - OPAQUE + description: layer can be transparent or opaque + producerName: + type: string + description: creator name default IDFMU + productType: + type: string + enum: + - Orthophoto + - OrthophotoHistory + - OrthophotoBest + - RasterMap + - RasterMapBest + - RasterAid + - RasterAidBest + - RasterVector + - RasterVectorBest + description: layer's type might be derived from the first letter diff --git a/src/yaml/ingestionTrigger/partData/rasterLayerPartData.yaml b/src/yaml/ingestionTrigger/partData/rasterLayerPartData.yaml new file mode 100644 index 00000000..e126733a --- /dev/null +++ b/src/yaml/ingestionTrigger/partData/rasterLayerPartData.yaml @@ -0,0 +1,78 @@ +openapi: "3.0.1" +info: + title: Layer polygon part + version: 1.0.0 +components: + schemas: + polygonPartMetadata: + type: object + description: Layer polygon part data definitions + required: + - name + - imagingTimeBeginUTC + - imagingTimeEndUTC + - geometry + - resolutionDegree + - resolutionMeter + - sourceResolutionMeter + - horizontalAccuracyCE90 + - sensors + properties: + id: + type: string + description: Layer's external identifier + name: + type: string + description: Layer's external name + imagingTimeBeginUTC: + type: string + description: Oldest imaging date (UTC) + format: date-time + imagingTimeEndUTC: + type: string + description: Latest imaging date (UTC) + format: date-time + resolutionDegree: + type: number + minimum: 1.67638e-7 + maximum: 0.703125 + format: double + description: min resolution of layer in degrees/pixel + resolutionMeter: + type: number + minimum: 0.0185 + maximum: 78273 + format: double + description: min resolution of layer in meters + sourceResolutionMeter: + type: number + minimum: 0.0185 + maximum: 78273 + format: double + description: min resolution of layer in meters + horizontalAccuracyCE90: + type: number + minimum: 0.01 + maximum: 4000 + format: double + description: minimum Horizontal Accuracy + sensors: + type: array + items: + type: string + description: Layer sensors list + countries: + type: array + items: + type: string + description: countries included in the layer + cities: + type: array + items: + type: string + description: cities included in the layer + description: + type: string + geometry: + $ref: '../../geojson.yaml#/components/schemas/Geometry' + example: ['example.gpkg'] diff --git a/src/yaml/ingestionTrigger/rasterLayer.yaml b/src/yaml/ingestionTrigger/rasterLayer.yaml new file mode 100644 index 00000000..fb6d74a9 --- /dev/null +++ b/src/yaml/ingestionTrigger/rasterLayer.yaml @@ -0,0 +1,24 @@ +openapi: "3.0.1" +info: + title: Raster layer definitions + version: 1.0.0 +components: + schemas: + NewRasterLayer: + type: object + properties: + metadata: + $ref: './metadata/rasterLayerMetadata.yaml#/components/schemas/newRasterLayerMetadata' + partData: + $ref: './partData/rasterLayerPartData.yaml#/components/schemas/polygonPartMetadata' + inputFiles: + $ref: './inputFiles/rasterLayerInputFiles.yaml#/components/schemas/InputFiles' + UpdateRasterLayer: + type: object + properties: + metadata: + $ref: './metadata/rasterLayerMetadata.yaml#/components/schemas/updateRasterLayerMetadata' + partData: + $ref: './partData/rasterLayerPartData.yaml#/components/schemas/polygonPartMetadata' + inputFiles: + $ref: './inputFiles/rasterLayerInputFiles.yaml#/components/schemas/InputFiles' diff --git a/src/yaml/ingestionTrigger/rasterLayerExample.yaml b/src/yaml/ingestionTrigger/rasterLayerExample.yaml new file mode 100644 index 00000000..70541eef --- /dev/null +++ b/src/yaml/ingestionTrigger/rasterLayerExample.yaml @@ -0,0 +1,95 @@ +openapi: "3.0.1" +info: + title: Raster layer examples + version: 1.0.0 +components: + examples: + NewRasterLayerExample: + value: + metadata: + productId: string + productName: string + productType: Orthophoto + productSubType: string + description: string + srs: '4326' + srsName: 'WGS84GEO' + transparency: TRANSPARENT + region: string + classification: '6' + producerName: string + scale: 100000000 + partData: + - id: string + name: string + imagingTimeBeginUTC: "2024-01-28T13:47:43.427Z" + imagingTimeEndUTC: "2024-01-28T13:47:43.427Z" + resolutionDegree: 0.703125 + resolutionMeter: 8000 + sourceResolutionMeter: 8000 + horizontalAccuracyCE90: 10 + sensors: + - string + countries: + - string + cities: + - string + description: string + geometry: + type: Polygon + coordinates: + - - - 34.85149443279957 + - 32.30543192283443 + - - 34.85149443279957 + - 32.29430955805424 + - - 34.86824157112912 + - 32.29430955805424 + - - 34.86824157112912 + - 32.30543192283443 + - - 34.85149443279957 + - 32.30543192283443 + inputFiles: + originDirectory: string + fileNames: + - 'example.gpkg' + UpdateRasterLayerExample: + value: + metadata: + productSubType: string + description: string + region: string + classification: '6' + scale: 100000000 + partData: + - id: string + name: string + imagingTimeBeginUTC: "2024-01-28T13:47:43.427Z" + imagingTimeEndUTC: "2024-01-28T13:47:43.427Z" + resolutionDegree: 0.703125 + resolutionMeter: 78273 + sourceResolutionMeter: 78273 + horizontalAccuracyCE90: 10 + sensors: + - string + countries: + - string + cities: + - string + description: string + geometry: + type: Polygon + coordinates: + - - - 34.85149443279957 + - 32.30543192283443 + - - 34.85149443279957 + - 32.29430955805424 + - - 34.86824157112912 + - 32.29430955805424 + - - 34.86824157112912 + - 32.30543192283443 + - - 34.85149443279957 + - 32.30543192283443 + inputFiles: + originDirectory: string + fileNames: + - 'example.gpkg' diff --git a/src/yaml/ingestionTrigger/responses/ingestionTriggerResponses.yaml b/src/yaml/ingestionTrigger/responses/ingestionTriggerResponses.yaml new file mode 100644 index 00000000..ee6c7d13 --- /dev/null +++ b/src/yaml/ingestionTrigger/responses/ingestionTriggerResponses.yaml @@ -0,0 +1,68 @@ +openapi: "3.0.1" +info: + title: Layer metadata definitions + version: 1.0.0 +components: + schemas: + sourcesInfoResponse: + type: array + items: + type: object + properties: + crs: + type: number + fileFormat: + type: string + pixelSize: + type: number + extentPolygon: + $ref: '../../geojson.yaml#/components/schemas/Geometry' + required: + - crs + - fileFormat + - pixelSize + - extentPolygon + example: + crs: 4326 + fileFormat: gpkg + pixelSize: 0.703125 + extentPolygon: + type: Polygon + coordinates: + - - - -180 + - -90 + - - -180 + - 90 + - - 180 + - 90 + - - 180 + - -90 + - - -180 + - -90 + validateSourcesResponse: + type: object + properties: + isValid: + type: boolean + example: true + message: + type: string + example: "Files are valid" + required: + - status + - message + successMessage: + type: object + properties: + status: + type: string + example: "success" + required: + - message + errorMessage: + type: object + properties: + message: + type: string + required: + - message diff --git a/src/yaml/updateLayerMetadata.yaml b/src/yaml/updateLayerMetadata.yaml index cf1c7c76..b4ec6470 100644 --- a/src/yaml/updateLayerMetadata.yaml +++ b/src/yaml/updateLayerMetadata.yaml @@ -77,14 +77,14 @@ components: format: date-time maxResolutionDeg: type: number - minimum: 0.00000009 - maximum: 0.072 + minimum: 1.67638e-7 + maximum: 0.703125 format: double description: max resolution of layer in degrees/pixel maxResolutionMeter: type: number - minimum: 0.01 - maximum: 8000 + minimum: 0.0185 + maximum: 78273 format: double description: max (rounded) resolution of layer in meters/pixel minHorizontalAccuracyCE90: