Closed clausnagel closed 6 years ago
Step 1-2-3 are great, thanks for fixing my error (copy-and-paste...) and for improving the Transportation
Well, I did the changes for step 4 with oXygen, and using its validate functionality did not give me any error. But then I thought that oXygen maybe only performs a JSON syntax check and not a full schema validation (I am using quite an outdated version 16.1...).
So, I just merged the separate CityJSON schemas into one file cityjson-v09beta.json. Afterwards, I copied this into the https://www.jsonschemavalidator.net/ online validator. It does not give errors, and I can successfullly validate CityJSON datasets. It looks good, but please give it another try with your tools.
indeed, it does not give errors.
but: add an error (add "class": 22,
) for instance to the attributes
of a Building, then that error will not be detected (unless I got lost in all my tests..)
I used this simple CityJSON dataset test.json and put "class": 22
into it as suggested. https://www.jsonschemavalidator.net/ reports an error. Well, in fact it reports 60 errors... But here my JSON knowledge ends, so you can better judge whether this makes sense or not.
Mea culpa. It seems that through my tests I concluded wrongly that this doesn't work, but it must have been caused by another error or whatever. Because now indeed it works, I checkout out your branch and tested with your files and others. All good 👍🏽
I don't know about your 60 errors to be honest; I use cjio to validate, which calls python-json-schema. If you use the $ cjio test.json validate --folder_schemas /home/elvis/myschemas/v09/
it is easy to see what works and what not.
So I'll accept the PR, thanks for it!
While going through the v09 beta schemas, I found some issues.
BuildingInstallation
has the same attributes asBuilding
. Since this was not the case in v06 and v08 (and is also not the case in the CityGML data model), I removed these attributes.According to the v08 spec,
TransportSquare
should have the same geometries asRoad
andRailway
(MultiSurface
andCompositeSurface
). But it additionally hasGeometryInstance
, so I removed this one.Since
Road,
Railway,
andTransportSquare
have the same attributes and geometries (after step 2), I added a new abstract type_AbstractTransportationComplex
(which is inline with the CityGML model as well).Abstract types like
_AbstractBuilding
or_AbstractBridge
do not inherit the attributes from_AbstractCityObject.
In constrast, the concrete typeBuilding
then inherits from both_AbstractCityObject
and_AbstractBuilding.
Fixed this so that
_AbstractBuilding
now inherits from_AbstractCityObject,
andBuilding
from_AbstractBuilding.
I think this is important because if someone wants to create a new building type in an extension and if they want to extend from_AbstractBuilding
for this purpose, they now inherit the common attributes from_AbstractCityObject
as well.