Skip to content

Commit

Permalink
Fix the GenericCityObject extension to stick to v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoledoux committed Oct 27, 2023
1 parent a1db26f commit 5dc5b3d
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 2 deletions.
1 change: 0 additions & 1 deletion datasets/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ Here are 2 files with [Geometry templates](https://www.cityjson.org/specs/#geome

## With Extensions

- [cube.city.json](https://3d.bk.tudelft.nl/opendata/cityjson/simplegeom/v2.0/cube.city.json) -- a unit cube of type `"+GenericCityObject"`, which is defined in the Generic Extension ([see its schema](https://www.cityjson.org/extensions/download/generic.ext.json))
- [noise_data.city.json](../tutorials/files/noise_data.city.json) is a demo file with the Noise extension (schema [noise.ext.json](../tutorials/files/noise.ext.json)), more details in [this tutorial]({{ '/tutorials/extension/' | prepend: site.baseurl }})


Expand Down
2 changes: 1 addition & 1 deletion extensions/download/generic.ext.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "Generic",
"uri": "https://www.cityjson.org/extensions/download/generic.ext.json",
"version": "1.0.1",
"versionCityJSON": "2.0",
"versionCityJSON": "1.1",
"description": "Extension to handle GenericCityObject; meant as a template to learn how to construct an Extension",

"extraRootProperties": {},
Expand Down
50 changes: 50 additions & 0 deletions extensions/download/v20/generic.ext.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"type": "CityJSONExtension",
"name": "Generic",
"uri": "https://www.cityjson.org/extensions/download/generic.ext.json",
"version": "1.0.1",
"versionCityJSON": "2.0",
"description": "Extension to handle GenericCityObject; meant as a template to learn how to construct an Extension",

"extraRootProperties": {},

"extraAttributes": {},

"extraSemanticSurfaces": {},

"extraCityObjects": {
"+GenericCityObject": {
"allOf": [
{ "$ref": "cityobjects.schema.json#/_AbstractCityObject" },
{
"properties": {
"type": { "enum": [ "+GenericCityObject" ] },
"attributes": {
"type": "object",
"properties": {
"my-attribute": { "type": "string" }
}
},
"geometry": {
"type": "array",
"items": {
"oneOf": [
{ "$ref": "geomprimitives.schema.json#/MultiPoint" },
{ "$ref": "geomprimitives.schema.json#/MultiLineString" },
{ "$ref": "geomprimitives.schema.json#/MultiSurface" },
{ "$ref": "geomprimitives.schema.json#/CompositeSurface" },
{ "$ref": "geomprimitives.schema.json#/Solid" },
{ "$ref": "geomprimitives.schema.json#/MultiSolid" },
{ "$ref": "geomprimitives.schema.json#/CompositeSolid" },
{ "$ref": "geomtemplates.schema.json#/GeometryInstance" }
]
}
}
},
"required": [ "type" ]
}
]
}
}

}
45 changes: 45 additions & 0 deletions extensions/download/v20/potato.ext.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"type": "CityJSONExtension",
"name": "Potato",
"uri": "https://www.cityjson.org/extensions/download/potato.ext.json",
"version": "1.0",
"versionCityJSON": "2.0",
"description": "Extension to handle massive potatoes in our cities",

"extraRootProperties": {},

"extraAttributes": {},

"extraSemanticSurfaces": {},

"extraCityObjects": {
"+Potato": {
"allOf": [
{ "$ref": "cityobjects.schema.json#/_AbstractCityObject" },
{
"properties": {
"type": { "enum": [ "+Potato" ] },
"attributes": {
"type": "object",
"properties": {
"my-attribute": { "type": "string" }
}
},
"geometry": {
"type": "array",
"items": {
"oneOf": [
{ "$ref": "geomprimitives.schema.json#/MultiSurface" },
{ "$ref": "geomprimitives.schema.json#/CompositeSurface" },
{ "$ref": "geomprimitives.schema.json#/Solid" }
]
}
}
},
"required": [ "type" ]
}
]
}
}

}

0 comments on commit 5dc5b3d

Please sign in to comment.