Closed Rufmord closed 3 years ago
Thanks for sharing the test dataset. The NPEs are caused by the ImplicitGeometry
elements of your city furniture objects. They contain a transformationMatrix
and a referencePoint
but lack the most important part: the geometry. In CityGML, the geometry of an ImplicitGeometry
can either be provided by an external model in an external file (using the libraryObject
property) or inline as GML geometry through the relativeGMLGeometry
property. But there is no geometry in your data.
I will fix the NPE. But this will not solve the issue. In CityJSON, you also have to specify the template geometries using the "geometry-templates"
property. So, after fixing the NPE, your city furniture objects will be mapped to CityJSON, but they will also lack a geometry, and even the transformationMatrix
and referencePoint
will get lost in the conversion without a geometry.
I will let you know once the fix is available. But my recommendation is that you fix your data as well.
I fixed the NPE with https://github.com/citygml4j/citygml4j/commit/d852d948f5c7c6395f935d4c6d288601916d8f68.
The master
branch of citygml-tools already contains the fix. So, you can build a new version from master
following this guide. Or use the latest
Docker image from https://hub.docker.com/r/citygml4j/citygml-tools/. The fix will be also contained in the next release.
Summary
Converting a CityGML to CityJSON throws a NullPointerException if streets overlap.
Explanation
I converted the OpenDrive file shown here with rtron into a CityGML without failures. Now I wanted to convert the CityGML into a CityJSON. But there the conversion fails and I get the error described down below. I validated the gml file with the validator (it is valid). I found out with this validator that there are issues. Validation direct link. So I think the failure is the overlapping of the streets, because other files without overlapping are converted properly.
Error
On file data.gml: data.zip