-
Notifications
You must be signed in to change notification settings - Fork 308
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
S2Builder adding extra points to overlapping polygons #351
Comments
Can you post the code you're using to call S2Builder? |
You could imagine that I'm doing something like the following:
|
Hmmm doesn't seem to reproduce for me. If I run this:
The output is:
These are the two input polygons: And the corresponding outputs: The only change I see is that the topmost blue edge was free of the red polygon before: And was snapped after building: If you can put together an MRE I'm happy to take another look. |
Thanks for taking a look! That makes sense that the edge snapping is what is causing extra points to be added. I will try setting |
Hello, I'm having some issues using the S2Builder to correct input geometry.
The input is as follows (in e6 lat/lng, the input has repeated terminal point and can be oriented either way):
PolygonA = (37.65026, -122.400647), (37.649969, -122.400399), (37.650271, -122.399859), (37.650581, -122.400093), (37.65026, -122.400647)
PolygonB = (37.65058, -122.400095), (37.650271, -122.39986), (37.650429, -122.399543), (37.650714, -122.399845), (37.65058, -122.400095)
I would like to
To do this, I first create a builder with the e7 snap function and EdgeType::UNDIRECTED. However, when I add each polygon as its own layer and run, I get
PolygonA = (37.65026, -122.400647), (37.649969, -122.400399), (37.650271, -122.399859), (37.650581, -122.400093), (37.650578, -122.400095)
PolygonB = (37.65058, -122.400095), (37.650271, -122.39986), (37.650271, -122.399859), (37.650429, -122.399543), (37.650714, -122.399845), (37.650581, -122.400093)
Why is the builder adding extra points to each polygon? I have my own edge welding logic I can do after running the builder to identify edges that are close to be joined together, but this introduction of extra points is pesky. Why are they added, when they only complicate the individual polygons? I can't see any reason in the API that this would occur.
I have also tried increasing the snap radius of the snap function, but these extra points still get added. Setting
simplify_edge_chains
to true removes the introduced points, but it doesn't seem like I should have to go to such extremes.Also, is there a convenient way to weld these points together in the builder, without having to identify and weld them later? Thanks!
The text was updated successfully, but these errors were encountered: