My question is closely related to Extract geometry from citygml data using citygml4j

I have a citygml file with buildings and I need to extract the coordinates of each roof surface. I use the open source library citygml4j. My code is almost the same as in the link, but I am stuck at the line:

AbstractRing exteriorAbstractRing = polygon.getExterior().getRing();

How do you extract the coordinates of the polygon-geometry from here?

Found the solution with help from @JulianRosse. There are some solution if is a LinearRing, e.g.:


Take a look at the LinearRing class and casting to that. Calling .toList3d() on a LinearRing will return a List of the coordinates. I would use an IDE with code-completion to help with navigating the citygml4j model.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.