Peter Johnson
Peter Johnson
This [new PR](https://github.com/pelias/spatial/pull/115) seems to do miracles: ``` .rw-r--r--@ 533Mi peter 10 Sep 06:25 -I zcta.spatial.db .rw-r--r--@ 2.1Gi peter 11 Jul 17:13 -I zcta.spatial.shard200.db ```
An example from the USA is this 'town' which contains two localities and is within a county: > Cambridge is a [town](https://en.wikipedia.org/wiki/New_England_town) in [Lamoille County](https://en.wikipedia.org/wiki/Lamoille_County,_Vermont), [Vermont](https://en.wikipedia.org/wiki/Vermont), United States. The population...
Thanks for the report, this is very odd.
DuckDB is so good, check out this oneliner ⚡ ```sql duckdb
Yeah it seems there are a few fields where the lat/lon is 'NA'. Check out this for bonkers.... ⚡ It grabs the file and builds a convex hull grouping by...
Here's the data cleaned up a bit (removed empty geometries, converted linestrings to points): https://gist.github.com/missinglink/03fe0ef1c07adb0428f2628302571595
It's simple enough to remove duplicate vertices (although slightly slow as it's `O(n)`). The issue with removing non-adjacent vertices is that it could invalidate the geometry, such as the case...
https://github.com/missinglink/s2js/blob/04cea2143a2b587674135dd0dab7585b75d8b2de/geojson/loop.ts#L16-L47
The bug isn't present in the C++ codebase because it has an OR condition which hasn't yet been implemented in Go: ```cpp FindValidationErrorNoIndex(error) || s2shapeutil::FindSelfIntersection(index_, error) ``` https://github.com/google/s2geometry/blob/ca1f3416f1b9907b6806f1be228842c9518d96df/src/s2/s2loop.cc#L190-L193
I could port `s2shapeutil::FindSelfIntersection` to Go but I doubt it would be merged, so not worth the effort: https://github.com/google/s2geometry/blob/ca1f3416f1b9907b6806f1be228842c9518d96df/src/s2/s2shapeutil_visit_crossing_edge_pairs.cc#L454