From dccfa5d10d30ec41df03c40d588468c7f6fdab6f Mon Sep 17 00:00:00 2001 From: Kamil Gajowy Date: Fri, 28 May 2021 15:58:10 +0200 Subject: [PATCH 1/4] feat(geoprocessing): cost-surface: convert shape into geo --- .../surface-cost/adapters/shapefile-converter.ts | 13 +++++++++++++ .../src/modules/surface-cost/surface-cost.module.ts | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 api/apps/geoprocessing/src/modules/surface-cost/adapters/shapefile-converter.ts diff --git a/api/apps/geoprocessing/src/modules/surface-cost/adapters/shapefile-converter.ts b/api/apps/geoprocessing/src/modules/surface-cost/adapters/shapefile-converter.ts new file mode 100644 index 0000000000..073c2e5724 --- /dev/null +++ b/api/apps/geoprocessing/src/modules/surface-cost/adapters/shapefile-converter.ts @@ -0,0 +1,13 @@ +import { GeoJSON } from 'geojson'; +import { ShapefileService } from '../../shapefiles/shapefiles.service'; + +import { CostSurfaceJobInput } from '../cost-surface-job-input'; +import { ShapefileConverterPort } from '../ports/shapefile-converter/shapefile-converter.port'; + +export class ShapefileConverter implements ShapefileConverterPort { + constructor(private readonly converter: ShapefileService) {} + + async convert(file: CostSurfaceJobInput['shapefile']): Promise { + return (await this.converter.getGeoJson(file)).data; + } +} diff --git a/api/apps/geoprocessing/src/modules/surface-cost/surface-cost.module.ts b/api/apps/geoprocessing/src/modules/surface-cost/surface-cost.module.ts index db022df450..a179c26c8b 100644 --- a/api/apps/geoprocessing/src/modules/surface-cost/surface-cost.module.ts +++ b/api/apps/geoprocessing/src/modules/surface-cost/surface-cost.module.ts @@ -1,6 +1,7 @@ import { Module } from '@nestjs/common'; import { TypeOrmModule } from '@nestjs/typeorm'; import { WorkerModule, WorkerProcessor } from '../worker'; +import { ShapefilesModule } from '../shapefiles/shapefiles.module'; import { SurfaceCostProcessor } from './application/surface-cost-processor'; import { SurfaceCostWorker } from './application/surface-cost-worker'; @@ -11,12 +12,14 @@ import { ArePuidsAllowedPort } from './ports/pu-validator/are-puuids-allowed.por import { ShapefileConverterPort } from './ports/shapefile-converter/shapefile-converter.port'; import { TypeormCostSurface } from './adapters/typeorm-cost-surface'; +import { ShapefileConverter } from './adapters/shapefile-converter'; import { ScenariosPuCostDataGeo } from '../scenarios/scenarios-pu-cost-data.geo.entity'; import { ScenariosPlanningUnitGeoEntity } from '../scenarios/scenarios-planning-unit.geo.entity'; @Module({ imports: [ WorkerModule, + ShapefilesModule, TypeOrmModule.forFeature([ ScenariosPuCostDataGeo, ScenariosPlanningUnitGeoEntity, // not used but has to imported somewhere @@ -42,7 +45,7 @@ import { ScenariosPlanningUnitGeoEntity } from '../scenarios/scenarios-planning- }, { provide: ShapefileConverterPort, - useValue: {}, + useClass: ShapefileConverter, }, ], }) From 3904d4f237a88a6335a5c6aee0aa225b530eb1eb Mon Sep 17 00:00:00 2001 From: Kamil Gajowy Date: Fri, 28 May 2021 17:54:31 +0200 Subject: [PATCH 2/4] feat(geoprocessing): cost-surface: extract pu data from geojson --- .../api/src/decorators/shapefile.decorator.ts | 2 +- .../adapters/are-puids-allowed-adapter.ts | 2 +- api/apps/api/test/jest-e2e.json | 4 +- .../adapters/extract-pu-cost.spec.ts | 62 +++++++++++++++++++ .../surface-cost/adapters/extract-pu-cost.ts | 46 ++++++++++++++ .../application/__mocks__/geojson.ts | 7 ++- .../surface-cost/surface-cost.module.ts | 3 +- api/apps/geoprocessing/test/jest-e2e.json | 4 +- api/libs/utils/src/index.ts | 1 + .../utils => libs/utils/src}/is-defined.ts | 0 api/libs/utils/tsconfig.lib.json | 9 +++ api/nest-cli.json | 11 +++- api/package.json | 5 +- api/tsconfig.json | 8 ++- 14 files changed, 154 insertions(+), 10 deletions(-) create mode 100644 api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.spec.ts create mode 100644 api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.ts create mode 100644 api/libs/utils/src/index.ts rename api/{apps/api/src/utils => libs/utils/src}/is-defined.ts (100%) create mode 100644 api/libs/utils/tsconfig.lib.json diff --git a/api/apps/api/src/decorators/shapefile.decorator.ts b/api/apps/api/src/decorators/shapefile.decorator.ts index 0f465f2fab..c650fe9cb7 100644 --- a/api/apps/api/src/decorators/shapefile.decorator.ts +++ b/api/apps/api/src/decorators/shapefile.decorator.ts @@ -1,3 +1,4 @@ +import { isDefined } from '@marxan/utils'; import { applyDecorators } from '@nestjs/common'; import { ApiBody, @@ -7,7 +8,6 @@ import { } from '@nestjs/swagger'; import { ShapefileGeoJSONResponseDTO } from '@marxan-api/modules/scenarios/dto/shapefile.geojson.response.dto'; -import { isDefined } from '../utils/is-defined'; export function ApiConsumesShapefile(withGeoJsonResponse = true) { return applyDecorators( diff --git a/api/apps/api/src/modules/analysis/providers/shared/adapters/are-puids-allowed-adapter.ts b/api/apps/api/src/modules/analysis/providers/shared/adapters/are-puids-allowed-adapter.ts index ccf948f1ff..0722851eec 100644 --- a/api/apps/api/src/modules/analysis/providers/shared/adapters/are-puids-allowed-adapter.ts +++ b/api/apps/api/src/modules/analysis/providers/shared/adapters/are-puids-allowed-adapter.ts @@ -1,9 +1,9 @@ import { Injectable } from '@nestjs/common'; +import { isDefined } from '@marxan/utils'; import { differenceWith } from 'lodash'; import { ArePuidsAllowedPort } from '../are-puids-allowed.port'; import { ScenariosPlanningUnitService } from '../../../../scenarios-planning-unit/scenarios-planning-unit.service'; -import { isDefined } from '../../../../../utils/is-defined'; @Injectable() export class ArePuidsAllowedAdapter diff --git a/api/apps/api/test/jest-e2e.json b/api/apps/api/test/jest-e2e.json index 40446b12dc..e24573d6f7 100644 --- a/api/apps/api/test/jest-e2e.json +++ b/api/apps/api/test/jest-e2e.json @@ -8,6 +8,8 @@ "^.+\\.(t|j)s$": "ts-jest" }, "moduleNameMapper": { - "@marxan-api/(.*)": "/../src/$1" + "@marxan-api/(.*)": "/../src/$1", + "^@marxan/utils": ["/../../../libs/utils/src"], + "^@marxan/utils/(.*)$": ["/../../..//libs/utils/src/$1"] } } diff --git a/api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.spec.ts b/api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.spec.ts new file mode 100644 index 0000000000..5b30b38622 --- /dev/null +++ b/api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.spec.ts @@ -0,0 +1,62 @@ +import { Test } from '@nestjs/testing'; +import { PromiseType } from 'utility-types'; +import { + getGeoJson, + getGeoJsonWithMissingCost, + getGeometryMultiPolygon, +} from '../application/__mocks__/geojson'; +import { ExtractPuCost } from './extract-pu-cost'; + +let sut: ExtractPuCost; +let fixtures: PromiseType>; + +beforeEach(async () => { + fixtures = await getFixtures(); + sut = fixtures.getService(); +}); + +describe(`when features miss cost`, () => { + it(`throws exception`, () => { + expect(() => sut.extract(fixtures.geoFeaturesWithoutCost())).toThrow( + /missing cost/, + ); + }); +}); + +describe(`when given GeoJson isn't a FeatureCollection`, () => { + it(`throws exception`, () => { + expect(() => sut.extract(fixtures.simpleGeometry())).toThrow( + /is supported/, + ); + }); +}); + +describe(`when given GeoJson has pu costs`, () => { + it(`throws exception`, () => { + expect(sut.extract(fixtures.geoFeaturesWithData())).toMatchInlineSnapshot(` + Array [ + Object { + "cost": 200, + "planningUnitId": "uuid-1", + }, + Object { + "cost": 100, + "planningUnitId": "uuid-2", + }, + ] + `); + }); +}); + +const getFixtures = async () => { + const sandbox = await Test.createTestingModule({ + providers: [ExtractPuCost], + }).compile(); + + return { + getService: () => sandbox.get(ExtractPuCost), + geoFeaturesWithoutCost: () => getGeoJsonWithMissingCost(), + geoFeaturesWithData: () => getGeoJson(), + simpleGeometry: () => getGeometryMultiPolygon(), + }; +}; diff --git a/api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.ts b/api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.ts new file mode 100644 index 0000000000..dd21e9560d --- /dev/null +++ b/api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.ts @@ -0,0 +1,46 @@ +import { isDefined } from '@marxan/utils'; +import { FeatureCollection, GeoJSON, Geometry } from 'geojson'; +import { PlanningUnitCost } from '../ports/planning-unit-cost'; +import { PuExtractorPort } from '../ports/pu-extractor/pu-extractor.port'; + +type Properties = { + cost: number; + planningUnitId: string; +}; +type MaybeProperties = Partial | undefined | null; + +export class ExtractPuCost implements PuExtractorPort { + extract(geo: GeoJSON): PlanningUnitCost[] { + if (!this.isFeatureCollection(geo)) { + throw new Error('Only FeatureCollection is supported.'); + } + const input: FeatureCollection = geo; + + const puCosts = input.features + .map((feature) => feature.properties) + .filter(this.hasCostValues); + + if (puCosts.length !== input.features.length) { + throw new Error( + `Some of the Features are missing cost and/or planning unit id.`, + ); + } + + return puCosts.map((puCost) => ({ + planningUnitId: puCost.planningUnitId, + cost: puCost.cost, + })); + } + + private isFeatureCollection(geo: GeoJSON): geo is FeatureCollection { + return geo.type === 'FeatureCollection'; + } + + private hasCostValues(properties: MaybeProperties): properties is Properties { + return ( + isDefined(properties) && + isDefined(properties.cost) && + isDefined(properties.planningUnitId) + ); + } +} diff --git a/api/apps/geoprocessing/src/modules/surface-cost/application/__mocks__/geojson.ts b/api/apps/geoprocessing/src/modules/surface-cost/application/__mocks__/geojson.ts index cfc0f95c6f..0541ab97f4 100644 --- a/api/apps/geoprocessing/src/modules/surface-cost/application/__mocks__/geojson.ts +++ b/api/apps/geoprocessing/src/modules/surface-cost/application/__mocks__/geojson.ts @@ -1,4 +1,4 @@ -import { Feature, FeatureCollection, MultiPolygon, Polygon } from 'geojson'; +import { FeatureCollection, MultiPolygon, Polygon } from 'geojson'; import { PlanningUnitCost } from '../../ports/planning-unit-cost'; export const getGeoJson = (): FeatureCollection< @@ -56,3 +56,8 @@ export const getGeoJsonWithMissingCost = (): FeatureCollection< }, ], }); + +export const getGeometryMultiPolygon = (): MultiPolygon => ({ + type: 'MultiPolygon', + coordinates: [], +}); diff --git a/api/apps/geoprocessing/src/modules/surface-cost/surface-cost.module.ts b/api/apps/geoprocessing/src/modules/surface-cost/surface-cost.module.ts index a179c26c8b..bc2d86d4c9 100644 --- a/api/apps/geoprocessing/src/modules/surface-cost/surface-cost.module.ts +++ b/api/apps/geoprocessing/src/modules/surface-cost/surface-cost.module.ts @@ -15,6 +15,7 @@ import { TypeormCostSurface } from './adapters/typeorm-cost-surface'; import { ShapefileConverter } from './adapters/shapefile-converter'; import { ScenariosPuCostDataGeo } from '../scenarios/scenarios-pu-cost-data.geo.entity'; import { ScenariosPlanningUnitGeoEntity } from '../scenarios/scenarios-planning-unit.geo.entity'; +import { ExtractPuCost } from './adapters/extract-pu-cost'; @Module({ imports: [ @@ -41,7 +42,7 @@ import { ScenariosPlanningUnitGeoEntity } from '../scenarios/scenarios-planning- }, { provide: PuExtractorPort, - useValue: {}, + useClass: ExtractPuCost, }, { provide: ShapefileConverterPort, diff --git a/api/apps/geoprocessing/test/jest-e2e.json b/api/apps/geoprocessing/test/jest-e2e.json index 0566b5f5ad..848f80d4b8 100644 --- a/api/apps/geoprocessing/test/jest-e2e.json +++ b/api/apps/geoprocessing/test/jest-e2e.json @@ -9,6 +9,8 @@ "^.+\\.(t|j)s$": "ts-jest" }, "moduleNameMapper": { - "@marxan-geoprocessing/(.*)": "/src/$1" + "@marxan-geoprocessing/(.*)": "/src/$1", + "^@marxan/utils": ["/../../libs/utils/src"], + "^@marxan/utils/(.*)$": ["/../..//libs/utils/src/$1"] } } diff --git a/api/libs/utils/src/index.ts b/api/libs/utils/src/index.ts new file mode 100644 index 0000000000..dff2ab03cc --- /dev/null +++ b/api/libs/utils/src/index.ts @@ -0,0 +1 @@ +export { isDefined } from './is-defined'; diff --git a/api/apps/api/src/utils/is-defined.ts b/api/libs/utils/src/is-defined.ts similarity index 100% rename from api/apps/api/src/utils/is-defined.ts rename to api/libs/utils/src/is-defined.ts diff --git a/api/libs/utils/tsconfig.lib.json b/api/libs/utils/tsconfig.lib.json new file mode 100644 index 0000000000..8c4de11c9b --- /dev/null +++ b/api/libs/utils/tsconfig.lib.json @@ -0,0 +1,9 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "declaration": true, + "outDir": "../../dist/libs/utils" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "test", "**/*spec.ts"] +} diff --git a/api/nest-cli.json b/api/nest-cli.json index 840cf810bf..8fe8df7b79 100644 --- a/api/nest-cli.json +++ b/api/nest-cli.json @@ -25,6 +25,15 @@ "compilerOptions": { "tsConfigPath": "apps/geoprocessing/tsconfig.app.json" } + }, + "utils": { + "type": "library", + "root": "libs/utils", + "entryFile": "index", + "sourceRoot": "libs/utils/src", + "compilerOptions": { + "tsConfigPath": "libs/utils/tsconfig.lib.json" + } } } -} +} \ No newline at end of file diff --git a/api/package.json b/api/package.json index 0914171886..ef895292df 100644 --- a/api/package.json +++ b/api/package.json @@ -79,7 +79,6 @@ "unzipper": "^0.10.11", "uuid": "8.3.2", "swagger-ui-express": "^4.1.6" - }, "devDependencies": { "@nestjs/cli": "^7.5.1", @@ -145,7 +144,9 @@ ], "moduleNameMapper": { "@marxan-api/(.*)": "/apps/api/src/$1", - "@marxan-geoprocessing/(.*)": "/apps/geoprocessing/src/$1" + "@marxan-geoprocessing/(.*)": "/apps/geoprocessing/src/$1", + "@marxan/utils/(.*)": "/libs/utils/src/$1", + "@marxan/utils": "/libs/utils/src" } } } diff --git a/api/tsconfig.json b/api/tsconfig.json index 929b70b536..5173fc041f 100644 --- a/api/tsconfig.json +++ b/api/tsconfig.json @@ -18,6 +18,12 @@ ], "@marxan-api/*": [ "apps/api/src/*" + ], + "@marxan/utils": [ + "libs/utils/src" + ], + "@marxan/utils/*": [ + "libs/utils/src/*" ] } }, @@ -25,4 +31,4 @@ "node_modules", "dist" ] -} +} \ No newline at end of file From 573622f92a11fdd126982184dc16a4ab3e03ecb3 Mon Sep 17 00:00:00 2001 From: Kamil Gajowy Date: Tue, 1 Jun 2021 07:47:24 +0200 Subject: [PATCH 3/4] refactor: move maybe-type to shared utils --- .../modules/surface-cost/adapters/extract-pu-cost.spec.ts | 4 ++-- .../src/modules/surface-cost/adapters/extract-pu-cost.ts | 8 +++++--- api/libs/utils/src/types/index.ts | 1 + api/libs/utils/src/types/maybe-properties.ts | 1 + 4 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 api/libs/utils/src/types/index.ts create mode 100644 api/libs/utils/src/types/maybe-properties.ts diff --git a/api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.spec.ts b/api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.spec.ts index 5b30b38622..2d0cc835b7 100644 --- a/api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.spec.ts +++ b/api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.spec.ts @@ -26,13 +26,13 @@ describe(`when features miss cost`, () => { describe(`when given GeoJson isn't a FeatureCollection`, () => { it(`throws exception`, () => { expect(() => sut.extract(fixtures.simpleGeometry())).toThrow( - /is supported/, + /Only FeatureCollection is supported/, ); }); }); describe(`when given GeoJson has pu costs`, () => { - it(`throws exception`, () => { + it(`resolves them`, () => { expect(sut.extract(fixtures.geoFeaturesWithData())).toMatchInlineSnapshot(` Array [ Object { diff --git a/api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.ts b/api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.ts index dd21e9560d..0adcf55838 100644 --- a/api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.ts +++ b/api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.ts @@ -1,4 +1,5 @@ import { isDefined } from '@marxan/utils'; +import { MaybeProperties } from '@marxan/utils/types'; import { FeatureCollection, GeoJSON, Geometry } from 'geojson'; import { PlanningUnitCost } from '../ports/planning-unit-cost'; import { PuExtractorPort } from '../ports/pu-extractor/pu-extractor.port'; @@ -7,14 +8,15 @@ type Properties = { cost: number; planningUnitId: string; }; -type MaybeProperties = Partial | undefined | null; + +type MaybeCost = MaybeProperties; export class ExtractPuCost implements PuExtractorPort { extract(geo: GeoJSON): PlanningUnitCost[] { if (!this.isFeatureCollection(geo)) { throw new Error('Only FeatureCollection is supported.'); } - const input: FeatureCollection = geo; + const input: FeatureCollection = geo; const puCosts = input.features .map((feature) => feature.properties) @@ -36,7 +38,7 @@ export class ExtractPuCost implements PuExtractorPort { return geo.type === 'FeatureCollection'; } - private hasCostValues(properties: MaybeProperties): properties is Properties { + private hasCostValues(properties: MaybeCost): properties is Properties { return ( isDefined(properties) && isDefined(properties.cost) && diff --git a/api/libs/utils/src/types/index.ts b/api/libs/utils/src/types/index.ts new file mode 100644 index 0000000000..57cfe27a74 --- /dev/null +++ b/api/libs/utils/src/types/index.ts @@ -0,0 +1 @@ +export { MaybeProperties } from './maybe-properties'; diff --git a/api/libs/utils/src/types/maybe-properties.ts b/api/libs/utils/src/types/maybe-properties.ts new file mode 100644 index 0000000000..c9c2ab203c --- /dev/null +++ b/api/libs/utils/src/types/maybe-properties.ts @@ -0,0 +1 @@ +export type MaybeProperties = Partial | undefined | null; From e9ae13e05dc6fddc7d10fb612c7b378de4b495af Mon Sep 17 00:00:00 2001 From: Kamil Gajowy Date: Tue, 1 Jun 2021 07:48:24 +0200 Subject: [PATCH 4/4] refactor: remove verb from pu-cost-extractor --- ...{extract-pu-cost.spec.ts => pu-cost-extractor.spec.ts} | 8 ++++---- .../adapters/{extract-pu-cost.ts => pu-cost-extractor.ts} | 2 +- .../src/modules/surface-cost/surface-cost.module.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) rename api/apps/geoprocessing/src/modules/surface-cost/adapters/{extract-pu-cost.spec.ts => pu-cost-extractor.spec.ts} (89%) rename api/apps/geoprocessing/src/modules/surface-cost/adapters/{extract-pu-cost.ts => pu-cost-extractor.ts} (95%) diff --git a/api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.spec.ts b/api/apps/geoprocessing/src/modules/surface-cost/adapters/pu-cost-extractor.spec.ts similarity index 89% rename from api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.spec.ts rename to api/apps/geoprocessing/src/modules/surface-cost/adapters/pu-cost-extractor.spec.ts index 2d0cc835b7..39d0d3e0ed 100644 --- a/api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.spec.ts +++ b/api/apps/geoprocessing/src/modules/surface-cost/adapters/pu-cost-extractor.spec.ts @@ -5,9 +5,9 @@ import { getGeoJsonWithMissingCost, getGeometryMultiPolygon, } from '../application/__mocks__/geojson'; -import { ExtractPuCost } from './extract-pu-cost'; +import { PuCostExtractor } from './pu-cost-extractor'; -let sut: ExtractPuCost; +let sut: PuCostExtractor; let fixtures: PromiseType>; beforeEach(async () => { @@ -50,11 +50,11 @@ describe(`when given GeoJson has pu costs`, () => { const getFixtures = async () => { const sandbox = await Test.createTestingModule({ - providers: [ExtractPuCost], + providers: [PuCostExtractor], }).compile(); return { - getService: () => sandbox.get(ExtractPuCost), + getService: () => sandbox.get(PuCostExtractor), geoFeaturesWithoutCost: () => getGeoJsonWithMissingCost(), geoFeaturesWithData: () => getGeoJson(), simpleGeometry: () => getGeometryMultiPolygon(), diff --git a/api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.ts b/api/apps/geoprocessing/src/modules/surface-cost/adapters/pu-cost-extractor.ts similarity index 95% rename from api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.ts rename to api/apps/geoprocessing/src/modules/surface-cost/adapters/pu-cost-extractor.ts index 0adcf55838..9634f32f5e 100644 --- a/api/apps/geoprocessing/src/modules/surface-cost/adapters/extract-pu-cost.ts +++ b/api/apps/geoprocessing/src/modules/surface-cost/adapters/pu-cost-extractor.ts @@ -11,7 +11,7 @@ type Properties = { type MaybeCost = MaybeProperties; -export class ExtractPuCost implements PuExtractorPort { +export class PuCostExtractor implements PuExtractorPort { extract(geo: GeoJSON): PlanningUnitCost[] { if (!this.isFeatureCollection(geo)) { throw new Error('Only FeatureCollection is supported.'); diff --git a/api/apps/geoprocessing/src/modules/surface-cost/surface-cost.module.ts b/api/apps/geoprocessing/src/modules/surface-cost/surface-cost.module.ts index bc2d86d4c9..f4e2208c84 100644 --- a/api/apps/geoprocessing/src/modules/surface-cost/surface-cost.module.ts +++ b/api/apps/geoprocessing/src/modules/surface-cost/surface-cost.module.ts @@ -15,7 +15,7 @@ import { TypeormCostSurface } from './adapters/typeorm-cost-surface'; import { ShapefileConverter } from './adapters/shapefile-converter'; import { ScenariosPuCostDataGeo } from '../scenarios/scenarios-pu-cost-data.geo.entity'; import { ScenariosPlanningUnitGeoEntity } from '../scenarios/scenarios-planning-unit.geo.entity'; -import { ExtractPuCost } from './adapters/extract-pu-cost'; +import { PuCostExtractor } from './adapters/pu-cost-extractor'; @Module({ imports: [ @@ -42,7 +42,7 @@ import { ExtractPuCost } from './adapters/extract-pu-cost'; }, { provide: PuExtractorPort, - useClass: ExtractPuCost, + useClass: PuCostExtractor, }, { provide: ShapefileConverterPort,