Polygon shards (#105)

* Put all of this back in geometry.cpp for conflict resolution

* Stabilize line simplification to behave the same regardless of winding

* Round instead of truncating when clipping lines

* Restore non-Wagyu polygon clipping from prior to 2fdec7d2

* Make it round, not truncate, which reverts the last commit's test diffs

* Clip in floating point, not integers, which makes no difference

* Track nodes added at tile edges during clipping

* Scale geometry up before wagyu to prevent changes from precision loss

* Actually do the shared edge detection

* Fix cases where nodes were not being added at the tile boundary

* One more place I should have rounded

* Narrow down where the discrepancy comes in

* Revert "Narrow down where the discrepancy comes in"

This reverts commit 221c4c5fc0ac9a6567e091c6a94b3d87dc8ade83.

* Another attempt to narrow it down

* The discrepancy seems to be introduced in reordering. No obvious bug

* Was still truncating instead of rounding in projection

* Also makes no difference...

* Just forget that line reversal exists for a minute

* Just reversal no coalescing

* Try clipping in integers instead of floating point

* Don't simplify after coalescing if they said no simplification

* Check whether behavior is consistent with intentional simplification

* Replace more floating point with integer

* Are these three features enough to demonstrate the problem?

* Add a few more nearby borders

* All the features that touch tile 6/16/23

* Stay in integers in line simplification

* More attempts to solve failures to simplify consistently

* Fix most of the overflow errors

* Fix known cases of integer overflow

* All the tests change again

* Pull clipping and scaling code back out into clip.cpp

* Resolve the test conflicts

* Stabilize choice of which three points to keep with different windings

* Almost right, I think!

* Fix collapse of islands to shards

* Self-intersections in the same feature don't count

* Revert "Self-intersections in the same feature don't count"

This reverts commit e04b19916e.

* Don't scale down geometry if we are going to look for shared nodes

* Fix the missing multiply that was keeping simplification from happening

* Fix one more opportunity for overflow

* Somehow I deleted this test?

* Lost this test too

* Clean up debugging printfs

* Restore code sequence from main to make it reviewable

* Remove unneeded rounding

* Update documentation

* This test is no longer useful

* Back to floating point Douglas-Peucker to fix undersimplification

* Try an older ubuntu

* Revert "Try an older ubuntu"

This reverts commit 13fefacfd7.

* Log OS info

* Remove tests that are no longer needed

* Oops, did need that one after all

* Fix the arm vs x86 discrepancy?

* Try another quantization

* Cleanup from review

* Add a test for the actual purpose of this PR
This commit is contained in:
Erica Fischer
2023-09-14 16:51:38 -07:00
committed by GitHub
parent dee40802fd
commit 390771f855
113 changed files with 25649 additions and 23189 deletions
+8 -8
View File
@@ -533,7 +533,7 @@
,
{ "type": "Feature", "properties": { "name": "Douglass St & 24th St" }, "geometry": { "type": "Point", "coordinates": [ -122.438529, 37.751121 ] } }
,
{ "type": "Feature", "properties": { "name": "Castro St & 24th St" }, "geometry": { "type": "Point", "coordinates": [ -122.434173, 37.751257 ] } }
{ "type": "Feature", "properties": { "name": "Castro St & 24th St" }, "geometry": { "type": "Point", "coordinates": [ -122.434173, 37.751240 ] } }
,
{ "type": "Feature", "properties": { "name": "Diamond St & 26th St" }, "geometry": { "type": "Point", "coordinates": [ -122.435911, 37.747881 ] } }
,
@@ -781,7 +781,7 @@
,
{ "type": "Feature", "properties": { "name": "Mission St & Precita Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.419088, 37.746931 ] } }
,
{ "type": "Feature", "properties": { "name": "24th St & Harrison St" }, "geometry": { "type": "Point", "coordinates": [ -122.411749, 37.752581 ] } }
{ "type": "Feature", "properties": { "name": "24th St & Harrison St" }, "geometry": { "type": "Point", "coordinates": [ -122.411728, 37.752581 ] } }
,
{ "type": "Feature", "properties": { "name": "C. Chavez St&Harrison St" }, "geometry": { "type": "Point", "coordinates": [ -122.411385, 37.748339 ] } }
,
@@ -807,7 +807,7 @@
,
{ "type": "Feature", "properties": { "name": "Bryant St & 24th St" }, "geometry": { "type": "Point", "coordinates": [ -122.409067, 37.753056 ] } }
,
{ "type": "Feature", "properties": { "name": "25th St & Potrero Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.406685, 37.751410 ] } }
{ "type": "Feature", "properties": { "name": "25th St & Potrero Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.406664, 37.751410 ] } }
,
{ "type": "Feature", "properties": { "name": "Bay Shore Blvd & Oakdale Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.405183, 37.742876 ] } }
,
@@ -1447,7 +1447,7 @@
,
{ "type": "Feature", "properties": { "name": "Diamond St & 25th St" }, "geometry": { "type": "Point", "coordinates": [ -122.436211, 37.749654 ] } }
,
{ "type": "Feature", "properties": { "name": "Castro St & 24th St" }, "geometry": { "type": "Point", "coordinates": [ -122.434183, 37.751257 ] } }
{ "type": "Feature", "properties": { "name": "Castro St & 24th St" }, "geometry": { "type": "Point", "coordinates": [ -122.434183, 37.751249 ] } }
,
{ "type": "Feature", "properties": { "name": "Castro St & 25th St" }, "geometry": { "type": "Point", "coordinates": [ -122.434044, 37.749807 ] } }
,
@@ -1951,7 +1951,7 @@
,
{ "type": "Feature", "properties": { "name": "Folsom St & 25th St" }, "geometry": { "type": "Point", "coordinates": [ -122.414045, 37.751003 ] } }
,
{ "type": "Feature", "properties": { "name": "24th St & Harrison St" }, "geometry": { "type": "Point", "coordinates": [ -122.411749, 37.752589 ] } }
{ "type": "Feature", "properties": { "name": "24th St & Harrison St" }, "geometry": { "type": "Point", "coordinates": [ -122.411739, 37.752589 ] } }
,
{ "type": "Feature", "properties": { "name": "Folsom St & Cesar Chavez St" }, "geometry": { "type": "Point", "coordinates": [ -122.413595, 37.748110 ] } }
,
@@ -1973,7 +1973,7 @@
,
{ "type": "Feature", "properties": { "name": "Silver Ave & Mission St" }, "geometry": { "type": "Point", "coordinates": [ -122.431405, 37.728901 ] } }
,
{ "type": "Feature", "properties": { "name": "Trumbull St & Congdon St" }, "geometry": { "type": "Point", "coordinates": [ -122.426244, 37.730844 ] } }
{ "type": "Feature", "properties": { "name": "Trumbull St & Congdon St" }, "geometry": { "type": "Point", "coordinates": [ -122.426244, 37.730836 ] } }
,
{ "type": "Feature", "properties": { "name": "Mission St & Richland Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.424699, 37.735621 ] } }
,
@@ -2015,7 +2015,7 @@
,
{ "type": "Feature", "properties": { "name": "Bryant St & 26th St" }, "geometry": { "type": "Point", "coordinates": [ -122.408906, 37.749688 ] } }
,
{ "type": "Feature", "properties": { "name": "25th St & Potrero Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.406685, 37.751410 ] } }
{ "type": "Feature", "properties": { "name": "25th St & Potrero Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.406675, 37.751410 ] } }
,
{ "type": "Feature", "properties": { "name": "Kansas St & 25th St" }, "geometry": { "type": "Point", "coordinates": [ -122.402222, 37.751885 ] } }
,
@@ -2371,7 +2371,7 @@
,
{ "type": "Feature", "properties": { "name": "Connecticut St & 19th St" }, "geometry": { "type": "Point", "coordinates": [ -122.397330, 37.761148 ] } }
,
{ "type": "Feature", "properties": { "name": "20th St & Missouri St" }, "geometry": { "type": "Point", "coordinates": [ -122.396429, 37.759994 ] } }
{ "type": "Feature", "properties": { "name": "20th St & Missouri St" }, "geometry": { "type": "Point", "coordinates": [ -122.396429, 37.759986 ] } }
,
{ "type": "Feature", "properties": { "name": "Arkansas St & Madera St" }, "geometry": { "type": "Point", "coordinates": [ -122.397888, 37.755974 ] } }
,