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
+11 -11
View File
@@ -188,7 +188,7 @@
,
{ "type": "Feature", "properties": { "name": "Divisadero St & North Point St" }, "geometry": { "type": "Point", "coordinates": [ -122.443528, 37.802833 ] } }
,
{ "type": "Feature", "properties": { "name": "North Point St & Divisadero St" }, "geometry": { "type": "Point", "coordinates": [ -122.443271, 37.802867 ] } }
{ "type": "Feature", "properties": { "name": "North Point St & Divisadero St" }, "geometry": { "type": "Point", "coordinates": [ -122.443271, 37.802833 ] } }
,
{ "type": "Feature", "properties": { "name": "Divisadero St & Bay St" }, "geometry": { "type": "Point", "coordinates": [ -122.443314, 37.801918 ] } }
,
@@ -1260,7 +1260,7 @@
,
{ "type": "Feature", "properties": { "name": "Quintara St & 35th Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.493095, 37.747949 ] } }
,
{ "type": "Feature", "properties": { "name": "Quintara St & 35th Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.493353, 37.747847 ] } }
{ "type": "Feature", "properties": { "name": "Quintara St & 35th Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.493353, 37.747813 ] } }
,
{ "type": "Feature", "properties": { "name": "Sunset Blvd & Rivera St" }, "geometry": { "type": "Point", "coordinates": [ -122.494812, 37.746082 ] } }
,
@@ -2454,7 +2454,7 @@
,
{ "type": "Feature", "properties": { "name": "Cole St & Haight St" }, "geometry": { "type": "Point", "coordinates": [ -122.450609, 37.769460 ] } }
,
{ "type": "Feature", "properties": { "name": "Haight St & Clayton St" }, "geometry": { "type": "Point", "coordinates": [ -122.448678, 37.769731 ] } }
{ "type": "Feature", "properties": { "name": "Haight St & Clayton St" }, "geometry": { "type": "Point", "coordinates": [ -122.448678, 37.769697 ] } }
,
{ "type": "Feature", "properties": { "name": "Haight St & Clayton St" }, "geometry": { "type": "Point", "coordinates": [ -122.448463, 37.769901 ] } }
,
@@ -3226,7 +3226,7 @@
,
{ "type": "Feature", "properties": { "name": "Garfield St & Beverly St" }, "geometry": { "type": "Point", "coordinates": [ -122.471552, 37.719711 ] } }
,
{ "type": "Feature", "properties": { "name": "Junipero Serra Blvd & Garfield St" }, "geometry": { "type": "Point", "coordinates": [ -122.472281, 37.719575 ] } }
{ "type": "Feature", "properties": { "name": "Junipero Serra Blvd & Garfield St" }, "geometry": { "type": "Point", "coordinates": [ -122.472239, 37.719575 ] } }
,
{ "type": "Feature", "properties": { "name": "Ocean Ave & Cerritos Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.466745, 37.727246 ] } }
,
@@ -3276,7 +3276,7 @@
,
{ "type": "Feature", "properties": { "name": "Plymouth Ave & Mangels Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.457647, 37.732100 ] } }
,
{ "type": "Feature", "properties": { "name": "Monterey Blvd & Faxon Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.459106, 37.730708 ] } }
{ "type": "Feature", "properties": { "name": "Monterey Blvd & Faxon Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.459064, 37.730708 ] } }
,
{ "type": "Feature", "properties": { "name": "Plymouth Ave & Monterey Blvd" }, "geometry": { "type": "Point", "coordinates": [ -122.457519, 37.731116 ] } }
,
@@ -3342,7 +3342,7 @@
,
{ "type": "Feature", "properties": { "name": "Plymouth Ave & Holloway Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.456231, 37.721917 ] } }
,
{ "type": "Feature", "properties": { "name": "Plymouth Ave & Holloway Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.456059, 37.721747 ] } }
{ "type": "Feature", "properties": { "name": "Plymouth Ave & Holloway Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.456017, 37.721747 ] } }
,
{ "type": "Feature", "properties": { "name": "Plymouth Ave & Grafton Ave" }, "geometry": { "type": "Point", "coordinates": [ -122.456231, 37.720118 ] } }
,
@@ -4372,7 +4372,7 @@
,
{ "type": "Feature", "properties": { "name": "Hyde St & Union St" }, "geometry": { "type": "Point", "coordinates": [ -122.419152, 37.799171 ] } }
,
{ "type": "Feature", "properties": { "name": "Union St & Hyde St" }, "geometry": { "type": "Point", "coordinates": [ -122.419152, 37.799137 ] } }
{ "type": "Feature", "properties": { "name": "Union St & Hyde St" }, "geometry": { "type": "Point", "coordinates": [ -122.419152, 37.799103 ] } }
,
{ "type": "Feature", "properties": { "name": "Hyde St & Green St" }, "geometry": { "type": "Point", "coordinates": [ -122.418938, 37.798357 ] } }
,
@@ -5284,7 +5284,7 @@
,
{ "type": "Feature", "properties": { "name": "Avenue H & 5th St" }, "geometry": { "type": "Point", "coordinates": [ -122.367954, 37.822362 ] } }
,
{ "type": "Feature", "properties": { "name": "Avenue H & 4th St" }, "geometry": { "type": "Point", "coordinates": [ -122.367783, 37.821955 ] } }
{ "type": "Feature", "properties": { "name": "Avenue H & 4th St" }, "geometry": { "type": "Point", "coordinates": [ -122.367783, 37.821921 ] } }
,
{ "type": "Feature", "properties": { "name": "Avenue H & California St" }, "geometry": { "type": "Point", "coordinates": [ -122.366409, 37.819955 ] } }
,
@@ -5438,7 +5438,7 @@
,
{ "type": "Feature", "properties": { "name": "Grove St & Laguna St" }, "geometry": { "type": "Point", "coordinates": [ -122.426319, 37.777397 ] } }
,
{ "type": "Feature", "properties": { "name": "Hayes St & Buchanan St" }, "geometry": { "type": "Point", "coordinates": [ -122.428293, 37.776278 ] } }
{ "type": "Feature", "properties": { "name": "Hayes St & Buchanan St" }, "geometry": { "type": "Point", "coordinates": [ -122.428293, 37.776244 ] } }
,
{ "type": "Feature", "properties": { "name": "Hayes St & Buchanan St" }, "geometry": { "type": "Point", "coordinates": [ -122.427564, 37.776244 ] } }
,
@@ -6456,7 +6456,7 @@
,
{ "type": "Feature", "properties": { "name": "Townsend St & 4th St" }, "geometry": { "type": "Point", "coordinates": [ -122.394433, 37.777431 ] } }
,
{ "type": "Feature", "properties": { "name": "4th St & Townsend St" }, "geometry": { "type": "Point", "coordinates": [ -122.395120, 37.777126 ] } }
{ "type": "Feature", "properties": { "name": "4th St & Townsend St" }, "geometry": { "type": "Point", "coordinates": [ -122.395120, 37.777092 ] } }
,
{ "type": "Feature", "properties": { "name": "Townsend St & 4th St" }, "geometry": { "type": "Point", "coordinates": [ -122.394991, 37.777194 ] } }
,
@@ -7184,7 +7184,7 @@
,
{ "type": "Feature", "properties": { "name": "Cesar Chavez St & Harrison St" }, "geometry": { "type": "Point", "coordinates": [ -122.411642, 37.748186 ] } }
,
{ "type": "Feature", "properties": { "name": "C. Chavez St&Harrison St" }, "geometry": { "type": "Point", "coordinates": [ -122.411385, 37.748356 ] } }
{ "type": "Feature", "properties": { "name": "C. Chavez St&Harrison St" }, "geometry": { "type": "Point", "coordinates": [ -122.411385, 37.748322 ] } }
,
{ "type": "Feature", "properties": { "name": "Cesar Chavez St & Alabama St" }, "geometry": { "type": "Point", "coordinates": [ -122.410440, 37.748424 ] } }
,