cityjson / specs

Specifications for CityJSON, a JSON-based encoding for 3D city models
https://cityjson.org
Creative Commons Zero v1.0 Universal
108 stars 25 forks source link

Fix the complete but empty example #207

Open balazsdukai opened 1 month ago

balazsdukai commented 1 month ago

The example of a complete but empty CityJSON object was invalid, because the templates and vertices-templates members are mandatory if geometry-templates is defined. Both members are arrays and they can be empty (but need to be present), just as in case of the root vertices member.

hugoledoux commented 1 month ago

Nice catch.

But perhaps the question should be here: should those 2 properties be mandatory? For "appearance" nothing is mandatory...

And let's try to keep main branch the latest published, if we merge we should have a new branch v2.0.2 perhaps?

balazsdukai commented 1 month ago

Hm okay, then I would say make vertices-templates and templates optional so that it is consistent with appearance and metadata, where all members are optional. Even though, we cannot have a valid GeometryInstance without defining geometry-templates.vertices-templates and geometry-templates.templates , but the same is true for textures/materials on the geometries and the appearance property.

balazsdukai commented 1 month ago

I made the two properties of the geometry-templates optional and I reverted to the initial example in the specs.

Additionally, added a sentence that the six main Metadata properties are optional, because it was not explicit I thought.

Could you check again @hugoledoux?

balazsdukai commented 1 month ago

I just realized that we are also bound by compatibility here, because if we make the two fields optional, that's a breaking change, since newly generated files might not have the previously required fields... So I reverted my changes back to the initial fix.