Skip to content

Commit

Permalink
feat: polygon parts entity (#183)
Browse files Browse the repository at this point in the history
* feat: poygon parts entity

* chore: lint

* fix: expose polygon parts

* fix: shape file mappings added

* fix: shapefile mappings

* fix: unit test
  • Loading branch information
alebinson authored Apr 21, 2024
1 parent 6d4cb97 commit 6164660
Show file tree
Hide file tree
Showing 17 changed files with 741 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export interface IFieldConfigInfo {
infoMsgCode?: string[];
validation?: IValidationConfigInfo[];
default?: string | number;
shapeFileMapping?: string;
}

export interface IPropFieldConfigInfo extends IFieldConfigInfo {
Expand Down
1 change: 1 addition & 0 deletions src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export * from './discreteIngestion/index';
export * from './pycsw/index';
export * from './rasterCatalog/index';
export * from './3dCatalog/index';
export * from './polygonParts/index';
7 changes: 2 additions & 5 deletions src/models/layerMetadata/bestMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {
import { RecordType } from '../pycsw/coreEnums';
import { IMetadataCommonModel } from './interfaces/metadataCommonModel';
import { getPyCSWMapping, IPYCSWMapping, pycsw } from './decorators/property/csw.decorator';
import { getInputDataMapping, IDataMapping, DataFileType, inputDataMapping } from './decorators/property/shp.decorator';
import { getInputDataMapping, IDataMapping, DataFileType, inputDataMapping, IPropSHPMapping } 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 { getTsTypesMapping, tsTypes, TsTypes } from './decorators/property/tsTypes.decorator';
import { ProductType } from './enums';
import { DiscreteOrder } from './discreteOrder';

Expand All @@ -24,9 +24,6 @@ export interface IBestMetadata {
scale: number | undefined;
discretes: DiscreteOrder[] | undefined;
}
export interface IPropSHPMapping extends IDataMapping, ITsTypesMapping {
prop: string;
}

export interface IPropPYCSWMapping extends IPYCSWMapping {
prop: string;
Expand Down
5 changes: 5 additions & 0 deletions src/models/layerMetadata/decorators/property/shp.decorator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'reflect-metadata';
import { ITsTypesMapping } from './tsTypes.decorator';

const inputDataMappingMetadataKey = Symbol('inputDataMapping');

Expand All @@ -15,6 +16,10 @@ export enum DataFileType {
TFW = 'TFW',
}

export interface IPropSHPMapping extends IDataMapping, ITsTypesMapping {
prop: string;
}

export function inputDataMapping(dataMapping: IDataMapping): PropertyDecorator {
return Reflect.metadata(inputDataMappingMetadataKey, dataMapping);
}
Expand Down
7 changes: 2 additions & 5 deletions src/models/layerMetadata/layerMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import {
import { RecordType } from '../pycsw/coreEnums';
import { IMetadataCommonModel } from './interfaces/metadataCommonModel';
import { getPyCSWMapping, IPYCSWMapping, pycsw } from './decorators/property/csw.decorator';
import { getInputDataMapping, IDataMapping, DataFileType, inputDataMapping } from './decorators/property/shp.decorator';
import { getInputDataMapping, IDataMapping, DataFileType, inputDataMapping, IPropSHPMapping } from './decorators/property/shp.decorator';
import { getCatalogDBMapping, ICatalogDBMapping, catalogDB, ORMColumnType } from './decorators/property/catalogDB.decorator';
import { getTsTypesMapping, ITsTypesMapping, tsTypes, TsTypes } from './decorators/property/tsTypes.decorator';
import { getTsTypesMapping, tsTypes, TsTypes } from './decorators/property/tsTypes.decorator';
import { ProductType, Transparency, TileOutputFormat } from './enums';

export interface ILayerMetadata {
Expand All @@ -29,9 +29,6 @@ export interface ILayerMetadata {
region: string[] | undefined;
sensors: string[] | undefined;
}
export interface IPropSHPMapping extends IDataMapping, ITsTypesMapping {
prop: string;
}

export interface IPropPYCSWMapping extends IPYCSWMapping {
prop: string;
Expand Down
5 changes: 5 additions & 0 deletions src/models/layerMetadata/pycsw3DCatalogRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getCatalogDBEntityMapping, catalogDBEntity, ICatalogDBEntityMapping } f
import { getPyCSWMapping, pycsw } from './decorators/property/csw.decorator';
import { Layer3DMetadata, IPropPYCSWMapping } from './layer3DMetadata';
import { Link } from './link';
import { IPropSHPMapping } from './decorators/property/shp.decorator';

@catalogDBEntity({
table: 'records',
Expand Down Expand Up @@ -286,6 +287,10 @@ export class Pycsw3DCatalogRecord extends Layer3DMetadata implements IPycswCoreM
return ret;
}

public static getShpMappings(includeCustomLogic = false): IPropSHPMapping[] {
return [];
}

public getORMCatalogMappings(): IPropCatalogDBMapping[] {
const ret = [];

Expand Down
5 changes: 5 additions & 0 deletions src/models/layerMetadata/pycswBestCatalogRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getTsTypesMapping, TsTypes, tsTypes } from './decorators/property/tsTyp
import { IPropPYCSWMapping, BestMetadata } from './bestMetadata';
import { getCatalogDBEntityMapping, catalogDBEntity, ICatalogDBEntityMapping } from './decorators/class/catalogDBEntity.decorator';
import { getPyCSWMapping, pycsw } from './decorators/property/csw.decorator';
import { IPropSHPMapping } from './decorators/property/shp.decorator';

@catalogDBEntity({
table: 'records',
Expand Down Expand Up @@ -272,6 +273,10 @@ export class PycswBestCatalogRecord extends BestMetadata implements IPycswCoreMo
return ret as IPropFieldConfigInfo[];
}

public static getShpMappings(includeCustomLogic = false): IPropSHPMapping[] {
return [];
}

public getORMCatalogMappings(): IPropCatalogDBMapping[] {
const ret = [];

Expand Down
5 changes: 5 additions & 0 deletions src/models/layerMetadata/pycswDEMCatalogRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getCatalogDBEntityMapping, catalogDBEntity, ICatalogDBEntityMapping } f
import { getPyCSWMapping, pycsw } from './decorators/property/csw.decorator';
import { LayerDemMetadata, IPropPYCSWMapping } from './layerDEMMetadata';
import { Link } from './link';
import { IPropSHPMapping } from './decorators/property/shp.decorator';

@catalogDBEntity({
table: 'records',
Expand Down Expand Up @@ -283,6 +284,10 @@ export class PycswDemCatalogRecord extends LayerDemMetadata implements IPycswCor
return ret;
}

public static getShpMappings(includeCustomLogic = false): IPropSHPMapping[] {
return [];
}

public getORMCatalogMappings(): IPropCatalogDBMapping[] {
const ret = [];

Expand Down
5 changes: 5 additions & 0 deletions src/models/layerMetadata/pycswLayerCatalogRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getTsTypesMapping, TsTypes, tsTypes } from './decorators/property/tsTyp
import { IPropPYCSWMapping, LayerMetadata } from './layerMetadata';
import { getCatalogDBEntityMapping, catalogDBEntity, ICatalogDBEntityMapping } from './decorators/class/catalogDBEntity.decorator';
import { getPyCSWMapping, pycsw } from './decorators/property/csw.decorator';
import { IPropSHPMapping } from './decorators/property/shp.decorator';

@catalogDBEntity({
table: 'records',
Expand Down Expand Up @@ -245,6 +246,10 @@ export class PycswLayerCatalogRecord extends LayerMetadata implements IPycswCore
return ret as IPropFieldConfigInfo[];
}

public static getShpMappings(includeCustomLogic = false): IPropSHPMapping[] {
return [];
}

public getORMCatalogMappings(): IPropCatalogDBMapping[] {
const ret = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getCatalogDBEntityMapping, catalogDBEntity, ICatalogDBEntityMapping } f
import { getPyCSWMapping, pycsw } from './decorators/property/csw.decorator';
import { QuantizedMeshBestMetadata, IPropPYCSWMapping } from './quantizedMeshBestMetadata';
import { Link } from './link';
import { IPropSHPMapping } from './decorators/property/shp.decorator';

@catalogDBEntity({
table: 'records',
Expand Down Expand Up @@ -276,6 +277,10 @@ export class PycswQuantizedMeshBestCatalogRecord extends QuantizedMeshBestMetada
return ret;
}

public static getShpMappings(includeCustomLogic = false): IPropSHPMapping[] {
return [];
}

public getORMCatalogMappings(): IPropCatalogDBMapping[] {
const ret = [];

Expand Down
5 changes: 5 additions & 0 deletions src/models/layerMetadata/pycswVectorBestCatalogRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getTsTypesMapping, TsTypes, tsTypes } from './decorators/property/tsTyp
import { IPropPYCSWMapping, VectorBestMetadata } from './vectorBestMetadata';
import { getCatalogDBEntityMapping, catalogDBEntity, ICatalogDBEntityMapping } from './decorators/class/catalogDBEntity.decorator';
import { getPyCSWMapping, pycsw } from './decorators/property/csw.decorator';
import { IPropSHPMapping } from './decorators/property/shp.decorator';

@catalogDBEntity({
table: 'records',
Expand Down Expand Up @@ -272,6 +273,10 @@ export class PycswVectorBestCatalogRecord extends VectorBestMetadata implements
return ret as IPropFieldConfigInfo[];
}

public static getShpMappings(includeCustomLogic = false): IPropSHPMapping[] {
return [];
}

public getORMCatalogMappings(): IPropCatalogDBMapping[] {
const ret = [];

Expand Down
5 changes: 5 additions & 0 deletions src/models/layerMetadata/quantizedMeshBestMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { catalogDB, getCatalogDBMapping, ICatalogDBMapping, ORMColumnType } from
import { getTsTypesMapping, tsTypes, TsTypes } from './decorators/property/tsTypes.decorator';
import { IMetadataCommonModel } from './interfaces/metadataCommonModel';
import { ProductType, RecordStatus } from './enums';
import { IPropSHPMapping } from './decorators/property/shp.decorator';

export interface IQuantizedMeshBestMetadata {
// Based on 3D Entity fields
Expand Down Expand Up @@ -994,6 +995,10 @@ export class QuantizedMeshBestMetadata implements IQuantizedMeshBestMetadata, IM
return ret;
}

public static getShpMappings(includeCustomLogic = false): IPropSHPMapping[] {
return [];
}

public static getFieldConfigs(): IPropFieldConfigInfo[] {
const ret = [];
const layer = new QuantizedMeshBestMetadata();
Expand Down
5 changes: 5 additions & 0 deletions src/models/layerMetadata/vectorBestMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { getPyCSWMapping, IPYCSWMapping, pycsw } from './decorators/property/csw
import { getCatalogDBMapping, ICatalogDBMapping, catalogDB } from './decorators/property/catalogDB.decorator';
import { getTsTypesMapping, tsTypes, TsTypes } from './decorators/property/tsTypes.decorator';
import { ProductType } from './enums';
import { IPropSHPMapping } from './decorators/property/shp.decorator';

export interface IVectorBestMetadata {
productVersion: string | undefined;
Expand Down Expand Up @@ -575,4 +576,8 @@ export class VectorBestMetadata implements IVectorBestMetadata {
}
return ret;
}

public static getShpMappings(includeCustomLogic = false): IPropSHPMapping[] {
return [];
}
}
1 change: 1 addition & 0 deletions src/models/polygonParts/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './polygonPartRecord';
Loading

0 comments on commit 6164660

Please sign in to comment.