Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importer for surfaces with inner rings creates invalid POLYHEDRALSURFACE #282

Closed
hugoledoux opened this issue May 11, 2023 · 2 comments
Closed
Assignees
Labels

Comments

@hugoledoux
Copy link

With the importer v5.3.0, if I import this file (https://gist.github.com/hugoledoux/c982e49294d92390ab491f6751a0d228) (which is a simple cube with a genus=1, the top and bottom surfaces have inner rings, see below), then the POLYHEDRALSURFACE is not valid. While the geometry is valid and the cityjson file too (so not an issue here).

SCR-20230511-gya

Each surface stored in surface_geometry is fine it seems, but the solid_geometry is not. I get that:

SRID=7415;POLYHEDRALSURFACE Z (((0.0 0.0 0.0, 0.0 1.0 0.0, 1.0 1.0 0.0, 1.0 0.0 0.0, 0.0 0.0 0.0)), ((0.2 0.2 0.0, 0.7000000000000001 0.2 0.0, 0.5 0.7000000000000001 0.0, 0.2 0.2 0.0)), ((0.0 0.0 1.0, 1.0 0.0 1.0, 1.0 1.0 1.0, 0.0 1.0 1.0, 0.0 0.0 1.0)), ((0.2 0.2 1.0, 0.5 0.7000000000000001 1.0, 0.7000000000000001 0.2 1.0, 0.2 0.2 1.0)), ((0.0 0.0 0.0, 1.0 0.0 0.0, 1.0 0.0 1.0, 0.0 0.0 1.0, 0.0 0.0 0.0)), ((1.0 0.0 0.0, 1.0 1.0 0.0, 1.0 1.0 1.0, 1.0 0.0 1.0, 1.0 0.0 0.0)), ((1.0 1.0 0.0, 0.0 1.0 0.0, 0.0 1.0 1.0, 1.0 1.0 1.0, 1.0 1.0 0.0)), ((0.0 1.0 0.0, 0.0 0.0 0.0, 0.0 0.0 1.0, 0.0 1.0 1.0, 0.0 1.0 0.0)), ((0.5 0.7000000000000001 0.0, 0.7000000000000001 0.2 0.0, 0.7000000000000001 0.2 1.0, 0.5 0.7000000000000001 1.0, 0.5 0.7000000000000001 0.0), (0.2 0.2 0.0, 0.5 0.7000000000000001 0.0, 0.5 0.7000000000000001 1.0, 0.2 0.2 1.0, 0.2 0.2 0.0), (0.7000000000000001 0.2 0.0, 0.2 0.2 0.0, 0.2 0.2 1.0, 0.7000000000000001 0.2 1.0, 0.7000000000000001 0.2 0.0)))

Notice that the 3 "internal surfaces" of the "hole" are stored in one surface, with one outer ring and 2 inner rings.

@yaozhihang
Copy link
Member

thanks @hugoledoux. I can reproduce the problem. It seems like a bug in the code. We'll fix it asap

private String convertPolygonCollectionToEWKT(GeometryObject geomObj, StringBuilder ewkt) {

@clausnagel
Copy link
Member

Fixed with #284. The fix will be contained in the next release. Build the tool from source if you need a fixed version before the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants