From 5dc5b3d4b0c3654ed32791b90a91c0735866c113 Mon Sep 17 00:00:00 2001 From: Hugo Ledoux Date: Fri, 27 Oct 2023 17:03:35 +0200 Subject: [PATCH] Fix the GenericCityObject extension to stick to v1.1 --- datasets/index.md | 1 - extensions/download/generic.ext.json | 2 +- extensions/download/v20/generic.ext.json | 50 ++++++++++++++++++++++++ extensions/download/v20/potato.ext.json | 45 +++++++++++++++++++++ 4 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 extensions/download/v20/generic.ext.json create mode 100644 extensions/download/v20/potato.ext.json diff --git a/datasets/index.md b/datasets/index.md index 23dbdcdff3..8418191aab 100755 --- a/datasets/index.md +++ b/datasets/index.md @@ -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 }}) diff --git a/extensions/download/generic.ext.json b/extensions/download/generic.ext.json index 40f68e66c6..c1e1a85e16 100644 --- a/extensions/download/generic.ext.json +++ b/extensions/download/generic.ext.json @@ -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": {}, diff --git a/extensions/download/v20/generic.ext.json b/extensions/download/v20/generic.ext.json new file mode 100644 index 0000000000..df6776074b --- /dev/null +++ b/extensions/download/v20/generic.ext.json @@ -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" ] + } + ] + } + } + +} \ No newline at end of file diff --git a/extensions/download/v20/potato.ext.json b/extensions/download/v20/potato.ext.json new file mode 100644 index 0000000000..a63c9d800c --- /dev/null +++ b/extensions/download/v20/potato.ext.json @@ -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" ] + } + ] + } + } + +} \ No newline at end of file