@cityjson/cj-mcp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,571 @@
1
+ ## 2\. The different City Objects[](#the-different-city-objects)
2
+
3
+ ![City Objects 1st and 2nd levels](figs/co.svg)
4
+
5
+ > **Note:** There are 2 kinds of City Objects:
6
+
7
+ 1. **1st-level**: City Objects that can "exist by themselves" and cannot have a parent.
8
+
9
+ 2. **2nd-level**: City Objects that need to have a parent to exist.
10
+
11
+
12
+ This is because the schema of CityGML has been flattened. For example, `"BuildingInstallation"` instances cannot be present in a dataset without being `"children"` of a `"Building"`, but a `"Building"` can be present by itself.
13
+
14
+ A City Object (1st or 2nd-level):
15
+
16
+ * **must** have one member with the name `"type"`. The value is one of the possibilities in the figure above (of type string). If an Extension is used, then the type can be any string starting with a `"+"`, as explained in [§ 8 Extensions](#extensions).
17
+
18
+ * **may** have one member with the name `"geometry"`. The value is an array containing 0 or more Geometry Objects. More than one Geometry Object is used to represent several different levels-of-detail (LoDs) for the same object. However, the different Geometry Objects of a given City Object do not have to be of different LoDs.
19
+
20
+ * **may** have one member with the name `"attributes"`. The value is an object where the attributes of the City Object are listed.
21
+
22
+ * **may** have one member with the name `"geographicalExtent"`. The value is an array with 6 float values, which represent the axis-aligned bounding box of the City Object: `[minx, miny, minz, maxx, maxy, maxz]`.
23
+
24
+ * **may** have one member with the name `"children"`. The value is an array of the IDs (of type string) of the City Object’s children. The array references only the City Object’s direct children (2nd-level) but not the grandchildren. For instance, the `"children"` array for the object "id-1" below links to a `"BuildingPart"` ("id-2") but not to the `"BuildingInstallation"` ("id-3") which is a child of the `"BuildingPart"`. A City Object can have different types of City Objects as children, eg a `"Building"` can have both as children `"BuildingPart"` and `"BuildingInstallation"`. The order of the children in the array is not relevant.
25
+
26
+
27
+ Additionally, a 2nd-level City Object:
28
+
29
+ * **must** have one member with the name `"parents"`. The value is an array with the IDs (of type string) of the City Object’s parents. For the City Objects in the CityJSON core module, this array will always be of size 1 (only one parent). New City Objects defined in extensions can have more than one parent.
30
+
31
+
32
+ "CityObjects": {
33
+ "id-1": {
34
+ "type": "Building",
35
+ "geographicalExtent": \[ 84710.1, 446846.0, \-5.3, 84757.1, 446944.0, 40.9 \],
36
+ "attributes": {
37
+ "measuredHeight": 22.3,
38
+ "roofType": "gable",
39
+ "owner": "Elvis Presley"
40
+ },
41
+ "children": \["id-2"\],
42
+ "geometry": \[{...}\]
43
+ },
44
+ "id-2": {
45
+ "type": "BuildingPart",
46
+ "parents": \["id-1"\],
47
+ "children": \["id-3"\],
48
+ ...
49
+ },
50
+ "id-3": {
51
+ "type": "BuildingInstallation",
52
+ "parents": \["id-2"\],
53
+ ...
54
+ },
55
+ "id-4": {
56
+ "type": "LandUse",
57
+ ...
58
+ }
59
+ }
60
+
61
+ An example of a minimal valid City Object is:
62
+
63
+ {
64
+ "type": "Building"
65
+ }
66
+
67
+ The above example is for a `"Building"` City Object, but any 1st-level City Object can be encoded the same way.
68
+
69
+ An example of a minimal 2nd-level valid City Object is:
70
+
71
+ {
72
+ "type": "BuildingPart",
73
+ "parents": \["id-parent"\]
74
+ }
75
+
76
+ The above example is for a `"BuildingPart"`, but any 2nd-level City Object can be encoded this way.
77
+
78
+ ### 2.1. Attributes for all City Objects[](#attributes-for-all-city-objects)
79
+
80
+ The attributes for a given City Object must be stored in the `"attributes"` member and, unlike CityGML, they are not prescribed. Note that any valid JSON value (including an array and/or object) is a valid attribute value.
81
+
82
+ "CityObjects": {
83
+ "id-1": {
84
+ "type": "LandUse",
85
+ "attributes": {
86
+ "function": "Industry and Business",
87
+ "area-parcel": {
88
+ "value": 437,
89
+ "uom": "m2"
90
+ },
91
+ },
92
+ "geometry": \[{...}\]
93
+ },
94
+ "id-2": {
95
+ "type": "WaterBody",
96
+ "attributes": {
97
+ "name": "Lake Black",
98
+ "some-list": \["a", "b", "c"\]
99
+ },
100
+ "geometry": \[{...}\]
101
+ }
102
+ }
103
+
104
+ ### 2.2. Bridge[](#bridge)
105
+
106
+ See the CityGML v3.0.0 [Bridge module](https://docs.ogc.org/is/20-010/20-010.html#toc44) for more details.
107
+
108
+ Six City Objects are related to bridges:
109
+
110
+ * `"Bridge"`
111
+
112
+ * `"BridgePart"`
113
+
114
+ * `"BridgeInstallation"`
115
+
116
+ * `"BridgeConstructiveElement"`
117
+
118
+ * `"BridgeRoom"`
119
+
120
+ * `"BridgeFurniture"`
121
+
122
+
123
+ The geometry of both `"Bridge"` and `"BridgePart"` can only be represented with these Geometry Objects: (1) `"Solid"`, (2) `"CompositeSolid"`, (3) `"MultiSurface"`, (4) `"CompositeSurface"`. The geometry of the four other objects can be represented with any Geometry Object.
124
+
125
+ All the above City Objects, except `"Bridge"`, must have a `"parents"` member. The installations and furniture can have as parent a `"Bridge"`, a `"BridgePart"`, or a `"BridgeRoom"`.
126
+
127
+ A City Object of type `"Bridge"` or `"BridgePart"` may have a member with the name `"address"`, whose value is an array of JSON objects listing one or more addresses of that bridge. The members of an address JSON object are not prescribed, to accommodate the different ways addresses are structured in different countries. If a location is necessary then a member with the name `"location"` can be added to the `"address"` member, and it should contain a `"MultiPoint"` geometry.
128
+
129
+ "CityObjects": {
130
+ "LondonTower": {
131
+ "type": "Bridge",
132
+ "address": \[
133
+ {
134
+ "city": "London",
135
+ "country": "UK"
136
+ }
137
+ \],
138
+ "children": \["Bext1", "Bext2", "Inst-2017-11-14"\],
139
+ "geometry": \[{
140
+ "type": "MultiSurface",
141
+ "lod": "2",
142
+ "boundaries": \[
143
+ \[\[0, 3, 2, 1\]\],
144
+ \[\[4, 5, 6, 7\]\],
145
+ \[\[0, 1, 5, 4\]\],
146
+ \[\[1, 2, 6, 5\]\],
147
+ \[\[2, 3, 7, 6\]\],
148
+ \[\[3, 0, 4, 7\]\]
149
+ \]
150
+ }\]
151
+ }
152
+ }
153
+
154
+ ### 2.3. Building[](#building)
155
+
156
+ See the CityGML v3.0.0 [Building module](https://docs.ogc.org/is/20-010/20-010.html#toc45) for more details.
157
+
158
+ Eight City Objects are related to buildings:
159
+
160
+ * `"Building"`
161
+
162
+ * `"BuildingPart"`
163
+
164
+ * `"BuildingInstallation"`
165
+
166
+ * `"BuildingConstructiveElement"`
167
+
168
+ * `"BuildingFurniture"`
169
+
170
+ * `"BuildingStorey"`
171
+
172
+ * `"BuildingRoom"`
173
+
174
+ * `"BuildingUnit"`
175
+
176
+
177
+ The geometry of `"Building"`, `"BuildingPart"`, `"BuildingStorey"`, `"BuildingRoom"`, and `"BuildingUnit"` can only be represented with these Geometry Objects: (1) `"Solid"`, (2) `"CompositeSolid"`, (3) `"MultiSurface"`, (4) `"CompositeSurface"`. The geometry of `"BuildingInstallation"`, `"BuildingConstructiveElement"`, or `"BuildingFurniture"` objects can be represented with any Geometry Object.
178
+
179
+ All the above City Objects, except `"Building"`, must have a `"parents"` member. The `"BuildingInstallation"`, `"BuildingConstructiveElement"`, `"BuildingFurniture"`, `"BuildingStorey"` can have as parent a `"Building"`, a `"BuildingPart"`, or a `"BuildingRoom"`.
180
+
181
+ A City Object of type `"Building"`, `"BuildingPart"` or `"BuildingUnit"` may have a member with the name `"address"`, whose value is an array of JSON objects listing one or more addresses of that building (an apartment building for instance). The members of an address JSON object are not prescribed, to accommodate the different ways addresses are structured in different countries. If a location is necessary (eg to locate the position of the front door) then a member with the name `"location"` can be added to the `"address"` member, and it should contain a `"MultiPoint"` geometry.
182
+
183
+ "CityObjects": {
184
+ "id-1": {
185
+ "type": "Building",
186
+ "attributes": {
187
+ "roofType": "gabled roof"
188
+ },
189
+ "geographicalExtent": \[ 84710.1, 446846.0, \-5.3, 84757.1, 446944.0, 40.9 \],
190
+ "children": \["id-56", "id-832", "mybalcony"\]
191
+ },
192
+ "id-56": {
193
+ "type": "BuildingPart",
194
+ "parents": \["id-1"\],
195
+ ...
196
+ },
197
+ "mybalcony": {
198
+ "type": "BuildingInstallation",
199
+ "parents": \["id-1"\],
200
+ ...
201
+ }
202
+ ...
203
+ }
204
+
205
+ "myroom": {
206
+ "type": "BuildingRoom",
207
+ "attributes": {
208
+ "usage": "living room"
209
+ },
210
+ "parents": \["id-1"\],
211
+ "geometry": \[{
212
+ "type": "Solid",
213
+ "lod": "2",
214
+ "boundaries": \[
215
+ \[ \[\[0, 3, 2, 1\]\], \[\[4, 5, 6, 7\]\], \[\[0, 1, 5, 4\]\], ... \]
216
+ \]
217
+ }\]
218
+ }
219
+
220
+ {
221
+ "type": "Building",
222
+ "address": \[
223
+ {
224
+ "country": "Canada",
225
+ "locality": "Chibougamau",
226
+ "thoroughfareNumber": "1",
227
+ "thoroughfareName": "rue de la Patate",
228
+ "postcode": "H0H 0H0",
229
+ "location": {
230
+ "type": "MultiPoint",
231
+ "lod": "1",
232
+ "boundaries": \[231\]
233
+ }
234
+ }
235
+ \]
236
+ }
237
+
238
+ ### 2.4. CityFurniture[](#cityfurniture)
239
+
240
+ See the CityGML v3.0.0 [CityFurniture module](https://docs.ogc.org/is/20-010/20-010.html#toc32) for more details.
241
+
242
+ The geometry of a City Object of type `"CityFurniture"` can be represented with any Geometry Object.
243
+
244
+ "mystopsign": {
245
+ "type": "CityFurniture",
246
+ "attributes": {
247
+ "function": "bus stop"
248
+ },
249
+ "geometry": \[{
250
+ "type": "MultiSurface",
251
+ "lod": "2",
252
+ "boundaries": \[
253
+ \[\[0, 3, 2, 1\]\], \[\[4, 5, 6, 7\]\], \[\[0, 1, 5, 4\]\]
254
+ \]
255
+ }\]
256
+ }
257
+
258
+ ### 2.5. CityObjectGroup[](#cityobjectgroup)
259
+
260
+ See the CityGML v3.0.0 [CityObjectGroup module](https://docs.ogc.org/is/20-010/20-010.html#toc33) for more details.
261
+
262
+ The CityGML concept of _groups_, which is used to aggregate City Objects based on certain criteria (think of a neighbourhood in a city for instance), is also adopted in CityJSON. The group is a City Object, and it can contain, if needed, a geometry (the polygon representing the neighbourhood for instance).
263
+
264
+ Since a `"CityObjectGroup"` is also a City Object, it can be part of another group.
265
+
266
+ A City Object of type `"CityObjectGroup"`:
267
+
268
+ * **must** have one member with the name `"children"`. The value is an array of the IDs (of type string) of the City Objects that the group contains. As for other City Objects, the City Objects must have the ID of the group in their `"parents"` member.
269
+
270
+ * **may** have one member with the name `"children_roles"`. The value is an array of strings describing the role of each City Object in the group. This member must be of the same length as that of `"children"`.
271
+
272
+ * **may** have one member with the name `"attributes"`. The value is an object where the attributes of the City Object are listed.
273
+
274
+ * **may** have one member with the name `"geometry"`. The value is an array containing 0 or more Geometry Objects. Notice that since the `"CityObjectGroup"` is a container of different City Objects, the concept of Level of Detail does not apply to it. Nevertheless, the `"lod"` member is still used for enforcing uniformity with all the other geometries.
275
+
276
+
277
+ "CityObjects": {
278
+ "my-neighbourhood": {
279
+ "type": "CityObjectGroup",
280
+ "children": \["building1", "building2", "building3"\]
281
+ }
282
+ }
283
+
284
+ "CityObjects": {
285
+ "my-neighbourhood": {
286
+ "type": "CityObjectGroup",
287
+ "attributes": {
288
+ "location": "Chibougamau Sud"
289
+ },
290
+ "children": \["building1", "building3"\],
291
+ "children\_roles": \["residential building", "voting location"\],
292
+ "geometry": \[{
293
+ "type": "MultiSurface",
294
+ "lod": "2",
295
+ "boundaries": \[ \[\[2, 41, 5, 77\]\] \]
296
+ }\]
297
+ }
298
+ }
299
+
300
+ ### 2.6. GenericCityObject[](#genericcityobject)
301
+
302
+ While the CityGML v3.0.0 [Generics module](https://docs.ogc.org/is/20-010/20-010.html#toc35) has different classes for each [space type](https://docs.ogc.org/is/20-010/20-010.html#toc24), CityJSON has only one class to cover all 3 space types.
303
+
304
+ This object should be used for objects that are not covered explicitly by any of the CityGML classes.
305
+
306
+ The geometry of a City Object of type `"GenericCityObject"` can only be represented with these Geometry Objects: (1) `"MultiPoint"`, (2) `"MultiLineString"`, (3) `"MultiSurface"`, (4) `"CompositeSurface"`, (5) `"Solid"`, or (6) `"CompositeSolid"`.
307
+
308
+ "whatisthat": {
309
+ "type": "GenericCityObject",
310
+ "attributes": {
311
+ "class": "a big bucket of water",
312
+ "usage": "it's not clear"
313
+ },
314
+ "geometry": \[{
315
+ "type": "CompositeSurface",
316
+ "lod": "1",
317
+ "boundaries": \[
318
+ \[\[0, 3, 2, 1\]\], \[\[4, 5, 6, 7\]\], \[\[0, 1, 5, 4\]\]
319
+ \]
320
+ }\]
321
+ }
322
+
323
+ ### 2.7. LandUse[](#landuse)
324
+
325
+ See the CityGML v3.0.0 [LandUse module](https://docs.ogc.org/is/20-010/20-010.html#toc36) for more details.
326
+
327
+ The geometry of a City Object of type `"LandUse"` can only be represented with these Geometry Objects: (1) `"MultiSurface"` or (2) `"CompositeSurface"`.
328
+
329
+ "oneparcel": {
330
+ "type": "LandUse",
331
+ "geometry": \[{
332
+ "type": "MultiSurface",
333
+ "lod": "1",
334
+ "boundaries": \[
335
+ \[\[0, 3, 2, 1\]\], \[\[4, 5, 6, 7\]\], \[\[0, 1, 5, 4\]\]
336
+ \]
337
+ }\]
338
+ }
339
+
340
+ ### 2.8. OtherConstruction[](#otherconstruction)
341
+
342
+ See the CityGML v3.0.0 [Construction module](https://docs.ogc.org/is/20-010/20-010.html#toc43) for more details (OtherConstruction is one class).
343
+
344
+ This is used for constructions that are not buildings, bridges, or tunnels. Examples are:
345
+
346
+ * electricity pylon
347
+
348
+ * fence
349
+
350
+ * permanent water tank
351
+
352
+ * pontoon
353
+
354
+ * railway platform
355
+
356
+ * shed
357
+
358
+ * windmill
359
+
360
+
361
+ The geometry of a City Object of type `"OtherConstruction"` can be represented with any Geometry Object.
362
+
363
+ "mypylon": {
364
+ "type": "OtherConstruction",
365
+ "attributes": {
366
+ "class": "windmill",
367
+ "conditionOfConstruction": "underConstruction"
368
+ },
369
+ "geometry": \[{
370
+ "type": "MultiSurface",
371
+ "lod": "2",
372
+ "boundaries": \[
373
+ \[\[0, 3, 2, 1\]\], \[\[4, 5, 6, 7\]\], \[\[0, 1, 5, 4\]\], ...
374
+ \]
375
+ }\]
376
+ }
377
+
378
+ ### 2.9. PlantCover[](#plantcover)
379
+
380
+ See the CityGML v3.0.0 [Vegetation module](https://docs.ogc.org/is/20-010/20-010.html#toc40) for more details (PlantCover is one class).
381
+
382
+ The geometry of a City Object of type `"PlantCover"` can only be represented with these Geometry Objects: (1) `"Solid"`, (2) `"CompositeSolid"`, (3) `"MultiSolid"`, (4) `"MultiSurface"`, (5) `"CompositeSurface"`.
383
+
384
+ "myplants": {
385
+ "type": "PlantCover",
386
+ "attributes": {
387
+ "averageHeight": 11.05
388
+ },
389
+ "geometry": \[{
390
+ "type": "MultiSolid",
391
+ "lod": "2",
392
+ "boundaries": \[
393
+ \[
394
+ \[ \[\[0, 3, 2, 1\]\], \[\[4, 5, 6, 7\]\], \[\[0, 1, 5, 4\]\], \[\[10, 13, 22, 31\]\] \]
395
+ \],
396
+ \[
397
+ \[ \[\[5, 34, 31, 12\]\], \[\[44, 54, 62, 74\]\], \[\[111, 123, 922, 66\]\] \]
398
+ \]
399
+ \]
400
+ }\]
401
+ }
402
+
403
+ ### 2.10. SolitaryVegetationObject[](#solitaryvegetationobject)
404
+
405
+ See the CityGML v3.0.0 [Vegetation module](https://docs.ogc.org/is/20-010/20-010.html#toc40) for more details (SolitaryVegetationObject is one class).
406
+
407
+ The geometry of a City Object of type `"SolitaryVegetationObject"` can be represented with any Geometry Object.
408
+
409
+ "onebigtree": {
410
+ "type": "SolitaryVegetationObject",
411
+ "attributes": {
412
+ "trunkDiameter": 5.3,
413
+ "crownDiameter": 11.0
414
+ },
415
+ "geometry": \[{
416
+ "type": "MultiPoint",
417
+ "lod": "1",
418
+ "boundaries": \[1\]
419
+ }\]
420
+ }
421
+
422
+ ### 2.11. TINRelief[](#tinrelief)
423
+
424
+ See the CityGML v3.0.0 [Relief module](https://docs.ogc.org/is/20-010/20-010.html#toc38) for more details (TINRelief is one class).
425
+
426
+ The geometry of a City Object of type `"TINRelief"` can only be represented with the Geometry Object `"CompositeSurface"`.
427
+
428
+ CityJSON does not define a specific Geometry Object for a TIN (triangulated irregular network). It is simply a CompositeSurface for which every surface is a triangle (thus a polygon having 3 vertices, and no interior ring).
429
+
430
+ Notice that in practice any `"CompositeSurface"` is allowed for encoding a terrain, and that arbitrary polygons could also be used (not just triangles).
431
+
432
+ "myterrain01": {
433
+ "type": "TINRelief",
434
+ "geographicalExtent": \[ 84710.1, 446846.0, \-5.3, 84757.1, 446944.0, 40.9 \],
435
+ "geometry": \[{
436
+ "type": "CompositeSurface",
437
+ "lod": "1",
438
+ "boundaries": \[
439
+ \[\[0, 3, 2\]\], \[\[4, 5, 6\]\], \[\[1, 2, 6\]\], \[\[2, 3, 7\]\], \[\[3, 0, 4\]\]
440
+ \]
441
+ }\]
442
+ }
443
+
444
+ ### 2.12. Transportation[](#transportation)
445
+
446
+ See the CityGML v3.0.0 [Transportation module](https://docs.ogc.org/is/20-010/20-010.html#toc39) for more details.
447
+
448
+ Four City Objects are related to transportation:
449
+
450
+ * `"Road"`
451
+
452
+ * `"Railway"`
453
+
454
+ * `"Waterway"`
455
+
456
+ * `"TransportSquare"` (to model for instance parking lots and squares)
457
+
458
+
459
+ Observe that the "Section", "Intersection", and "Track" classes from CityGML are omitted because they can be easily specified using specific attributes.
460
+
461
+ "ma\_rue": {
462
+ "type": "Road",
463
+ "attributes": {
464
+ "class": "backwards",
465
+ "clearanceSpace": 2.23,
466
+ "clearanceSpaceUnit": "meter"
467
+ },
468
+ "children": \["sect1", "sect2"\],
469
+ "geometry": \[...\]
470
+ }
471
+ "sect1": {
472
+ "type": "Road",
473
+ "attributes": {
474
+ "class": "section"
475
+ },
476
+ "parents": \["ma\_rue"\],
477
+ "geometry": \[...\],
478
+ }
479
+
480
+ Similarly, the CityGML classes "TrafficArea", "AuxiliaryTrafficArea", "Marking", and "Hole" are implemented as semantic surfaces (see [§ 3.3 Semantics of geometric primitives](#semantics-of-geometric-primitives)). That is, the surface representing a road should be split into sub-surfaces (therefore forming a `"MultiSurface"` or a `"CompositeSurface"`) in which each of the sub-surfaces has semantics.
481
+
482
+ "ma\_rue": {
483
+ "type": "Road",
484
+ "geometry": \[{
485
+ "type": "MultiSurface",
486
+ "lod": "2",
487
+ "boundaries": \[
488
+ \[\[0, 3, 2, 1, 4\]\], \[\[4, 5, 6, 9, 12\]\], \[\[0, 1, 5\]\], \[\[20, 21, 75\]\]
489
+ \],
490
+ "semantics": {
491
+ "surfaces": \[
492
+ {
493
+ "type": "TrafficArea",
494
+ "surfaceMaterial": \["asphalt"\],
495
+ "function": "road"
496
+ },
497
+ {
498
+ "type": "AuxiliaryTrafficArea",
499
+ "function": "green areas"
500
+ },
501
+ {
502
+ "type": "TrafficArea",
503
+ "surfaceMaterial": \["dirt"\],
504
+ "function": "road"
505
+ }
506
+ \],
507
+ "values": \[0, 1, null, 2\]
508
+ }
509
+ }\]
510
+ }
511
+
512
+ ### 2.13. Tunnel[](#tunnel)
513
+
514
+ See the CityGML v3.0.0 [Tunnel module](https://docs.ogc.org/is/20-010/20-010.html#toc46) for more details.
515
+
516
+ Six City Objects are related to tunnels:
517
+
518
+ * `"Tunnel"`
519
+
520
+ * `"TunnelPart"`
521
+
522
+ * `"TunnelInstallation"`
523
+
524
+ * `"TunnelConstructiveElement"`
525
+
526
+ * `"TunnelHollowSpace"`
527
+
528
+ * `"TunnelFurniture"`
529
+
530
+
531
+ The geometry of both `"Tunnel"` and `"TunnelPart"` can only be represented with these Geometry Objects: (1) `"Solid"`, (2) `"CompositeSolid"`, (3) `"MultiSurface"`, (4) `"CompositeSurface"`. The geometry of the other four objects can be represented with any Geometry Object.
532
+
533
+ All the above City Objects, except `"Tunnel"`, must have a `"parents"` member. `"TunnelInstallation"`, `"TunnelConstructiveElement"`, `"TunnelHollowSpace"`, and `"TunnelFurniture"` can have as parents a `"Tunnel"` or a `"TunnelPart"`.
534
+
535
+ "CityObjects": {
536
+ "Lærdalstunnelen": {
537
+ "type": "Tunnel",
538
+ "attributes": {
539
+ "yearOfConstruction": 2000,
540
+ "length": "24.5km"
541
+ },
542
+ "children": \["stoparea1"\],
543
+ "geometry": \[{
544
+ "type": "Solid",
545
+ "lod": "2",
546
+ "boundaries": \[
547
+ \[ \[\[0, 3, 2, 1\]\], \[\[4, 5, 6, 7\]\], \[\[0, 1, 5, 4\]\] \]
548
+ \]
549
+ }\]
550
+ }
551
+ }
552
+
553
+ ### 2.14. WaterBody[](#waterbody)
554
+
555
+ See the CityGML v3.0.0 [WaterBody module](https://docs.ogc.org/is/20-010/20-010.html#toc42) for more details.
556
+
557
+ The geometry of a City Object of type `"WaterBody"` can only be represented with these Geometry Objects: (1) `"MultiLineString"`, (2) `"MultiSurface"`, (3) `"CompositeSurface"`, (4) `"Solid"`, or (5) `"CompositeSolid"`.
558
+
559
+ "mygreatlake": {
560
+ "type": "WaterBody",
561
+ "attributes": {
562
+ "usage": "leisure",
563
+ },
564
+ "geometry": \[{
565
+ "type": "Solid",
566
+ "lod": "2",
567
+ "boundaries": \[
568
+ \[ \[\[0, 3, 2, 1\]\], \[\[4, 5, 6, 7\]\], \[\[0, 1, 5, 4\]\] \]
569
+ \]
570
+ }\]
571
+ }
@@ -0,0 +1,22 @@
1
+ ## 4\. Transform Object[](#transform-object)
2
+
3
+ To reduce the size of a CityJSON object (and thus the size of files) and to ensure that only a fixed number of digits is stored for the coordinates of the geometries, the coordinates of the vertices of the geometries are represented with integer values. We therefore need to store the scale factor and the translation needed to obtain the original coordinates (stored with floats/doubles).
4
+
5
+ In the example below, the `"scale"` member indicates that 3 important digits are kept (thus millimetre level if meters are the units of the CRS). The values of the `"translate"` member usually matches with the minimum values of the axis-aligned bounding box (but does not need to).
6
+
7
+ "transform": {
8
+ "scale": \[0.001, 0.001, 0.001\],
9
+ "translate": \[442464.879, 5482614.692, 310.19\]
10
+ }
11
+
12
+ A CityJSON object must therefore have one member `"transform"`, whose values are 2 mandatory JSON objects, `"scale"` and `"translate"`, both arrays with 3 values.
13
+
14
+ The [scheme of TopoJSON (called quantization)](https://github.com/topojson/topojson-specification/blob/master/README.md#212-transforms) is reused, and here we simply add a third coordinate because our vertices are embedded in 3D space.
15
+
16
+ It should be noticed that only the `"vertices"` at the root of the CityJSON object are affected by the transformation, the vertices for the Geometric templates and textures are not.
17
+
18
+ We can obtain the real coordinates of a given vertex _v_, from the _vi_ values listed in the `"vertices"` member as follows:
19
+
20
+ v\[0\] = (vi\[0\] \* \["transform"\]\["scale"\]\[0\]) + \["transform"\]\["translate"\]\[0\]
21
+ v\[1\] = (vi\[1\] \* \["transform"\]\["scale"\]\[1\]) + \["transform"\]\["translate"\]\[1\]
22
+ v\[2\] = (vi\[2\] \* \["transform"\]\["scale"\]\[2\]) + \["transform"\]\["translate"\]\[2\]