diff --git a/python/pyproject.toml b/python/pyproject.toml index ac812922..d62cd9a2 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "reality_apis" -version = "1.2.0" +version = "1.2.2-dev0" authors = [ { name="Bentley Systems" }, ] diff --git a/python/reality_apis/RDAS/job_settings.py b/python/reality_apis/RDAS/job_settings.py index 3a69d549..772b20c0 100644 --- a/python/reality_apis/RDAS/job_settings.py +++ b/python/reality_apis/RDAS/job_settings.py @@ -67,8 +67,12 @@ def to_json(self) -> dict: json_dict["outputs"].append("exportedObjects3DDGN") if self.outputs.exported_objects3D_cesium: json_dict["outputs"].append("exportedObjects3DCesium") + if self.outputs.exported_objects3D_geojson: + json_dict["outputs"].append("exportedObjects3DGeoJSON") if self.outputs.exported_locations3D_SHP: json_dict["outputs"].append("exportedLocations3DSHP") + if self.outputs.exported_locations3D_geojson: + json_dict["outputs"].append("exportedLocations3DGeoJSON") json_dict["options"] = dict() if self.options.use_tie_points: json_dict["options"]["useTiePoints"] = "true" @@ -126,10 +130,18 @@ def from_json(cls, settings_json: dict) -> ReturnValue[O2DJobSettings]: new_job_settings.outputs.exported_objects3D_cesium = output_dict[ "id" ] + elif output_dict["type"] == "exportedObjects3DGeoJSON": + new_job_settings.outputs.exported_objects3D_geojson = output_dict[ + "id" + ] elif output_dict["type"] == "exportedLocations3DSHP": new_job_settings.outputs.exported_locations3D_SHP = output_dict[ "id" ] + elif output_dict["type"] == "exportedLocations3DGeoJSON": + new_job_settings.outputs.exported_locations3D_geojson = output_dict[ + "id" + ] else: raise TypeError( "found non expected output name" + output_dict["type"] @@ -176,7 +188,9 @@ class Outputs: objects3D: Detected 3D objects. exported_objects3D_DGN: DGN file export with 3D objects. exported_objects3D_cesium: Cesium 3D Tiles file export with 3D objects. + exported_objects3D_geojson: GeoJSON file export with 3D objects. exported_locations3D_SHP: ESRI SHP file export with locations of the 3D objects. + exported_locations3D_geojson: GeoJSON file export with locations of the 3D objects. """ def __init__(self) -> None: @@ -184,7 +198,9 @@ def __init__(self) -> None: self.objects3D: str = "" self.exported_objects3D_DGN: str = "" self.exported_objects3D_cesium: str = "" + self.exported_objects3D_geojson: str = "" self.exported_locations3D_SHP: str = "" + self.exported_locations3D_geojson: str = "" class Options: """ @@ -265,12 +281,16 @@ def to_json(self) -> dict: json_dict["outputs"].append("exportedLines3DDGN") if self.outputs.exported_lines3D_cesium: json_dict["outputs"].append("exportedLines3DCesium") + if self.outputs.exported_lines3D_geojson: + json_dict["outputs"].append("exportedLines3DGeoJSON") if self.outputs.polygons3D: json_dict["outputs"].append("polygons3D") if self.outputs.exported_polygons3D_DGN: json_dict["outputs"].append("exportedPolygons3DDGN") if self.outputs.exported_polygons3D_cesium: json_dict["outputs"].append("exportedPolygons3DCesium") + if self.outputs.exported_polygons3D_geojson: + json_dict["outputs"].append("exportedPolygons3DGeoJSON") json_dict["options"] = dict() if self.options.compute_line_width: json_dict["options"]["computeLineWidth"] = "true" @@ -331,6 +351,10 @@ def from_json(cls, settings_json: dict) -> ReturnValue[S2DJobSettings]: new_job_settings.outputs.exported_lines3D_cesium = output_dict[ "id" ] + elif output_dict["type"] == "exportedLines3DGeoJSON": + new_job_settings.outputs.exported_lines3D_geojson = output_dict[ + "id" + ] elif output_dict["type"] == "polygons3D": new_job_settings.outputs.polygons3D = output_dict["id"] elif output_dict["type"] == "exportedPolygons3DDGN": @@ -341,6 +365,10 @@ def from_json(cls, settings_json: dict) -> ReturnValue[S2DJobSettings]: new_job_settings.outputs.exported_polygons3D_cesium = output_dict[ "id" ] + elif output_dict["type"] == "exportedPolygons3DGeoJSON": + new_job_settings.outputs.exported_polygons3D_geojson = output_dict[ + "id" + ] else: raise TypeError( "found non expected output name:" + output_dict["type"] @@ -395,9 +423,11 @@ class Outputs: lines3D: Detected 3D lines. exported_lines3D_DGN: DGN file export with 3D lines. exported_lines3D_cesium: Cesium 3D Tiles file export with 3D lines. + exported_lines3D_geojson: GeoJSON file export with 3D lines. polygons3D: Detected polygons. exported_polygons3D_DGN: DGN file export with polygons. exported_polygons3D_cesium: Cesium 3D Tiles file export with 3D polygons. + exported_polygons3D_geojson GeoJSON file export with 3D polygons. """ @@ -407,9 +437,11 @@ def __init__(self) -> None: self.lines3D: str = "" self.exported_lines3D_DGN: str = "" self.exported_lines3D_cesium: str = "" + self.exported_lines3D_geojson: str = "" self.polygons3D: str = "" self.exported_polygons3D_DGN: str = "" self.exported_polygons3D_cesium: str = "" + self.exported_polygons3D_geojson: str = "" class Options: """ @@ -474,12 +506,16 @@ def to_json(self) -> dict: json_dict["outputs"].append("polygons2D") if self.outputs.exported_polygons2D_SHP: json_dict["outputs"].append("exportedPolygons2DSHP") + if self.outputs.exported_polygons2D_geojson: + json_dict["outputs"].append("exportedPolygons2DGeoJSON") if self.outputs.lines2D: json_dict["outputs"].append("lines2D") if self.outputs.exported_lines2D_DGN: json_dict["outputs"].append("exportedLines2DDGN") if self.outputs.exported_lines2D_SHP: json_dict["outputs"].append("exportedLines2DSHP") + if self.outputs.exported_lines2D_geojson: + json_dict["outputs"].append("exportedLines2DGeoJSON") return json_dict @classmethod @@ -520,12 +556,18 @@ def from_json(cls, settings_json: dict) -> ReturnValue[SOrthoJobSettings]: new_job_settings.outputs.exported_polygons2D_SHP = output_dict[ "id" ] + elif output_dict["type"] == "exportedPolygons2DGeoJSON": + new_job_settings.outputs.exported_polygons2D_geojson = output_dict[ + "id" + ] elif output_dict["type"] == "lines2D": new_job_settings.outputs.lines2D = output_dict["id"] elif output_dict["type"] == "exportedLines2DDGN": new_job_settings.outputs.exported_lines2D_DGN = output_dict["id"] elif output_dict["type"] == "exportedLines2DSHP": new_job_settings.outputs.exported_lines2D_SHP = output_dict["id"] + elif output_dict["type"] == "exportedLines2DGeoJSON": + new_job_settings.outputs.exported_lines2D_geojson = output_dict["id"] else: raise TypeError( "found non expected output type:" + output_dict["type"] @@ -556,9 +598,11 @@ class Outputs: segmented_photos: ContextScene pointing to segmented photos. polygons2D: Detected 2D polygons. exported_polygons2D_SHP: 2D polygons exported to ESRI shapefile. + exported_polygons2D_geojson: 2D polygons exported to GeoJSON. lines2D: Detected 2D lines. exported_lines2D_SHP: 2D lines exported to ESRI shapefile. exported_lines2D_DGN: 2D lines exported to DGN file. + exported_lines2D_geojson: 2D lines exported to GeoJSON file. """ def __init__(self) -> None: @@ -566,9 +610,11 @@ def __init__(self) -> None: self.segmented_photos: str = "" self.polygons2D: str = "" self.exported_polygons2D_SHP: str = "" + self.exported_polygons2D_geojson: str = "" self.lines2D: str = "" self.exported_lines2D_SHP: str = "" self.exported_lines2D_DGN: str = "" + self.exported_lines2D_geojson: str = "" class S3DJobSettings: @@ -641,20 +687,28 @@ def to_json(self) -> dict: json_dict["outputs"].append("exportedObjects3DDGN") if self.outputs.exported_objects3D_cesium: json_dict["outputs"].append("exportedObjects3DCesium") + if self.outputs.exported_objects3D_geojson: + json_dict["outputs"].append("exportedObjects3DGeoJSON") if self.outputs.exported_locations3D_SHP: json_dict["outputs"].append("exportedLocations3DSHP") + if self.outputs.exported_locations3D_geojson: + json_dict["outputs"].append("exportedLocations3DGeoJSON") if self.outputs.lines3D: json_dict["outputs"].append("lines3D") if self.outputs.exported_lines3D_DGN: json_dict["outputs"].append("exportedLines3DDGN") if self.outputs.exported_lines3D_cesium: json_dict["outputs"].append("exportedLines3DCesium") + if self.outputs.exported_lines3D_geojson: + json_dict["outputs"].append("exportedLines3DGeoJSON") if self.outputs.polygons3D: json_dict["outputs"].append("polygons3D") if self.outputs.exported_polygons3D_DGN: json_dict["outputs"].append("exportedPolygons3DDGN") if self.outputs.exported_polygons3D_cesium: json_dict["outputs"].append("exportedPolygons3DCesium") + if self.outputs.exported_polygons3D_geojson: + json_dict["outputs"].append("exportedPolygons3DGeoJSON") json_dict["options"] = dict() if self.options.compute_line_width: json_dict["options"]["computeLineWidth"] = "true" @@ -734,10 +788,18 @@ def from_json(cls, settings_json: dict) -> ReturnValue[S3DJobSettings]: new_job_settings.outputs.exported_objects3D_cesium = output_dict[ "id" ] + elif output_dict["type"] == "exportedObjects3DGeoJSON": + new_job_settings.outputs.exported_objects3D_geojson = output_dict[ + "id" + ] elif output_dict["type"] == "exportedLocations3DSHP": new_job_settings.outputs.exported_locations3D_SHP = output_dict[ "id" ] + elif output_dict["type"] == "exportedLocations3DGeoJSON": + new_job_settings.outputs.exported_locations3D_geojson = output_dict[ + "id" + ] elif output_dict["type"] == "lines3D": new_job_settings.outputs.lines3D = output_dict["id"] elif output_dict["type"] == "exportedLines3DDGN": @@ -748,6 +810,10 @@ def from_json(cls, settings_json: dict) -> ReturnValue[S3DJobSettings]: new_job_settings.outputs.exported_lines3D_cesium = output_dict[ "id" ] + elif output_dict["type"] == "exportedLines3DGeoJSON": + new_job_settings.outputs.exported_lines3D_geojson = output_dict[ + "id" + ] elif output_dict["type"] == "polygons3D": new_job_settings.outputs.polygons3D = output_dict["id"] elif output_dict["type"] == "exportedPolygons3DDGN": @@ -758,6 +824,10 @@ def from_json(cls, settings_json: dict) -> ReturnValue[S3DJobSettings]: new_job_settings.outputs.exported_polygons3D_cesium = output_dict[ "id" ] + elif output_dict["type"] == "exportedPolygons3DGeoJSON": + new_job_settings.outputs.exported_polygons3D_geojson = output_dict[ + "id" + ] else: raise TypeError( "found non expected output type:" + output_dict["type"] @@ -813,13 +883,17 @@ class Outputs: objects3D: 3D objects inferred from 3D segmentation. exported_objects3D_DGN: DGN file export with 3D objects. exported_objects3D_cesium: Cesium 3D Tiles file export with 3D objects + exported_objects3D_geojson: GeoJSON file export with 3D objects exported_locations3D_SHP: ESRI SHP file export with locations of the 3D objects + exported_locations3D_geojson: GeoJSON file export with locations of the 3D objects lines3D: Detected 3D lines. exported_lines3D_DGN: DGN file export with 3D lines. exported_lines3D_cesium: Cesium 3D Tiles file export with 3D lines. + exported_lines3D_geojson: GeoJSON file export with 3D lines. polygons3D: Detected polygons. exported_polygons3D_DGN: DGN file export with polygons. exported_polygons3D_cesium: Cesium 3D Tiles file export with 3D polygons. + exported_polygons3D_geojson: GeoJSON file export with 3D polygons. """ def __init__(self) -> None: @@ -832,13 +906,17 @@ def __init__(self) -> None: self.objects3D: str = "" self.exported_objects3D_DGN: str = "" self.exported_objects3D_cesium: str = "" + self.exported_objects3D_geojson: str = "" self.exported_locations3D_SHP: str = "" + self.exported_locations3D_geojson: str = "" self.lines3D: str = "" self.exported_lines3D_DGN: str = "" self.exported_lines3D_cesium: str = "" + self.exported_lines3D_geojson: str = "" self.polygons3D: str = "" self.exported_polygons3D_DGN: str = "" self.exported_polygons3D_cesium: str = "" + self.exported_polygons3D_geojson: str = "" class Options: """ @@ -906,6 +984,8 @@ def to_json(self) -> dict: json_dict["outputs"].append("objects3D") if self.outputs.exported_locations3D_SHP: json_dict["outputs"].append("exportedLocations3DSHP") + if self.outputs.exported_locations3D_geojson: + json_dict["outputs"].append("exportedLocations3DGeoJSON") json_dict["options"] = dict() if self.options.color_threshold_low: json_dict["options"]["colorThresholdLow"] = str(self.options.color_threshold_low) @@ -957,6 +1037,10 @@ def from_json(cls, settings_json: dict) -> ReturnValue[ChangeDetectionJobSetting new_job_settings.outputs.exported_locations3D_SHP = output_dict[ "id" ] + elif output_dict["type"] == "exportedLocations3DGeoJSON": + new_job_settings.outputs.exported_locations3D_geojson = output_dict[ + "id" + ] else: raise TypeError( "found non expected output type:" + output_dict["type"] @@ -1013,11 +1097,13 @@ class Outputs: Attributes: objects3D: Regions with changes. exported_locations3D_SHP: ESRI SHP file export with locations of regions with changes. + exported_locations3D_geojson:GeoJSON export with locations of regions with changes. """ def __init__(self) -> None: self.objects3D: str = "" self.exported_locations3D_SHP: str = "" + self.exported_locations3D_geojson: str = "" class Options: """ diff --git a/typescript/packages/reality-capture-analysis/src/RealityDataAnalysisService.test.ts b/typescript/packages/reality-capture-analysis/src/RealityDataAnalysisService.test.ts index 2954ddfa..61197e22 100644 --- a/typescript/packages/reality-capture-analysis/src/RealityDataAnalysisService.test.ts +++ b/typescript/packages/reality-capture-analysis/src/RealityDataAnalysisService.test.ts @@ -370,8 +370,10 @@ describe("Reality Analysis unit tests", () => { }, outputs: { exportedLocations3DSHP: "", + exportedLocations3DGeoJSON: "", exportedObjects3DCesium: "", exportedObjects3DDGN: "", + exportedObjects3DGeoJSON: "", objects2D: "objects2DId", objects3D: "" }, diff --git a/typescript/packages/reality-capture-analysis/src/Settings.test.ts b/typescript/packages/reality-capture-analysis/src/Settings.test.ts index 92ba7514..af6902b8 100644 --- a/typescript/packages/reality-capture-analysis/src/Settings.test.ts +++ b/typescript/packages/reality-capture-analysis/src/Settings.test.ts @@ -24,7 +24,9 @@ describe("Reality Analysis settings unit tests", () => { o2dSettings.outputs.objects3D = "objects3D"; o2dSettings.outputs.exportedObjects3DDGN = "exportedObjects3DDGN"; o2dSettings.outputs.exportedObjects3DCesium = "exportedObjects3DCesium"; + o2dSettings.outputs.exportedObjects3DGeoJSON = "exportedObjects3DGeoJSON"; o2dSettings.outputs.exportedLocations3DSHP = "exportedLocations3DSHP"; + o2dSettings.outputs.exportedLocations3DGeoJSON = "exportedLocations3DGeoJSON"; o2dSettings.options.useTiePoints = true; o2dSettings.options.minPhotos = 10; o2dSettings.options.maxDist = 100; @@ -44,7 +46,9 @@ describe("Reality Analysis settings unit tests", () => { expect(json.outputs).to.deep.include("objects3D"), expect(json.outputs).to.deep.include("exportedObjects3DDGN"), expect(json.outputs).to.deep.include("exportedObjects3DCesium"), + expect(json.outputs).to.deep.include("exportedObjects3DGeoJSON"), expect(json.outputs).to.deep.include("exportedLocations3DSHP"), + expect(json.outputs).to.deep.include("exportedLocations3DGeoJSON"), expect(json.options.useTiePoints).to.deep.equal("true"), expect(json.options.minPhotos).to.deep.equal("10"), @@ -67,8 +71,10 @@ describe("Reality Analysis settings unit tests", () => { s2dSettings.outputs.lines3D = "lines3D"; s2dSettings.outputs.exportedPolygons3DDGN = "exportedPolygons3DDGN"; s2dSettings.outputs.exportedPolygons3DCesium = "exportedPolygons3DCesium"; + s2dSettings.outputs.exportedPolygons3DGeoJSON = "exportedPolygons3DGeoJSON"; s2dSettings.outputs.exportedLines3DDGN = "exportedLines3DDGN"; s2dSettings.outputs.exportedLines3DCesium = "exportedLines3DCesium"; + s2dSettings.outputs.exportedLines3DGeoJSON = "exportedLines3DGeoJSON"; s2dSettings.options.computeLineWidth = true; s2dSettings.options.removeSmallComponents = 1; @@ -92,8 +98,10 @@ describe("Reality Analysis settings unit tests", () => { expect(json.outputs).to.deep.include("lines3D"), expect(json.outputs).to.deep.include("exportedPolygons3DDGN"), expect(json.outputs).to.deep.include("exportedPolygons3DCesium"), + expect(json.outputs).to.deep.include("exportedPolygons3DGeoJSON"), expect(json.outputs).to.deep.include("exportedLines3DDGN"), expect(json.outputs).to.deep.include("exportedLines3DCesium"), + expect(json.outputs).to.deep.include("exportedLines3DGeoJSON"), expect(json.options.computeLineWidth).to.deep.equal("true"), expect(json.options.removeSmallComponents).to.deep.equal("1"), expect(json.options.exportSrs).to.deep.equal("EPSG:4512"), @@ -107,7 +115,9 @@ describe("Reality Analysis settings unit tests", () => { s2dSettings.inputs.orthophotoSegmentationDetector = "orthophotoSegmentationDetectorId"; s2dSettings.outputs.exportedLines2DDGN = "exportedLines2DDGN"; s2dSettings.outputs.exportedLines2DSHP = "exportedLines2DSHP"; + s2dSettings.outputs.exportedLines2DGeoJSON = "exportedLines2DGeoJSON"; s2dSettings.outputs.exportedPolygons2DSHP = "exportedPolygons2DSHP"; + s2dSettings.outputs.exportedPolygons2DGeoJSON = "exportedPolygons2DGeoJSON"; s2dSettings.outputs.lines2D = "lines2D"; s2dSettings.outputs.polygons2D = "polygons2D"; s2dSettings.outputs.segmentation2D = "segmentation2D"; @@ -122,7 +132,9 @@ describe("Reality Analysis settings unit tests", () => { expect(json.outputs).to.have.length.above(0), expect(json.outputs).to.deep.include("exportedLines2DDGN"), expect(json.outputs).to.deep.include("exportedLines2DSHP"), + expect(json.outputs).to.deep.include("exportedLines2DGeoJSON"), expect(json.outputs).to.deep.include("exportedPolygons2DSHP"), + expect(json.outputs).to.deep.include("exportedPolygons2DGeoJSON"), expect(json.outputs).to.deep.include("lines2D"), expect(json.outputs).to.deep.include("polygons2D"), expect(json.outputs).to.deep.include("segmentation2D"), @@ -140,12 +152,16 @@ describe("Reality Analysis settings unit tests", () => { s3dSettings.outputs.lines3D = "lines3D"; s3dSettings.outputs.polygons3D = "polygons3D"; s3dSettings.outputs.exportedLocations3DSHP = "exportedLocations3DSHP"; + s3dSettings.outputs.exportedLocations3DGeoJSON = "exportedLocations3DGeoJSON"; s3dSettings.outputs.exportedObjects3DCesium = "exportedObjects3DCesium"; s3dSettings.outputs.exportedObjects3DDGN = "exportedObjects3DDGN"; + s3dSettings.outputs.exportedObjects3DGeoJSON = "exportedObjects3DGeoJSON"; s3dSettings.outputs.exportedLines3DDGN = "exportedLines3DDGN"; s3dSettings.outputs.exportedLines3DCesium = "exportedLines3DCesium"; + s3dSettings.outputs.exportedLines3DGeoJSON = "exportedLines3DGeoJSON"; s3dSettings.outputs.exportedPolygons3DDGN = "exportedPolygons3DDGN"; s3dSettings.outputs.exportedPolygons3DCesium = "exportedPolygons3DCesium"; + s3dSettings.outputs.exportedPolygons3DGeoJSON = "exportedPolygons3DGeoJSON"; s3dSettings.outputs.exportedSegmentation3DLAS = "exportedSegmentation3DLAS"; s3dSettings.outputs.exportedSegmentation3DLAZ = "exportedSegmentation3DLAZ"; s3dSettings.outputs.exportedSegmentation3DPLY = "exportedSegmentation3DPLY"; @@ -170,8 +186,10 @@ describe("Reality Analysis settings unit tests", () => { expect(json).to.have.property("outputs"), expect(json.outputs).to.have.length.above(0), expect(json.outputs).to.deep.include("exportedLocations3DSHP"), + expect(json.outputs).to.deep.include("exportedLocations3DGeoJSON"), expect(json.outputs).to.deep.include("exportedObjects3DCesium"), expect(json.outputs).to.deep.include("exportedObjects3DDGN"), + expect(json.outputs).to.deep.include("exportedObjects3DGeoJSON"), expect(json.outputs).to.deep.include("exportedSegmentation3DLAS"), expect(json.outputs).to.deep.include("exportedSegmentation3DLAZ"), expect(json.outputs).to.deep.include("exportedSegmentation3DPLY"), @@ -181,9 +199,11 @@ describe("Reality Analysis settings unit tests", () => { expect(json.outputs).to.deep.include("segmentedPointCloud"), expect(json.outputs).to.deep.include("exportedLines3DDGN"), expect(json.outputs).to.deep.include("exportedLines3DCesium"), + expect(json.outputs).to.deep.include("exportedLines3DGeoJSON"), expect(json.outputs).to.deep.include("polygons3D"), expect(json.outputs).to.deep.include("exportedPolygons3DDGN"), expect(json.outputs).to.deep.include("exportedPolygons3DCesium"), + expect(json.outputs).to.deep.include("exportedPolygons3DGeoJSON"), expect(json.outputs).to.deep.include("lines3D"), expect(json.options.saveConfidence).to.deep.equal("true"), @@ -200,6 +220,7 @@ describe("Reality Analysis settings unit tests", () => { changeDetectionSettings.inputs.pointClouds1 = "pointClouds1Id"; changeDetectionSettings.inputs.pointClouds2 = "pointClouds2Id"; changeDetectionSettings.outputs.exportedLocations3DSHP = "exportedLocations3DSHP"; + changeDetectionSettings.outputs.exportedLocations3DGeoJSON = "exportedLocations3DGeoJSON"; changeDetectionSettings.outputs.objects3D = "objects3D"; changeDetectionSettings.options.colorThresholdLow = 10; changeDetectionSettings.options.colorThresholdHigh = 50; @@ -220,6 +241,7 @@ describe("Reality Analysis settings unit tests", () => { expect(json).to.have.property("outputs"), expect(json.outputs).to.have.length.above(0), expect(json.outputs).to.deep.include("exportedLocations3DSHP"), + expect(json.outputs).to.deep.include("exportedLocations3DGeoJSON"), expect(json.outputs).to.deep.include("objects3D"), expect(json.options.colorThresholdLow).to.deep.equal("10"), @@ -307,9 +329,17 @@ describe("Reality Analysis settings unit tests", () => { "type": "exportedObjects3DCesium", "id": "exportedObjects3DCesiumId" }, + { + "type": "exportedObjects3DGeoJSON", + "id": "exportedObjects3DGeoJSONId" + }, { "type": "exportedLocations3DSHP", "id": "exportedLocations3DSHPId" + }, + { + "type": "exportedLocations3DGeoJSON", + "id": "exportedLocations3DGeoJSONId" } ], "options": { @@ -332,7 +362,9 @@ describe("Reality Analysis settings unit tests", () => { expect(o2DSettings.outputs).to.have.property("objects3D", "objects3DId"), expect(o2DSettings.outputs).to.have.property("exportedObjects3DDGN", "exportedObjects3DDGNId"), expect(o2DSettings.outputs).to.have.property("exportedObjects3DCesium", "exportedObjects3DCesiumId"), + expect(o2DSettings.outputs).to.have.property("exportedObjects3DGeoJSON", "exportedObjects3DGeoJSONId"), expect(o2DSettings.outputs).to.have.property("exportedLocations3DSHP", "exportedLocations3DSHPId"), + expect(o2DSettings.outputs).to.have.property("exportedLocations3DGeoJSON", "exportedLocations3DGeoJSONId"), expect(o2DSettings.options.useTiePoints).to.deep.equal(true), expect(o2DSettings.options.minPhotos).to.deep.equal(10), @@ -424,6 +456,10 @@ describe("Reality Analysis settings unit tests", () => { "type": "exportedPolygons3DCesium", "id": "exportedPolygons3DCesiumId" }, + { + "type": "exportedPolygons3DGeoJSON", + "id": "exportedPolygons3DGeoJSONId" + }, { "type": "exportedLines3DDGN", "id": "exportedLines3DDGNId" @@ -432,6 +468,10 @@ describe("Reality Analysis settings unit tests", () => { "type": "exportedLines3DCesium", "id": "exportedLines3DCesiumId" }, + { + "type": "exportedLines3DGeoJSON", + "id": "exportedLines3DGeoJSONId" + }, ], "options": { "minPhotos": "10", @@ -455,8 +495,10 @@ describe("Reality Analysis settings unit tests", () => { expect(s2DSettings.outputs).to.have.property("lines3D", "lines3DId"), expect(s2DSettings.outputs).to.have.property("exportedPolygons3DDGN", "exportedPolygons3DDGNId"), expect(s2DSettings.outputs).to.have.property("exportedPolygons3DCesium", "exportedPolygons3DCesiumId"), + expect(s2DSettings.outputs).to.have.property("exportedPolygons3DGeoJSON", "exportedPolygons3DGeoJSONId"), expect(s2DSettings.outputs).to.have.property("exportedLines3DDGN", "exportedLines3DDGNId"), expect(s2DSettings.outputs).to.have.property("exportedLines3DCesium", "exportedLines3DCesiumId"), + expect(s2DSettings.outputs).to.have.property("exportedLines3DGeoJSON", "exportedLines3DGeoJSONId"), expect(s2DSettings.options.computeLineWidth).to.deep.equal(true), expect(s2DSettings.options.minPhotos).to.deep.equal(10), @@ -528,6 +570,10 @@ describe("Reality Analysis settings unit tests", () => { "type": "exportedPolygons2DSHP", "id": "exportedPolygons2DSHPId" }, + { + "type": "exportedPolygons2DGeoJSON", + "id": "exportedPolygons2DGeoJSONId" + }, { "type": "lines2D", "id": "lines2DId" @@ -540,6 +586,10 @@ describe("Reality Analysis settings unit tests", () => { "type": "exportedLines2DDGN", "id": "exportedLines2DDGNId" }, + { + "type": "exportedLines2DGeoJSON", + "id": "exportedLines2DGeoJSONId" + }, ] }; const orthoSettings = await SOrthoJobSettings.fromJson(json); @@ -552,9 +602,11 @@ describe("Reality Analysis settings unit tests", () => { expect(orthoSettings.outputs).to.have.property("segmentedPhotos", "segmentedPhotosId"), expect(orthoSettings.outputs).to.have.property("polygons2D", "polygons2DId"), expect(orthoSettings.outputs).to.have.property("exportedPolygons2DSHP", "exportedPolygons2DSHPId"), + expect(orthoSettings.outputs).to.have.property("exportedPolygons2DGeoJSON", "exportedPolygons2DGeoJSONId"), expect(orthoSettings.outputs).to.have.property("lines2D", "lines2DId"), expect(orthoSettings.outputs).to.have.property("exportedLines2DSHP", "exportedLines2DSHPId"), expect(orthoSettings.outputs).to.have.property("exportedLines2DDGN", "exportedLines2DDGNId"), + expect(orthoSettings.outputs).to.have.property("exportedLines2DGeoJSON", "exportedLines2DGeoJSONId"), ]); }); @@ -653,10 +705,18 @@ describe("Reality Analysis settings unit tests", () => { "type": "exportedObjects3DCesium", "id": "exportedObjects3DCesiumId" }, + { + "type": "exportedObjects3DGeoJSON", + "id": "exportedObjects3DGeoJSONId" + }, { "type": "exportedLocations3DSHP", "id": "exportedLocations3DSHPId" }, + { + "type": "exportedLocations3DGeoJSON", + "id": "exportedLocations3DGeoJSONId" + }, { "type": "exportedLines3DDGN", "id": "exportedLines3DDGNId" @@ -665,6 +725,10 @@ describe("Reality Analysis settings unit tests", () => { "type": "exportedLines3DCesium", "id": "exportedLines3DCesiumId" }, + { + "type": "exportedLines3DGeoJSON", + "id": "exportedLines3DGeoJSONId" + }, { "type": "polygons3D", "id": "polygons3DId" @@ -677,6 +741,10 @@ describe("Reality Analysis settings unit tests", () => { "type": "exportedPolygons3DCesium", "id": "exportedPolygons3DCesiumId" }, + { + "type": "exportedPolygons3DGeoJSON", + "id": "exportedPolygons3DGeoJSONId" + }, { "type": "lines3D", "id": "lines3DId" @@ -707,12 +775,16 @@ describe("Reality Analysis settings unit tests", () => { expect(s3DSettings.outputs).to.have.property("objects3D", "objects3DId"), expect(s3DSettings.outputs).to.have.property("exportedObjects3DDGN", "exportedObjects3DDGNId"), expect(s3DSettings.outputs).to.have.property("exportedObjects3DCesium", "exportedObjects3DCesiumId"), + expect(s3DSettings.outputs).to.have.property("exportedObjects3DGeoJSON", "exportedObjects3DGeoJSONId"), expect(s3DSettings.outputs).to.have.property("exportedLocations3DSHP", "exportedLocations3DSHPId"), + expect(s3DSettings.outputs).to.have.property("exportedLocations3DGeoJSON", "exportedLocations3DGeoJSONId"), expect(s3DSettings.outputs).to.have.property("exportedLines3DDGN", "exportedLines3DDGNId"), expect(s3DSettings.outputs).to.have.property("exportedLines3DCesium", "exportedLines3DCesiumId"), + expect(s3DSettings.outputs).to.have.property("exportedLines3DGeoJSON", "exportedLines3DGeoJSONId"), expect(s3DSettings.outputs).to.have.property("polygons3D", "polygons3DId"), expect(s3DSettings.outputs).to.have.property("exportedPolygons3DDGN", "exportedPolygons3DDGNId"), expect(s3DSettings.outputs).to.have.property("exportedPolygons3DCesium", "exportedPolygons3DCesiumId"), + expect(s3DSettings.outputs).to.have.property("exportedPolygons3DGeoJSON", "exportedPolygons3DGeoJSONId"), expect(s3DSettings.outputs).to.have.property("lines3D", "lines3DId"), expect(s3DSettings.options.saveConfidence).to.deep.equal(true), @@ -784,6 +856,10 @@ describe("Reality Analysis settings unit tests", () => { { "type": "exportedLocations3DSHP", "id": "exportedLocations3DSHPId" + }, + { + "type": "exportedLocations3DGeoJSON", + "id": "exportedLocations3DGeoJSONId" } ], "options": { @@ -806,6 +882,7 @@ describe("Reality Analysis settings unit tests", () => { expect(changeDetectionSettings.outputs).to.have.property("objects3D", "objects3DId"), expect(changeDetectionSettings.outputs).to.have.property("exportedLocations3DSHP", "exportedLocations3DSHPId"), + expect(changeDetectionSettings.outputs).to.have.property("exportedLocations3DGeoJSON", "exportedLocations3DGeoJSONId"), expect(changeDetectionSettings.options.colorThresholdLow).to.deep.equal(10), expect(changeDetectionSettings.options.colorThresholdHigh).to.deep.equal(100), diff --git a/typescript/packages/reality-capture-analysis/src/Settings.ts b/typescript/packages/reality-capture-analysis/src/Settings.ts index 0f9cc5b0..935a8b9a 100644 --- a/typescript/packages/reality-capture-analysis/src/Settings.ts +++ b/typescript/packages/reality-capture-analysis/src/Settings.ts @@ -70,8 +70,12 @@ class O2DOutputs { exportedObjects3DDGN: string; /** Cesium 3D Tiles file export with 3D objects. */ exportedObjects3DCesium: string; + /** GeoJSON file export with 3D objects. */ + exportedObjects3DGeoJSON: string; /** ESRI SHP file export with locations of the 3D objects. */ exportedLocations3DSHP: string; + /** GeoJSON file export with locations of the 3D objects. */ + exportedLocations3DGeoJSON: string; constructor() { /** @@ -94,11 +98,21 @@ class O2DOutputs { * @type {string} */ this.exportedObjects3DCesium = ""; + /** + * GeoJSON file export with 3D objects. + * @type {string} + */ + this.exportedObjects3DGeoJSON = ""; /** * ESRI SHP file export with locations of the 3D objects. * @type {string} */ this.exportedLocations3DSHP = ""; + /** + * GeoJSON file export with locations of the 3D objects. + * @type {string} + */ + this.exportedLocations3DGeoJSON = ""; } } @@ -212,9 +226,15 @@ export class O2DJobSettings { if (this.outputs.exportedObjects3DCesium) json["outputs"].push("exportedObjects3DCesium"); + if (this.outputs.exportedObjects3DGeoJSON) + json["outputs"].push("exportedObjects3DGeoJSON"); + if (this.outputs.exportedLocations3DSHP) json["outputs"].push("exportedLocations3DSHP"); + if (this.outputs.exportedLocations3DGeoJSON) + json["outputs"].push("exportedLocations3DGeoJSON"); + json["options"] = {}; if (this.options.useTiePoints) json["options"]["useTiePoints"] = "true"; @@ -263,8 +283,12 @@ export class O2DJobSettings { newJobSettings.outputs.exportedObjects3DDGN = output["id"]; else if (output["type"] === "exportedObjects3DCesium") newJobSettings.outputs.exportedObjects3DCesium = output["id"]; + else if (output["type"] === "exportedObjects3DGeoJSON") + newJobSettings.outputs.exportedObjects3DGeoJSON = output["id"]; else if (output["type"] === "exportedLocations3DSHP") newJobSettings.outputs.exportedLocations3DSHP = output["id"]; + else if (output["type"] === "exportedLocations3DGeoJSON") + newJobSettings.outputs.exportedLocations3DGeoJSON = output["id"]; else return Promise.reject(new Error("Found unexpected output type : " + output["type"])); } @@ -342,12 +366,16 @@ class S2DOutputs { exportedLines3DDGN: string; /** Cesium 3D Tiles file export with 3D lines. */ exportedLines3DCesium: string; + /** GeoJSON file export with 3D lines. */ + exportedLines3DGeoJSON: string; /** Detected polygons. */ polygons3D: string; /** DGN file export with polygons. */ exportedPolygons3DDGN: string; /** Cesium 3D Tiles file export with 3D polygons. */ exportedPolygons3DCesium: string; + /** GeoJSON file export with 3D polygons. */ + exportedPolygons3DGeoJSON: string; constructor() { /** @@ -375,6 +403,11 @@ class S2DOutputs { * @type {string} */ this.exportedLines3DCesium = ""; + /** + * GeoJSON file export with 3D lines. + * @type {string} + */ + this.exportedLines3DGeoJSON = ""; /** * Detected polygons. * @type {string} @@ -390,6 +423,11 @@ class S2DOutputs { * @type {string} */ this.exportedPolygons3DCesium = ""; + /** + * GeoJSON file export with 3D polygons. + * @type {string} + */ + this.exportedPolygons3DGeoJSON = ""; } } @@ -510,12 +548,18 @@ export class S2DJobSettings { if(this.outputs.exportedPolygons3DCesium) json["outputs"].push("exportedPolygons3DCesium"); + if(this.outputs.exportedPolygons3DGeoJSON) + json["outputs"].push("exportedPolygons3DGeoJSON"); + if(this.outputs.exportedLines3DCesium) json["outputs"].push("exportedLines3DCesium"); if(this.outputs.exportedLines3DDGN) json["outputs"].push("exportedLines3DDGN"); + if(this.outputs.exportedLines3DGeoJSON) + json["outputs"].push("exportedLines3DGeoJSON"); + json["options"] = {}; if (this.options.computeLineWidth) json["options"]["computeLineWidth"] = "true"; @@ -568,10 +612,14 @@ export class S2DJobSettings { newJobSettings.outputs.exportedPolygons3DDGN = output["id"]; else if(output["type"] === "exportedPolygons3DCesium") newJobSettings.outputs.exportedPolygons3DCesium = output["id"]; + else if(output["type"] === "exportedPolygons3DGeoJSON") + newJobSettings.outputs.exportedPolygons3DGeoJSON = output["id"]; else if(output["type"] === "exportedLines3DDGN") newJobSettings.outputs.exportedLines3DDGN = output["id"]; else if(output["type"] === "exportedLines3DCesium") newJobSettings.outputs.exportedLines3DCesium = output["id"]; + else if(output["type"] === "exportedLines3DGeoJSON") + newJobSettings.outputs.exportedLines3DGeoJSON = output["id"]; else return Promise.reject(new Error("Found unexpected output type : " + output["type"])); } @@ -626,12 +674,16 @@ class SOrthoOutputs { polygons2D: string; /** 2D polygons exported to ESRI shapefile. */ exportedPolygons2DSHP: string; + /** 2D polygons exported to GeoJSON file. */ + exportedPolygons2DGeoJSON: string; /** Detected 2D lines. */ lines2D: string; /** 2D lines exported to ESRI shapefile. */ exportedLines2DSHP: string; /** 2D lines exported to DGN file. */ exportedLines2DDGN: string; + /** 2D lines exported to GeoJSON file. */ + exportedLines2DGeoJSON: string; constructor() { /** @@ -654,6 +706,11 @@ class SOrthoOutputs { * @type {string} */ this.exportedPolygons2DSHP = ""; + /** + * 2D polygons exported to GeoJSON file. + * @type {string} + */ + this.exportedPolygons2DGeoJSON = ""; /** * Detected 2D lines. * @type {string} @@ -669,6 +726,11 @@ class SOrthoOutputs { * @type {string} */ this.exportedLines2DDGN = ""; + /** + * 2D lines exported to GeoJSON file. + * @type {string} + */ + this.exportedLines2DGeoJSON = ""; } } @@ -733,12 +795,18 @@ export class SOrthoJobSettings { if(this.outputs.exportedPolygons2DSHP) json["outputs"].push("exportedPolygons2DSHP"); + if(this.outputs.exportedPolygons2DGeoJSON) + json["outputs"].push("exportedPolygons2DGeoJSON"); + if(this.outputs.exportedLines2DSHP) json["outputs"].push("exportedLines2DSHP"); if(this.outputs.exportedLines2DDGN) json["outputs"].push("exportedLines2DDGN"); + if(this.outputs.exportedLines2DGeoJSON) + json["outputs"].push("exportedLines2DGeoJSON"); + return json; } @@ -770,10 +838,14 @@ export class SOrthoJobSettings { newJobSettings.outputs.lines2D = output["id"]; else if(output["type"] === "exportedPolygons2DSHP") newJobSettings.outputs.exportedPolygons2DSHP = output["id"]; + else if(output["type"] === "exportedPolygons2DGeoJSON") + newJobSettings.outputs.exportedPolygons2DGeoJSON = output["id"]; else if(output["type"] === "exportedLines2DSHP") newJobSettings.outputs.exportedLines2DSHP = output["id"]; else if(output["type"] === "exportedLines2DDGN") newJobSettings.outputs.exportedLines2DDGN = output["id"]; + else if(output["type"] === "exportedLines2DGeoJSON") + newJobSettings.outputs.exportedLines2DGeoJSON = output["id"]; else return Promise.reject(new Error("Found unexpected output type : " + output["type"])); } @@ -848,20 +920,28 @@ class S3DOutputs { exportedObjects3DDGN: string; /** Cesium 3D Tiles file export with 3D objects. */ exportedObjects3DCesium: string; + /** GeoJSON file export with 3D objects. */ + exportedObjects3DGeoJSON: string; /** ESRI SHP file export with locations of the 3D objects. */ exportedLocations3DSHP: string; + /** GeoJSON file export with locations of the 3D objects. */ + exportedLocations3DGeoJSON: string; + /** Detected 3D lines. */ + lines3D: string; /** DGN file export with 3D lines. */ exportedLines3DDGN: string; /** Cesium 3D Tiles file export with 3D lines. */ exportedLines3DCesium: string; + /** Cesium GeoJSON file export with 3D lines. */ + exportedLines3DGeoJSON: string; /** Detected polygons. */ polygons3D: string; /** DGN file export with polygons. */ exportedPolygons3DDGN: string; /** Cesium 3D Tiles file export with 3D polygons. */ exportedPolygons3DCesium: string; - /** Detected 3D lines. */ - lines3D: string; + /** GeoJSON file export with 3D polygons. */ + exportedPolygons3DGeoJSON: string; constructor() { /** @@ -909,11 +989,26 @@ class S3DOutputs { * @type {string} */ this.exportedObjects3DCesium = ""; + /** + * GeoJSON file export with 3D objects. + * @type {string} + */ + this.exportedObjects3DGeoJSON = ""; /** * ESRI SHP file export with locations of the 3D objects. * @type {string} */ this.exportedLocations3DSHP = ""; + /** + * GeoJSON file export with locations of the 3D objects. + * @type {string} + */ + this.exportedLocations3DGeoJSON = ""; + /** + * Detected 3D lines. + * @type {string} + */ + this.lines3D = ""; /** * DGN file export with 3D lines. * @type {string} @@ -924,6 +1019,11 @@ class S3DOutputs { * @type {string} */ this.exportedLines3DCesium = ""; + /** + * GeoJSON file export with 3D lines. + * @type {string} + */ + this.exportedLines3DGeoJSON = ""; /** * Detected polygons. * @type {string} @@ -940,10 +1040,10 @@ class S3DOutputs { */ this.exportedPolygons3DCesium = ""; /** - * Detected 3D lines. + * GeoJSON file export with 3D polygons. * @type {string} */ - this.lines3D = ""; + this.exportedPolygons3DGeoJSON = ""; } } @@ -1074,15 +1174,24 @@ export class S3DJobSettings { if (this.outputs.exportedObjects3DCesium) json["outputs"].push("exportedObjects3DCesium"); + if (this.outputs.exportedObjects3DGeoJSON) + json["outputs"].push("exportedObjects3DGeoJSON"); + if (this.outputs.exportedLocations3DSHP) json["outputs"].push("exportedLocations3DSHP"); + if (this.outputs.exportedLocations3DGeoJSON) + json["outputs"].push("exportedLocations3DGeoJSON"); + if (this.outputs.exportedLines3DDGN) json["outputs"].push("exportedLines3DDGN"); if (this.outputs.exportedLines3DCesium) json["outputs"].push("exportedLines3DCesium"); + if (this.outputs.exportedLines3DGeoJSON) + json["outputs"].push("exportedLines3DGeoJSON"); + if (this.outputs.polygons3D) json["outputs"].push("polygons3D"); @@ -1094,6 +1203,9 @@ export class S3DJobSettings { if (this.outputs.exportedPolygons3DCesium) json["outputs"].push("exportedPolygons3DCesium"); + + if (this.outputs.exportedPolygons3DGeoJSON) + json["outputs"].push("exportedPolygons3DGeoJSON"); json["options"] = {}; if (this.options.exportSrs) @@ -1153,12 +1265,18 @@ export class S3DJobSettings { newJobSettings.outputs.exportedObjects3DDGN = output["id"]; else if (output["type"] === "exportedObjects3DCesium") newJobSettings.outputs.exportedObjects3DCesium = output["id"]; + else if (output["type"] === "exportedObjects3DGeoJSON") + newJobSettings.outputs.exportedObjects3DGeoJSON = output["id"]; else if (output["type"] === "exportedLocations3DSHP") newJobSettings.outputs.exportedLocations3DSHP = output["id"]; + else if (output["type"] === "exportedLocations3DGeoJSON") + newJobSettings.outputs.exportedLocations3DGeoJSON = output["id"]; else if (output["type"] === "exportedLines3DDGN") newJobSettings.outputs.exportedLines3DDGN = output["id"]; else if (output["type"] === "exportedLines3DCesium") newJobSettings.outputs.exportedLines3DCesium = output["id"]; + else if (output["type"] === "exportedLines3DGeoJSON") + newJobSettings.outputs.exportedLines3DGeoJSON = output["id"]; else if (output["type"] === "polygons3D") newJobSettings.outputs.polygons3D = output["id"]; else if (output["type"] === "lines3D") @@ -1167,6 +1285,8 @@ export class S3DJobSettings { newJobSettings.outputs.exportedPolygons3DDGN = output["id"]; else if (output["type"] === "exportedPolygons3DCesium") newJobSettings.outputs.exportedPolygons3DCesium = output["id"]; + else if (output["type"] === "exportedPolygons3DGeoJSON") + newJobSettings.outputs.exportedPolygons3DGeoJSON = output["id"]; else return Promise.reject(new Error("Found unexpected output type : " + output["type"])); } @@ -1458,6 +1578,8 @@ class ChangeDetectionOutputs { objects3D: string; /** ESRI SHP file export with locations of regions with changes. */ exportedLocations3DSHP: string; + /** GeoJSON file export with locations of regions with changes. */ + exportedLocations3DGeoJSON: string; constructor() { /** @@ -1470,6 +1592,11 @@ class ChangeDetectionOutputs { * @type {string} */ this.exportedLocations3DSHP = ""; + /** + * GeoJSON file export with locations of regions with changes. + * @type {string} + */ + this.exportedLocations3DGeoJSON = ""; } } @@ -1597,6 +1724,9 @@ export class ChangeDetectionJobSettings { if (this.outputs.exportedLocations3DSHP) json["outputs"].push("exportedLocations3DSHP"); + if (this.outputs.exportedLocations3DGeoJSON) + json["outputs"].push("exportedLocations3DGeoJSON"); + json["options"] = {}; if (this.options.colorThresholdLow) json["options"]["colorThresholdLow"] = this.options.colorThresholdLow.toString(); @@ -1648,6 +1778,8 @@ export class ChangeDetectionJobSettings { newJobSettings.outputs.objects3D = output["id"]; else if (output["type"] === "exportedLocations3DSHP") newJobSettings.outputs.exportedLocations3DSHP = output["id"]; + else if (output["type"] === "exportedLocations3DGeoJSON") + newJobSettings.outputs.exportedLocations3DGeoJSON = output["id"]; else return Promise.reject(new Error("Found unexpected output type : " + output["type"])); }