Skip to content

Commit

Permalink
App and 3D integration (#145)
Browse files Browse the repository at this point in the history
* fix: product status

* fix: quantized mesh

* fix: fix
  • Loading branch information
EllaMartirosyan authored Sep 7, 2022
1 parent 98c54ec commit d72ab98
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 48 deletions.
6 changes: 2 additions & 4 deletions src/models/layerMetadata/layer3DMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1147,11 +1147,9 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel {
},
})
@tsTypes({
mappingType: TsTypes.STRING,
})
@graphql({
nullable: true,
mappingType: TsTypes.RECORD_STATUS,
})
@graphql()
@fieldConfig({
category: FieldCategory.GENERAL,
isManuallyEditable: true,
Expand Down
123 changes: 79 additions & 44 deletions src/models/layerMetadata/quantizedMeshBestMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,32 @@ import {
} from '../common/decorators/fieldConfig/fieldConfig.decorator';
import { RecordType } from '../pycsw/coreEnums';
import { getPyCSWMapping, IPYCSWMapping, pycsw } from './decorators/property/csw.decorator';
import { catalogDB, getCatalogDBMapping, ICatalogDBMapping } from './decorators/property/catalogDB.decorator';
import { catalogDB, getCatalogDBMapping, ICatalogDBMapping, ORMColumnType } from './decorators/property/catalogDB.decorator';
import { getTsTypesMapping, tsTypes, TsTypes } from './decorators/property/tsTypes.decorator';
import { IMetadataCommonModel } from './interfaces/metadataCommonModel';
import { ProductType } from './enums';
import { ProductType, RecordStatus } from './enums';

export interface IQuantizedMeshBestMetadata {
// Based on 3D Entity fields
productVersion: string | undefined;
productVersion: number | undefined;
creationDate: Date | undefined;
minResolutionMeter: number | undefined;
maxResolutionMeter: number | undefined;
// nominalResolution: number | undefined;
maxAccuracyCE90: number | undefined;
// absoluteAccuracyLEP90: number | undefined;
// absoluteAccuracyLE90: number | undefined;
// accuracySE90: number | undefined;
// relativeAccuracyLEP90: number | undefined;
// relativeAccuracySE90: number | undefined;
// visualAccuracy: number | undefined;
heightRangeFrom: number | undefined;
heightRangeTo: number | undefined;
// srsOrigin: string | undefined;
productionSystem: string | undefined;
productionSystemVer: string | undefined;
productionMethod: string | undefined;
// minFlightAlt: number | undefined;
// maxFlightAlt: number | undefined;
geographicArea: string | undefined;
productBoundingBox: string | undefined;
productSource: string | undefined;
productStatus: RecordStatus | undefined;

// Description field must include info:
// undulationModel: UndulationModel | undefined;
Expand All @@ -51,6 +50,7 @@ export interface IPropPYCSWMapping extends IPYCSWMapping {

export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IMetadataCommonModel {
//#region QUANTIZED_MESH_BEST SPECIFIC FIELDS

//#region QUANTIZED_MESH_BEST: type
@pycsw({
profile: 'mc_quantized_mesh_best',
Expand Down Expand Up @@ -99,7 +99,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
isAutoGenerated: true,
})
//#endregion
public productId: string | undefined = 'UNKNOWN';
public productId: string | undefined = undefined;

//#region QUANTIZED_MESH_BEST: productName
@pycsw({
Expand All @@ -112,7 +112,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
column: {
name: 'product_name',
type: 'text',
nullable: true,
nullable: false,
},
})
@tsTypes({
Expand Down Expand Up @@ -143,12 +143,12 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
@catalogDB({
column: {
name: 'product_version',
type: 'text',
type: 'int',
nullable: false,
},
})
@tsTypes({
mappingType: TsTypes.STRING,
mappingType: TsTypes.NUMBER,
})
@graphql({
nullable: true,
Expand All @@ -158,7 +158,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
isAutoGenerated: true,
})
//#endregion
public productVersion: string | undefined = undefined;
public productVersion: number | undefined = undefined;

//#region QUANTIZED_MESH_BEST: productType
@pycsw({
Expand All @@ -171,7 +171,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
column: {
name: 'product_type',
type: 'text',
nullable: true,
nullable: false,
},
})
@tsTypes({
Expand Down Expand Up @@ -248,15 +248,17 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM

//#region COMMON: updateDate
@pycsw({
profile: 'mc_raster',
profile: 'mc_quantized_mesh_best',
xmlElement: 'mc:updateDateUTC',
queryableField: 'mc:updateDateUTC',
pycswField: 'pycsw:UpdateDate',
pycswField: 'pycsw:updateDate',
})
@catalogDB({
columnType: ORMColumnType.UPDATE_DATE_COLUMN,
column: {
name: 'update_date',
type: 'timestamp without time zone',
nullable: true,
},
})
@tsTypes({
Expand Down Expand Up @@ -366,6 +368,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
})
@fieldConfig({
category: FieldCategory.MAIN,
isManuallyEditable: true,
infoMsgCode: ['info-field-tooltip.meter.tooltip', 'info-field-tooltip.minResolutionMeter.min', 'info-field-tooltip.minResolutionMeter.max'],
validation: [
{
Expand Down Expand Up @@ -405,6 +408,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
})
@fieldConfig({
category: FieldCategory.MAIN,
isManuallyEditable: true,
infoMsgCode: ['info-field-tooltip.meter.tooltip', 'info-field-tooltip.maxResolutionMeter.min', 'info-field-tooltip.maxResolutionMeter.max'],
validation: [
{
Expand Down Expand Up @@ -444,6 +448,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
})
@fieldConfig({
category: FieldCategory.GEO_INFO,
isManuallyEditable: true,
infoMsgCode: ['info-general-tooltip.required', 'info-field-tooltip.maxAccuracyCE90.min', 'info-field-tooltip.maxAccuracyCE90.max'],
validation: [
{
Expand Down Expand Up @@ -476,6 +481,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
column: {
name: 'sensor_type',
type: 'text',
nullable: false,
},
field: {
overrideType: TsTypes.STRING,
Expand All @@ -489,6 +495,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
})
@fieldConfig({
category: FieldCategory.GENERAL,
isManuallyEditable: true,
infoMsgCode: ['info-field-tooltip.sensors.tooltip', 'info-general-tooltip.required'],
validation: [
{
Expand Down Expand Up @@ -555,6 +562,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
})
@fieldConfig({
category: FieldCategory.GEO_INFO,
isManuallyEditable: true,
infoMsgCode: ['info-field-tooltip.meter.tooltip'],
})
//#endregion
Expand Down Expand Up @@ -582,6 +590,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
})
@fieldConfig({
category: FieldCategory.GEO_INFO,
isManuallyEditable: true,
infoMsgCode: ['info-field-tooltip.meter.tooltip'],
})
//#endregion
Expand Down Expand Up @@ -668,7 +677,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
column: {
name: 'region',
type: 'text',
nullable: true,
nullable: false,
},
field: {
overrideType: TsTypes.STRING,
Expand All @@ -691,7 +700,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
],
})
//#endregion
public region: string[] | undefined = ['UNKNOWN'];
public region: string[] | undefined = undefined;

//#region QUANTIZED_MESH_BEST: classification
@pycsw({
Expand All @@ -715,7 +724,6 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
})
@fieldConfig({
category: FieldCategory.GENERAL,
isManuallyEditable: true,
infoMsgCode: ['info-general-tooltip.required'],
validation: [
{
Expand Down Expand Up @@ -805,7 +813,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
name: 'producer_name',
type: 'text',
default: 'IDFMU',
nullable: true,
nullable: false,
},
})
@tsTypes({
Expand All @@ -816,7 +824,7 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
})
@fieldConfig({
category: FieldCategory.GENERAL,
isAutoGenerated: true,
isManuallyEditable: true,
infoMsgCode: ['info-general-tooltip.required'],
validation: [
{
Expand All @@ -828,18 +836,17 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
//#endregion
public producerName: string | undefined = undefined;

//#region QUANTIZED_MESH_BEST: productionMethod
//#region QUANTIZED_MESH_BEST: geographicArea
@pycsw({
profile: 'mc_quantized_mesh_best',
xmlElement: 'mc:productionMethod',
queryableField: 'mc:productionMethod',
pycswField: 'pycsw:productionMethod',
xmlElement: 'mc:geographicArea',
queryableField: 'mc:geographicArea',
pycswField: 'pycsw:geographicArea',
})
@catalogDB({
column: {
name: 'production_method',
name: 'geographic_area',
type: 'text',
default: 'photogrammetric',
nullable: true,
},
})
Expand All @@ -854,20 +861,20 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
isManuallyEditable: true,
})
//#endregion
public productionMethod: string | undefined = undefined;
public geographicArea: string | undefined = undefined;

//#region QUANTIZED_MESH_BEST: geographicArea
//#region QUANTIZED_MESH_BEST: productBoundingBox
@pycsw({
profile: 'mc_quantized_mesh_best',
xmlElement: 'mc:geographicArea',
queryableField: 'mc:geographicArea',
pycswField: 'pycsw:geographicArea',
xmlElement: 'mc:productBBox',
queryableField: 'mc:productBBox',
pycswField: 'pycsw:productBBox',
})
@catalogDB({
column: {
name: 'geographic_area',
name: 'product_bbox',
type: 'text',
nullable: true,
nullable: false,
},
})
@tsTypes({
Expand All @@ -877,22 +884,23 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
nullable: true,
})
@fieldConfig({
category: FieldCategory.GENERAL,
isManuallyEditable: true,
category: FieldCategory.GEO_INFO,
isAutoGenerated: true,
})
//#endregion
public geographicArea: string | undefined = undefined;
public productBoundingBox: string | undefined = undefined;
//#endregion

//#region QUANTIZED_MESH_BEST: productBoundingBox
//#region QUANTIZED_MESH_BEST: productSource
@pycsw({
profile: 'mc_quantized_mesh_best',
xmlElement: 'mc:productBBox',
queryableField: 'mc:productBBox',
pycswField: 'pycsw:productBBox',
xmlElement: 'mc:productSource',
queryableField: 'mc:productSource',
pycswField: 'pycsw:productSource',
})
@catalogDB({
column: {
name: 'product_bbox',
name: 'product_source',
type: 'text',
nullable: false,
},
Expand All @@ -904,11 +912,38 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
nullable: true,
})
@fieldConfig({
category: FieldCategory.GEO_INFO,
category: FieldCategory.GENERAL,
isAutoGenerated: true,
})
//#endregion
public productBoundingBox: string | undefined = undefined;
public productSource: string | undefined = undefined;
//#endregion

//#region QUANTIZED_MESH_BEST: productStatus
@pycsw({
profile: 'mc_quantized_mesh_best',
xmlElement: 'mc:productStatus',
queryableField: 'mc:productStatus',
pycswField: 'pycsw:productStatus',
})
@catalogDB({
column: {
name: 'product_status',
type: 'text',
default: RecordStatus.UNPUBLISHED,
nullable: false,
},
})
@tsTypes({
mappingType: TsTypes.RECORD_STATUS,
})
@graphql()
@fieldConfig({
category: FieldCategory.GENERAL,
isManuallyEditable: true,
})
//#endregion
public productStatus: RecordStatus | undefined = RecordStatus.UNPUBLISHED;
//#endregion

public static getPyCSWMapping(prop: string): IPYCSWMapping | undefined {
Expand Down

0 comments on commit d72ab98

Please sign in to comment.