Slide 1

Slide 1 text

CityGML and its two encodings CityGML and CityJSON Hugo Ledoux 2018-09-30 Delft, the Netherlands

Slide 2

Slide 2 text

2 int’l standard (from OGC) for representing and storing 3D city models

Slide 3

Slide 3 text

CityGML: 5 Levels-of-detail 3

Slide 4

Slide 4 text

CityGML: more than just buildings 4

Slide 5

Slide 5 text

3D city modelling and CityGML == semantics 5 more than just visualisation key aspect: semantic modelling

Slide 6

Slide 6 text

Spatio-semantic coherence 6 Semantics Geometry Building BuildingPart BuildingPart Roof Surface … Wall Surface Building Installation Wall Surface Roof Surface Wall Surface … Door Door Window Window MultiSolid Solid Solid Polygon MultiPolygon Polygon … … … Semanti Building Installation Building BuildingPart BuildingPart Buildin BuildingPart Roof Surface Roof Surface Wall Surface … Door D

Slide 7

Slide 7 text

A whole area can be semantically decomposed 7

Slide 8

Slide 8 text

3D formats 8

Slide 9

Slide 9 text

Why is semantics important?

Slide 10

Slide 10 text

Because applications!

Slide 11

Slide 11 text

11 solar potential shadow analysis noise modelling energy estimation bomb detonation wind turbulence pollutant tracking

Slide 12

Slide 12 text

CityGML = standardisation of the data model 12 Appearance Module Generics Module CityGML Core Module Bridge Module Building Module CityFurniture Module LandUse Module Vegetation Module Waterbody Module Relief Module CityObjectGroup Module Transportation Module Tunnel Module NoiseADE EnergieADE Many moreADEs….. Thematic Modules ADEs Kolbe (2012)

Slide 13

Slide 13 text

CityGML = standardisation of the data model 13 ExternalReference - informationSystem: anyURI - externalReference: ExternalObjectReferenceType <> CityModel * * … loD0-4GeometryProperty <> gml::_Geometry loD0-4GeometryProperty <> _Transportation Object <> _Abstract Building <> ReliefFeature <> _WaterBody <> _Vegetation <> _CityObject <> gml::_Feature <> _Site Gröger et al. (2012)

Slide 14

Slide 14 text

14 Data model a GML encoding both are called CityGML !

Slide 15

Slide 15 text

A CityGML (the encoding) file 15 5659800.0 2561800.0 15.9 5662200.0 2564200.0 95.7

Slide 16

Slide 16 text

A CityGML (the encoding) file 16 5659800.0 2561800.0 15.9 5662200.0 2564200.0 95.7 Several samples files at https://www.citygml.org/samplefiles

Slide 17

Slide 17 text

CityGML files are very complex 17 • CityGML files are complex and large • No parsers in JavaScript • Few software packages use CityGML • Many diff ways to do one thing • I personally get each time I get a new file

Slide 18

Slide 18 text

18 Data model a GML encoding 2 encodings

Slide 19

Slide 19 text

CityJSON 19

Slide 20

Slide 20 text

CityJSON 20 Full disclosure we developed it, but we are totally objective about how good it is

Slide 21

Slide 21 text

v0.8 released 21 1. "Building" 2. "BuildingPart" 3. "BuildingInstallation" 4. "Road" 5. "Railway" 6. "TransportSquare" 7. "TINRelief" 8. "WaterBody" 9. "PlantCover" 10. "SolitaryVegetationObject" 11. "LandUse" 12. "CityFurniture" 13. "GenericCityObject" 14. "Bridge" 15. "BridgePart" 16. "BridgeInstallation" 17. "BridgeConstructionElement" 18. "Tunnel" 19. "TunnelPart" 20. “TunnelInstallation” 21. “CityObjectGroup” • all modules mapped $ • software for full conversion CityGML <-> CityJSON • Extensions (ADEs in CityGML world) are possible • software to visualise (azul) and to manipulate (cjio)

Slide 22

Slide 22 text

Same information, but in JSON 22 { "type": “CityJSON", "version": “0.8”, "metadata": { "referenceSystem": "urn:ogc:def:crs:EPSG::7415", }, "CityObjects": { "id-1": { "type": "Building", "attributes": { "measuredHeight": 22.3, "roofType": "gable", "owner": “Elvis Presley" }, "geometry": [ { "type": "MultiSurface", "boundaries": [ [[0, 3, 2, 1]], [[4, 5, 6, 7]], [[0, 1, 5, 4]] ] } ] } }, "vertices": [ [23.1, 2321.2, 11.0], [111.1, 321.1, 12.0], ... ], "appearance": { "materials": [], "textures":[], "vertices-texture": [] } }

Slide 23

Slide 23 text

A CityJSON file 23 version CityJSON { "type": “CityJSON", "version": “0.8”, "metadata": { "referenceSystem": "urn:ogc:def:crs:EPSG::7415", }, "CityObjects": { "id-1": { "type": "Building", "attributes": { "measuredHeight": 22.3, "roofType": "gable", "owner": “Elvis Presley" }, "geometry": [ { "type": "MultiSurface", "boundaries": [ [[0, 3, 2, 1]], [[4, 5, 6, 7]], [[0, 1, 5, 4]] ] } ] } }, "vertices": [ [23.1, 2321.2, 11.0], [111.1, 321.1, 12.0], ... ], "appearance": { "materials": [], "textures":[], "vertices-texture": [] } }

Slide 24

Slide 24 text

A CityJSON file 24 metadata, ISO19115 “compliant” CityGML has no mechanism in v2.0 but we thought it’s important ALL geometries have the same CRS, unlike CityGML { "type": “CityJSON", "version": “0.8”, "metadata": { "referenceSystem": "urn:ogc:def:crs:EPSG::7415", }, "CityObjects": { "id-1": { "type": "Building", "attributes": { "measuredHeight": 22.3, "roofType": "gable", "owner": “Elvis Presley" }, "geometry": [ { "type": "MultiSurface", "boundaries": [ [[0, 3, 2, 1]], [[4, 5, 6, 7]], [[0, 1, 5, 4]] ] } ] } }, "vertices": [ [23.1, 2321.2, 11.0], [111.1, 321.1, 12.0], ... ], "appearance": { "materials": [], "textures":[], "vertices-texture": [] } }

Slide 25

Slide 25 text

A CityJSON file 25 All City Objects listed here, indexed by their ID Each have geometries + attributes { "type": “CityJSON", "version": “0.8”, "metadata": { "referenceSystem": "urn:ogc:def:crs:EPSG::7415", }, "CityObjects": { "id-1": { "type": "Building", "attributes": { "measuredHeight": 22.3, "roofType": "gable", "owner": “Elvis Presley" }, "geometry": [ { "type": "MultiSurface", "boundaries": [ [[0, 3, 2, 1]], [[4, 5, 6, 7]], [[0, 1, 5, 4]] ] } ] } }, "vertices": [ [23.1, 2321.2, 11.0], [111.1, 321.1, 12.0], ... ], "appearance": { "materials": [], "textures":[], "vertices-texture": [] } }

Slide 26

Slide 26 text

A CityJSON file 26 Geometry is ID of the vertex, global list compression + more “topology” { "type": “CityJSON", "version": “0.8”, "metadata": { "referenceSystem": "urn:ogc:def:crs:EPSG::7415", }, "CityObjects": { "id-1": { "type": "Building", "attributes": { "measuredHeight": 22.3, "roofType": "gable", "owner": “Elvis Presley" }, "geometry": [ { "type": "MultiSurface", "boundaries": [ [[0, 3, 2, 1]], [[4, 5, 6, 7]], [[0, 1, 5, 4]] ] } ] } }, "vertices": [ [23.1, 2321.2, 11.0], [111.1, 321.1, 12.0], ... ], "appearance": { "materials": [], "textures":[], "vertices-texture": [] } }

Slide 27

Slide 27 text

A CityJSON file 27 material + texture possible { "type": “CityJSON", "version": “0.8”, "metadata": { "referenceSystem": "urn:ogc:def:crs:EPSG::7415", }, "CityObjects": { "id-1": { "type": "Building", "attributes": { "measuredHeight": 22.3, "roofType": "gable", "owner": “Elvis Presley" }, "geometry": [ { "type": "MultiSurface", "boundaries": [ [[0, 3, 2, 1]], [[4, 5, 6, 7]], [[0, 1, 5, 4]] ] } ] } }, "vertices": [ [23.1, 2321.2, 11.0], [111.1, 321.1, 12.0], ... ], "appearance": { "materials": [], "textures":[], "vertices-texture": [] } }

Slide 28

Slide 28 text

Semantics surfaces, with attributes 28 “geometry": [ { "type": "Solid", “lod": 2.2, "boundaries": [ [ [[0, 3, 2, 1]], [[4, 5, 6, 7]], [[0, 1, 5, 4]], [[1, 2, 6, 5]], [[2, 3, 7, 6]], [[3, 0, 4, 7]] ] ], "semantics": { "surfaces" : [ { "type": "RoofSurface", "slope": 33.4 }, { "type": "RoofSurface", "slope": 66.6 }, { "type": "WallSurface", "paint": "blue" } ], "values": [ [0, 1, null, 2, 2, 2] ] } ]

Slide 29

Slide 29 text

BuildingParts: links between City Objects 29 "CityObjects": { "id-1": { "type": "Building", "attributes": { "roofType": "gable" }, "children": ["id-56", “id-832”, “mybalcony”] }, "id-56": { "type": “BuildingPart", "parent": “id-1", ... }, "mybalcony": { "type": "BuildingInstallation", "parent": “id-1”, ... } }

Slide 30

Slide 30 text

BuildingParts: links between City Objects 30 "CityObjects": { "id-1": { "type": "Building", "attributes": { "roofType": "gable" }, "children": ["id-56", “id-832”, “mybalcony”] }, "id-56": { "type": “BuildingPart", "parent": “id-1", ... }, "mybalcony": { "type": "BuildingInstallation", "parent": “id-1”, ... } } goal == a flat schema

Slide 31

Slide 31 text

citygml4j 31 full conversion CityGML <-> CityJSON

Slide 32

Slide 32 text

Compression factor == ~7X 32 Compression (v0.6) file CityGML size (original) CityGML size (w/o spaces) textures? CityJSON CityJSON compressed compression factor CityGML demo "GeoRes" 4.3MB 4.1MB yes 582KB 524KB 8.0 CityGML v2 demo "Railway" 45MB 34MB yes 4.5MB 4.3MB 8.1 Den Haag "tile 01" 23MB 18MB no, material 3.1MB 2.9MB 6.2 Montréal VM05 56MB 42MB yes 5.7MB 5.4MB 7.8 New York LoD2 (DA13) 590MB 574MB no 110MB 105MB 5.5 Rotterdam Delfshaven 16MB 15MB yes 2.8MB 2.6MB 5.4 Vienna 37MB 36MB no 5.6MB 5.3MB 6.8 5

Slide 33

Slide 33 text

(all dev/discussions are open on GitHub) www.cityjson.org

Slide 34

Slide 34 text

azul 34

Slide 35

Slide 35 text

cjio (CityJSON/io) 35

Slide 36

Slide 36 text

pip install cjio 36

Slide 37

Slide 37 text

cjio (CityJSON/io) 37

Slide 38

Slide 38 text

Compression factor == ~7X 38 Compression (v0.6) file CityGML size (original) CityGML size (w/o spaces) textures? CityJSON CityJSON compressed compression factor CityGML demo "GeoRes" 4.3MB 4.1MB yes 582KB 524KB 8.0 CityGML v2 demo "Railway" 45MB 34MB yes 4.5MB 4.3MB 8.1 Den Haag "tile 01" 23MB 18MB no, material 3.1MB 2.9MB 6.2 Montréal VM05 56MB 42MB yes 5.7MB 5.4MB 7.8 New York LoD2 (DA13) 590MB 574MB no 110MB 105MB 5.5 Rotterdam Delfshaven 16MB 15MB yes 2.8MB 2.6MB 5.4 Vienna 37MB 36MB no 5.6MB 5.3MB 6.8 5

Slide 39

Slide 39 text

A snippet of a given CityGML file 39 Forest tree 1 entirelyAboveTerrain 1060 1640 1.0 0.0 0.0 1.11999777602438 0.0 1.0 0.0 6.88000452683357 0.0 0.0 1.0 8.8500288642283 0.0 0.0 0.0 1.0 0.111775082264331 0.12072112251111 0.502222057066866 0.107420882383068 0.120661653965679 0.502222101238315 0.103420882385374 0.118940482732408 0.50222205960968 0.100384031890171 0.115819514600485 0.502222126199463 0.0987726533874718 0.111774040103382 0.502222074955247 0.0988320939989807 0.107419851779835 0.502222054525534 0.100553293837055 0.103419839857094 0.502222036213702 0.103674216513289 0.100382948053549 0.502222094509167 0.107719709663888 0.0987716382157979 0.502221997505005 0.112073909545149 0.0988310413593261 0.502222052999943 0.116073924443975 0.100552277994501 0.502221994962193 0.119110774939178 0.10367318072452 0.502222028038794 0.120722138540746 0.107718655221622 0.502222079283008 0.120662697929237 0.112072843545171 0.502222099712726 0.118941498091162 0.116072855467913 0.502222118024554 0.115820590316061 0.119109747271456 0.502222059729089 0.111775082264331 0.12072112251111 0.502222057066866 0.0161136471915356 0.170479293291229 0.130205976087941 -4.51194637207664E-17 0.130024270847741 0.130205851900683 0.0987726533874718 0.111774040103382 0.502222074955247 0.100384031890171 0.115819514600485 0.502222126199463 0.0161136471915356 0.170479293291229 0.130205976087941 -4.51194637207664E-17 0.130024270847741 0.130205851900683 5.94394939233379E-4 0.086482219725548 0.13020582260217 0.0988320939989807 0.107419851779835 0.502222054525534 0.0987726533874718 0.111774040103382 0.502222074955247 -4.51194637207664E-17 0.130024270847741 0.130205851900683

Slide 40

Slide 40 text

A snippet of a given CityGML file 40 Forest tree 1entirelyAboveTerrain106016401.0 0.0 0.0 1.11999777602438 0.0 1.0 0.0 6.88000452683357 0.0 0.0 1.0 8.8500288642283 0.0 0.0 0.0 1.00.111775082264331 0.12072112251111 0.502222057066866 0.107420882383068 0.120661653965679 0.502222101238315 0.103420882385374 0.118940482732408 0.50222205960968 0.100384031890171 0.115819514600485 0.502222126199463 0.0987726533874718 0.111774040103382 0.502222074955247 0.0988320939989807 0.107419851779835 0.502222054525534 0.100553293837055 0.103419839857094 0.502222036213702 0.103674216513289 0.100382948053549 0.502222094509167 0.107719709663888 0.0987716382157979 0.502221997505005 0.112073909545149 0.0988310413593261 0.502222052999943 0.116073924443975 0.100552277994501 0.502221994962193 0.119110774939178 0.10367318072452 0.502222028038794 0.120722138540746 0.107718655221622 0.502222079283008 0.120662697929237 0.112072843545171 0.502222099712726 0.118941498091162 0.116072855467913 0.502222118024554 0.115820590316061 0.119109747271456 0.502222059729089 0.111775082264331 0.12072112251111 0.5022220570668660.0161136471915356 0.170479293291229 0.130205976087941 -4.51194637207664E-17 0.130024270847741 0.130205851900683 0.0987726533874718 0.111774040103382 0.502222074955247 0.100384031890171 0.115819514600485 0.502222126199463 0.0161136471915356 0.170479293291229 0.130205976087941-4.51194637207664E-17 0.130024270847741 0.130205851900683 5.94394939233379E-4 0.086482219725548 0.13020582260217 0.0988320939989807 0.107419851779835 0.502222054525534 0.0987726533874718 0.111774040103382 0.502222074955247 -4.51194637207664E-17 0.130024270847741 0.130205851900683 I removed all the spaces and CR, which saved 25% in some cases…

Slide 41

Slide 41 text

Compression factor == ~7X 41 Compression (v0.6) file CityGML size (original) CityGML size (w/o spaces) textures? CityJSON CityJSON compressed compression factor CityGML demo "GeoRes" 4.3MB 4.1MB yes 582KB 524KB 8.0 CityGML v2 demo "Railway" 45MB 34MB yes 4.5MB 4.3MB 8.1 Den Haag "tile 01" 23MB 18MB no, material 3.1MB 2.9MB 6.2 Montréal VM05 56MB 42MB yes 5.7MB 5.4MB 7.8 New York LoD2 (DA13) 590MB 574MB no 110MB 105MB 5.5 Rotterdam Delfshaven 16MB 15MB yes 2.8MB 2.6MB 5.4 Vienna 37MB 36MB no 5.6MB 5.3MB 6.8 5 % CityGML v3 will be way more complex, and CityGML file size will increase

Slide 42

Slide 42 text

Extensions (aka as ADEs)

Slide 43

Slide 43 text

CityGML Application Domain Extensions 43 • https://www.citygml.org/ade/ • many designed in UML and with schemas • but almost no software support… • no viewer, no parser—> everything needs to be tailored-made for each

Slide 44

Slide 44 text

CityJSON Extensions 44 • simpler: strict rules for extensions • less flexible than ADEs though • in beta: http://www.cityjson.org/en/latest/ extensions/ • one just defines a new JSON schema and that’s it • all downstream software should work (touch wood…)

Slide 45

Slide 45 text

What issues are left to tackle? 45 1. large files —> tiling/splitting + master file 2. making it more “web-aware”: WFS? 3. developing software, viewers most urgent

Slide 46

Slide 46 text

“Is it not like GeoJSON?” 46 1. 3D types not supported (~MultiPatch) 2. Simple Features used (repetitions of coordinates) 3. can’t mix diff types/classes in one file 4. no hierarchy possible (eg Building having BuildingPart) 5. a feature can have only one geometry

Slide 47

Slide 47 text

We probably borrow more from TopoJSON 47

Slide 48

Slide 48 text

Other City Objects 48 "oneparcel": { "type": "LandUse", "geometry": [{ "type": "MultiSurface", "lod": 1, "boundaries": [ [[0, 3, 2, 1]], [[4, 5, 6, 7]], [[0, 1, 5, 4]] ] }] } 1. "Building" 2. "BuildingPart" 3. "BuildingInstallation" 4. "Road" 5. "Railway" 6. "TransportSquare" 7. "TINRelief" 8. "WaterBody" 9. "PlantCover" 10. "SolitaryVegetationObject" 11. "LandUse" 12. "CityFurniture" 13. "GenericCityObject" 14. "Bridge" 15. "BridgePart" 16. "BridgeInstallation" 17. "BridgeConstructionElement" 18. "Tunnel" 19. "TunnelPart" 20. “TunnelInstallation"

Slide 49

Slide 49 text

JSON Schema: also possible and there’s already one 49 { "$schema": "http://json-schema.org/draft-04/schema#", "title": "CityJSON v0.5", "description": "CityJSON specifications v0.5”, "type": "object", "definitions": { "Building": { "type": "object", "properties": { "type": { "enum": ["Building"] }, "attributes": { "type": "object", "properties": { "creationDate" : {"type": "string"}, "terminationDate" : {"type": "string"}, "class": {"type": "string"}, "function": {"type": "string"}, "usage": {"type": "string"}, … "Solid": { "type": "object", "properties": { "type": { "enum": ["Solid"] }, "boundaries": { "type": "array", "items": { "type": "array", "items": { "type": "array", "items": { "type": "array", "items": {"type": "integer"}

Slide 50

Slide 50 text

JSON Schema: also possible and there’s already one 50 { "$schema": "http://json-schema.org/draft-04/schema#", "title": "CityJSON v0.5", "description": "CityJSON specifications v0.5”, "type": "object", "definitions": { "Building": { "type": "object", "properties": { "type": { "enum": ["Building"] }, "attributes": { "type": "object", "properties": { "creationDate" : {"type": "string"}, "terminationDate" : {"type": "string"}, "class": {"type": "string"}, "function": {"type": "string"}, "usage": {"type": "string"}, … "Solid": { "type": "object", "properties": { "type": { "enum": ["Solid"] }, "boundaries": { "type": "array", "items": { "type": "array", "items": { "type": "array", "items": { "type": "array", "items": {"type": "integer"}