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

feat(geojsontiler): add interior rings support #180

Merged
merged 4 commits into from
Feb 12, 2024

Conversation

ctriquet-cs
Copy link

That PR addresses issue #64 by adding to geojsontiler support for interior rings.

image

Copy link
Contributor

@LorenzoMarnat LorenzoMarnat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, thank you for implementing interior rings support! It's a huge enhancement for GeoJSON support.

I've tested it and it works really well:
Before:

image

After:

image

Just one small modification and we are good

for int_ring in self.feature_geometry["coordinates"][1:]
]

if is_roof:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those 3 lines (36-37-38) need one less tab (or else it is not applicated to multi_geom case). Also, we need to subtract height to interior rings too

            if is_roof:
                for coord in exterior_ring:
                    coord[2] -= self.height

Should be (outside of the above else scope)

        if is_roof:
            for coord in exterior_ring:
                coord[2] -= self.height
            for interior_ring in interior_rings:
                for coord in interior_ring:
                    coord[2] -= self.height

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your feedback. We applied the changes.

@LorenzoMarnat LorenzoMarnat linked an issue Feb 7, 2024 that may be closed by this pull request
Copy link
Contributor

@LorenzoMarnat LorenzoMarnat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thank you!

@LorenzoMarnat LorenzoMarnat merged commit 55ace38 into VCityTeam:master Feb 12, 2024
1 check passed
@ctriquet-cs ctriquet-cs deleted the handle-inner-ring branch July 3, 2024 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[GeojsonTiler] Handle holes in Polygon/Multipolygon features
2 participants