diff --git a/3DGeoVolumes/collections/NewYork/NewYork.json b/3DGeoVolumes/collections/NewYork/NewYork.json deleted file mode 100644 index 4dd0f8d81eaf899fc0c7c3080231c3a475724387..0000000000000000000000000000000000000000 --- a/3DGeoVolumes/collections/NewYork/NewYork.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "links": [ - { - "rel": "self", - "href": "host_url/collections/NewYork", - "type": "application/json", - "title": "All geospatial data available in the New York area" - } - ], - "collections": [ - { - "id": "NewYork", - "title": "NewYork Data Source", - "description": "All Supported 3D Containers for the city of NewYork", - "collectiontype": "3d-container", - "extent": { - "spatial": { - "bbox": [ - [ - -74.01900887327089, - 40.700475291581974, - -11.892070104139751, - -73.9068954348699, - 40.880256294183646, - 547.7591871983744 - ] - ], - "crs": "http://www.opengis.net/def/crs/OGC/0/CRS84h" - } - }, - "links": [ - { - "rel": "collections", - "href": "host_url/collections/", - "type": "application/json" - }, - { - "title": "NewYork - 3D Buildings Manhattan", - "rel": "self", - "href": "host_url/collections/NewYork/", - "type": "application/json" - }, - { - "title": "NewYork - 3D Buildings Manhattan: 3D Tiles", - "rel": "items", - "href": "host_url/collections/NewYork/3dtiles", - "type": "application/json+3dtiles" - }, - { - "title": "NewYork - 3D Buildings Manhattan: i3s", - "rel": "items", - "href": "https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Buildings_NewYork_17/SceneServer/layers/0/", - "type": "application/json+i3s" - } - ], - "children": [ - - ], - "content": [ - { - "title": "NewYork - 3D Buildings Manhattan: 3D Tiles", - "rel": "original", - "href": "host_url/collections/NewYork/3dtiles/", - "type": "application/json+3dtiles" - }, - { - "title": "NewYork - 3D Buildings Manhattan: i3s", - "rel": "original", - "href": "https://tiles.arcgis.com/tiles/P3ePLMYs2RVChkJx/arcgis/rest/services/Buildings_NewYork_17/SceneServer/layers/0/", - "type": "application/json+i3s" - } - ] - } - ] - } \ No newline at end of file diff --git a/3DGeoVolumes/collections/Stuttgart/Stuttgart.json b/3DGeoVolumes/collections/Stuttgart/Stuttgart.json deleted file mode 100644 index 81715ecb51b6f087ce46db8055aac3f1f70b1c0f..0000000000000000000000000000000000000000 --- a/3DGeoVolumes/collections/Stuttgart/Stuttgart.json +++ /dev/null @@ -1,146 +0,0 @@ -{ - "links": [ - { - "rel": "self", - "href": "host_url/collections/Stuttgart", - "type": "application/json", - "title": "Stuttgart 3D models" - } - ], - "collections": [ - { - "id": "Stuttgart", - "title": "Stuttgart 3D Models Demo", - "description": "All Supported 3D Containers for the city of Stuttgart LoD 1 from OSM with Textures", - "collectiontype": "3d-container", - "extent": { - "spatial": { - "bbox": [ - [9.161434,48.771841,-10,9.183426,48.786318,550] - ], - "crs": "http://www.opengis.net/def/crs/OGC/0/CRS84h" - } - }, - "links": [ - { - "rel": "collections", - "href": "host_url/collections/", - "type": "application/json" - }, - { - "title": "Stuttgart 3D Building Model (LoD 1) - Collections", - "rel": "self", - "href": "host_url/collections/Stuttgart_LoD1_OSM_Textures/", - "type": "application/json" - }, - { - "title": "Stuttgart 3D Building Model (LoD 1) : 3D Tiles", - "rel": "items", - "href": "https://steinbeis-3dps.eu/3DGeoVolumes/collections/Stuttgart/Stuttgart_3DBuildings_LoD1/3dtiles/", - "type": "application/json+3dtiles" - } - ], - "children": [ - { - "id": "HFTBuilding2_3DModel", - "title": "HFT Building 2 - 3D Model", - "description": "3D Building Model of the HFT Stuttgart created by SketchUp and converted with CityEngine and FME.", - "collectiontype": "3d-container", - "extent": { - "spatial": { - "bbox": [ - [ - 9.1729205436, - 48.7794377214, - -10, - 9.1738475153, - 48.7802408522, - 550 - ] - ], - "crs": "http://www.opengis.net/def/crs/OGC/0/CRS84h" - } - }, - "links": [ - { - "rel": "collections", - "href": "https://steinbeis-3dps.eu/3DGeoVolumes/collections/", - "type": "application/json" - }, - { - "title": "Stuttgart Collections", - "rel": "self", - "href": "https://steinbeis-3dps.eu/3DGeoVolumes/collections/Stuttgart", - "type": "application/json" - }, - { - "title": "HFT Building 2 - 3D Model: i3s", - "rel": "items", - "href": "https://steinbeis-3dps.eu/3DGeoVolumes/collections/Stuttgart/HFTBuilding2_3DModel/i3s", - "type": "application/json+i3s" - }, - { - "title": "HFT Building 2 - 3D Model: 3D Tiles", - "rel": "items", - "href": "https://steinbeis-3dps.eu/3DGeoVolumes/collections/Stuttgart/HFTBuilding2_3DModel/3dtiles", - "type": "application/json+3dtiles" - }, - { - "title": "HFT Building 2 - 3D Model: USDZ", - "rel": "items", - "href": "https://steinbeis-3dps.eu/3DGeoVolumes/collections/Stuttgart/HFTBuilding2_3DModel/usdz", - "type": "application/usdz" - }, - { - "title": "HFT Building 2 - 3D Model: gltf", - "rel": "items", - "href": "https://steinbeis-3dps.eu/3DGeoVolumes/collections/Stuttgart/HFTBuilding2_3DModel/gltf", - "type": "application/gltf" - } - ], - "children": [], - "content": [ - { - "title": "HFT Building 2 - 3D Model: i3s", - "rel": "items", - "href": "https://steinbeis-3dps.eu/3DGeoVolumes/collections/Stuttgart/HFTBuilding2_3DModel/i3s", - "type": "application/json+i3s" - }, - { - "title": "HFT Building 2 - 3D Model: 3D Tiles", - "rel": "original", - "href": "https://steinbeis-3dps.eu/3DGeoVolumes/collections/Stuttgart/HFTBuilding2_3DModel/3dtiles", - "type": "application/json+3dtiles" - }, - { - "title": "HFT Building 2 - 3D Model: USDZ", - "rel": "original", - "href": "https://steinbeis-3dps.eu/3DGeoVolumes/collections/Stuttgart/HFTBuilding2_3DModel/usdz", - "type": "application/usdz" - }, - { - "title": "HFT Building 2 - 3D Model: gltf", - "rel": "original", - "href": "https://steinbeis-3dps.eu/3DGeoVolumes/collections/Stuttgart/HFTBuilding2_3DModel/gltf", - "type": "application/gltf" - } - ] - } - ], - "content": [ - { - "title": "Stuttgart 3D Building Model (LoD 1) - Collections", - "rel": "original", - "href": "host_url/collections/Stuttgart_LoD1_OSM_Textures/", - "type": "application/json" - }, - { - "title": "Stuttgart 3D Building Model (LoD 1) : 3D Tiles", - "rel": "original", - "href": "https://steinbeis-3dps.eu/3DGeoVolumes/collections/Stuttgart/Stuttgart_3DBuildings_LoD1/3dtiles/", - "type": "application/json+3dtiles" - } - ] - } - ] - } \ No newline at end of file diff --git a/3DGeoVolumes/collections/Stuttgart/Stuttgart_LOD2_Stadtmitte/Stuttgart_LOD2_Stadtmitte.json b/3DGeoVolumes/collections/Stuttgart/Stuttgart_LOD2_Stadtmitte/Stuttgart_LOD2_Stadtmitte.json deleted file mode 100644 index 705110f615ae5c740aa330f43ba3b920c8851171..0000000000000000000000000000000000000000 --- a/3DGeoVolumes/collections/Stuttgart/Stuttgart_LOD2_Stadtmitte/Stuttgart_LOD2_Stadtmitte.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "links": [ - { - "rel": "self", - "href": "host_url/collections/Stuttgart/Stuttgart_LOD2_Stadtmitte", - "type": "application/json", - "title": "Stuttgart LOD 2 3D models" - } - ], - "collections": [ - { - "id": "Stuttgart_LOD2_Stadtmitte", - "title": "Stuttgart 3D Models LOD2 Stadtmitte Demo", - "description": "All Supported 3D Containers for the city of Stuttgart 3D Models LOD2 Stadtmitte", - "collectiontype": "3d-container", - "extent": { - "spatial": { - "bbox": [ - [9.161434,48.771841,-10,9.183426,48.786318,550] - ], - "crs": "http://www.opengis.net/def/crs/OGC/0/CRS84h" - } - }, - "links": [ - { - "rel": "collections", - "href": "host_url/collections/", - "type": "application/json" - }, - { - "title": "Stuttgart LOD2 Stadtmitte - Collections", - "rel": "self", - "href": "host_url/collections/Stuttgart/Stuttgart_LOD2_Stadtmitte", - "type": "application/json" - }, - { - "title": "Stuttgart LOD2 Stadtmitte : 3D Tiles", - "rel": "items", - "href": "http://193.196.37.89:8092/AssetsHFT/3DTile_Stuttgart_City_LoD2_InnenStadt_ClampToGround/tileset.json", - "type": "application/json+3dtiles" - } - ], - "children": [ - - ], - "content": [ - { - "title": "Stuttgart LOD2 Stadtmitte - Collections", - "rel": "original", - "href": "host_url/collections/Stuttgart/Stuttgart_LOD2_Stadtmitte", - "type": "application/json" - }, - { - "title": "Stuttgart LOD2 Stadtmitte : 3D Tiles", - "rel": "original", - "href": "http://193.196.37.89:8092/AssetsHFT/3DTile_Stuttgart_City_LoD2_InnenStadt_ClampToGround/tileset.json", - "type": "application/json+3dtiles" - } - ] - } - ] - } \ No newline at end of file diff --git a/3DGeoVolumes/collections/Stuttgart/node.md b/3DGeoVolumes/collections/Stuttgart/node.md new file mode 100644 index 0000000000000000000000000000000000000000..a5d7533ed12ff0f07c1c4bfdc35a0d9a94bc5ea7 --- /dev/null +++ b/3DGeoVolumes/collections/Stuttgart/node.md @@ -0,0 +1 @@ +Note: The 3D contents in Stuttgart collections are hosted on another server. In this case, the HREF link is described in the `collections.json` file \ No newline at end of file diff --git a/server.js b/server.js index 60b4f6480954bf72fdee7969f3f93da7a72450dd..7a98ee42197e87111a5ad2c11c209473ed12b14b 100644 --- a/server.js +++ b/server.js @@ -145,7 +145,27 @@ app.get('/collections/:collectionsId', function (req, res) { try { var collection_json = require(`./3DGeoVolumes/collections/${req.params.collectionsId}/${req.params.collectionsId}.json`) - res.json(collection_json); + var collection_resource = require('./3DGeoVolumes/collections/collections.json') + var collection_resource_updated = replace_server_url(collection_resource) + var selected_collection_byID = [] + for (let index = 0; index < collection_resource_updated.collections.length; index++) { + if (collection_resource_updated.collections[index]["id"] == req.params.collectionsId) { + selected_collection_byID.push(collection_resource_updated.collections[index]) + } + } + var selected_collection = { + "links": [ + { + "rel": "self", + "href": `host_url/collections/${req.params.collectionsId}`, + "type": "application/json", + "title": `OGC API - 3D GeoVolumes collections of ${req.params.collectionsId}` + } + ], + "collections": selected_collection_byID + } + selected_collection = replace_server_url(selected_collection) + res.json(selected_collection); } catch (error) { console.log(error) res.send("internal error")