3D Model Viewer π
3D Model Viewer is a tool that loads 3D tiles using cesium. It allows the client to send a request to this tool with model ID's and see the 3D model on the map.
The following guide will help you understand, step by step the best practices of how to work with the Map Colonies 3D Catalog Viewer!
Flow Diagram ββ
Quering 3D CSW catalog service (STEP βπΌ)β
Every request needs a token, see Authentication.
Query 3D CSW catalog service to find an item(s) according to the desired filter.
A good example of a filter request:
POST Request
url:
'<3D_CATALOG_SERVICE_URL>/csw?token=<TOKEN>'
body (XML):
<?xml version="1.0" encoding="UTF-8"?>
<csw:GetRecords outputFormat="application/xml" outputSchema="http://schema.mapcolonies.com/3d" resultType="results" service="CSW" version="2.0.2" startPosition="1" maxRecords="200" xmlns:mc="http://schema.mapcolonies.com/3d" xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:ogc="http://www.opengis.net/ogc">
<csw:Query typeNames="csw:Record">
<csw:ElementSetName>full</csw:ElementSetName>
<csw:Constraint version="1.1.0">
<ogc:Filter>
<ogc:Or>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>mc:classification</ogc:PropertyName>
<ogc:Literal>5</ogc:Literal>
</ogc:PropertyIsEqualTo>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>mc:productType</ogc:PropertyName>
<ogc:Literal>3DPhotoRealistic</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Or>
</ogc:Filter>
</csw:Constraint>
</csw:Query>
</csw:GetRecords>
- Replace
<3D_CATALOG_SERVICE_URL>with 3D CSW catalog URL.
<3D_CATALOG_SERVICE_URL>
- Replace
<TOKEN>with the token you have.
<TOKEN>
Of course, you can also send a regular request with no filter.
A good example is:
POST Request
url:
'<3D_CATALOG_SERVICE_URL>/csw?token=<TOKEN>'
body (XML):
<csw:GetRecords
maxRecords="10"
outputFormat="application/xml"
outputSchema="http://schema.mapcolonies.com/3d"
resultType="results"
service="CSW"
version="2.0.2"
startPosition="1"
xmlns:mc="http://schema.mapcolonies.com/3d"
xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
xmlns:ogc="http://www.opengis.net/ogc">
<csw:Query typeNames="csw:Record">
<csw:ElementSetName>full</csw:ElementSetName>
</csw:Query>
</csw:GetRecords>
You will get GetRecords XML Response with the products metadata.
XML Response
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- pycsw 2.7.dev0 -->
<csw:GetRecordsResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:gml="http://www.opengis.net/gml" xmlns:ows="http://www.opengis.net/ows" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mc="http://schema.mapcolonies.com/3d" version="2.0.2" xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd">
<csw:SearchStatus timestamp="2023-10-15T10:49:46Z"/>
<csw:SearchResults numberOfRecordsMatched="2" numberOfRecordsReturned="2" nextRecord="0" recordSchema="http://schema.mapcolonies.com/3d" elementSet="full">
<mc:MC3DRecord>
<mc:accuracyLE90>8.0</mc:accuracyLE90>
<mc:classification>6</mc:classification>
<mc:creationDateUTC>1970-01-01</mc:creationDateUTC>
<mc:footprint>{"type":"Polygon","coordinates":[[[35.2670012825,32.5856881598],[35.2670012825,32.6300363309],[35.3105702702,32.6300363309],[35.3105702702,32.5856881598],[35.2670012825,32.5856881598]]]}</mc:footprint>
<mc:maxHorizontalAccuracyCE90>8.0</mc:maxHorizontalAccuracyCE90>
<mc:id>53c9e5f6-31d6-47a1-bc11-64e150bcc13b</mc:id>
<mc:insertDate>2023-10-11T18:33:18Z</mc:insertDate>
<mc:links scheme="3DTiles" name="" description="">https://URL-TO-3D-TILE/api/3d/v1/b3dm/model/tileset.json</mc:links>
<mc:producerName>PRODUCER</mc:producerName>
<mc:productBBox>35.2670012825,32.5856881598,35.3105702702,32.6300363309</mc:productBBox>
<mc:productId>53c9e5f6-31d6-47a1-bc11-64e150bcc13b</mc:productId>
<mc:productName>natik-q2</mc:productName>
<mc:productSource>\\domtest\mimi\archi\maz\silver\libot\afula-whole</mc:productSource>
<mc:productStatus>PUBLISHED</mc:productStatus>
<mc:productType>3DPhotoRealistic</mc:productType>
<mc:productSubType>Test subtype</mc:productSubType>
<mc:productVersion>1</mc:productVersion>
<mc:productionSystem>i</mc:productionSystem>
<mc:productionSystemVersion>uy</mc:productionSystemVersion>
<mc:region>kl</mc:region>
<mc:sensors>k</mc:sensors>
<mc:imagingTimeEndUTC>2023-08-20T12:16:00Z</mc:imagingTimeEndUTC>
<mc:imagingTimeBeginUTC>2023-08-11T18:48:00Z</mc:imagingTimeBeginUTC>
<mc:SRS>4326</mc:SRS>
<mc:SRSName>WGS84GEO</mc:SRSName>
<mc:type>RECORD_3D</mc:type>
<mc:updateDateUTC>2023-10-11T18:33:18Z</mc:updateDateUTC>
<ows:BoundingBox crs="urn:x-ogc:def:crs:EPSG:6.11:4326" dimensions="2">
<ows:LowerCorner>32.5856881598 35.2670012825</ows:LowerCorner>
<ows:UpperCorner>32.6300363309 35.3105702702</ows:UpperCorner>
</ows:BoundingBox>
</mc:MC3DRecord>
<mc:MC3DRecord>
<mc:accuracyLE90>999.0</mc:accuracyLE90>
<mc:classification>6</mc:classification>
<mc:creationDateUTC>1970-01-01</mc:creationDateUTC>
<mc:footprint>{"type":"Polygon","coordinates":[[[34.8,31.9],[34.8,31.9],[34.82,31.90],[34.81968953570555,31.91211446418133],[34.8809,31.913]]]}</mc:footprint>
<mc:maxHorizontalAccuracyCE90>999.0</mc:maxHorizontalAccuracyCE90>
<mc:id>e8a7ee77-1f95-4ac7-ad6e-24aae7859be5</mc:id>
<mc:insertDate>2023-10-14T15:05:15Z</mc:insertDate>
<mc:links scheme="3DTiles" name="" description="">https://URL-TO-3D-TILE/api/3d/v1/b3dm/model/tileset.json</mc:links>
<mc:producerName>PRODUCER</mc:producerName>
<mc:productId>e8a7ee77-1f95-4ac7-ad6e-24aa5</mc:productId>
<mc:productName>Χ¨ΧΧΧΧΧͺ</mc:productName>
<mc:productSource>\\domtest\mimi\archi\maz\silver\libot\City</mc:productSource>
<mc:productStatus>PUBLISHED</mc:productStatus>
<mc:productType>3DPhotoRealistic</mc:productType>
<mc:productSubType>Test subtype</mc:productSubType>
<mc:productVersion>1</mc:productVersion>
<mc:productionSystem>123</mc:productionSystem>
<mc:productionSystemVersion>123</mc:productionSystemVersion>
<mc:region>ΧΧ©Χ¨ΧΧ</mc:region>
<mc:sensors>Χ‘Χ Χ‘ΧΧ¨</mc:sensors>
<mc:imagingTimeEndUTC>2023-10-08T12:14:00Z</mc:imagingTimeEndUTC>
<mc:imagingTimeBeginUTC>2023-10-03T11:09:00Z</mc:imagingTimeBeginUTC>
<mc:SRS>4326</mc:SRS>
<mc:SRSName>WGS84GEO</mc:SRSName>
<mc:type>RECORD_3D</mc:type>
<mc:updateDateUTC>2023-10-14T15:05:15Z</mc:updateDateUTC>
<ows:BoundingBox crs="urn:x-ogc:def:crs:EPSG:6.11:4326" dimensions="2">
<ows:LowerCorner>31.908523874681066 34.81539563385809</ows:LowerCorner>
<ows:UpperCorner>31.91211446418133 34.81968953570555</ows:UpperCorner>
</ows:BoundingBox>
</mc:MC3DRecord>
</csw:SearchResults>
</csw:GetRecordsResponse>
Extract the desired attributes of the models (Step βπΌ)β
Within the response, locate the ID attribute of the desired mode, represented as :
<mc:id>MODEL_ID</mc:id>
Additionally, the response contains other valuable attributes for your application.
In the response, you can find other useful attributes that you can use for your application.
You can see here all of the details about the 3D profile.
Useful and recommended attributes to use and display in your UI for the best user experience:β
- product name attributes to display the records property.
- footprint/product_bbox attribute in order to display the footprint of the model.
- imagingTimeBeginUTC attribute to order the 3D models by their footage creation time.
- region attribute to group 3D models from the same region.
Save the ID's of the models you wish to view as you will need them for the next step.