a-b-street / country-geocoder

Reverse geocode WGS84 coordinates to an ISO country-code
Apache License 2.0
1 stars 1 forks source link

Some tests in AU have the wrong driving side #1

Open BudgieInWA opened 1 year ago

BudgieInWA commented 1 year ago

The test fremantle_placement gets the wrong driving side, but others get the correct driving side.

Maybe it's because it's close to the coast? Moving inland to the east, the driving side is wrong until about this position: http://127.0.0.1:5173/osm2streets/#18.380621480775794/-32.03855/115.77516

dabreegster commented 1 year ago

https://github.com/a-b-street/osm2streets/blob/0ed585b4f30eb77bd492427e05d70401ff6ce297/streets_reader/src/lib.rs#L71 We should probably pick the center or polylabel of streets.boundary_polygon

It's also maybe possible that the simplified Natural Earth boundaries in https://github.com/a-b-street/osm2lanes/tree/main/driving-side mess up the coast. Maybe we have to get a bit more complex and first find something road-like, then use that for the coordinate lookup

BudgieInWA commented 1 year ago

The simplified geometry is definitely the problem!

Screenshot_20230102-150101_Firefox_Beta~2.png

It looks like a higher precision is needed, at least for land-boundaries. A strictly enclosing simplification would be cool for ocean boundaries if the simplification can be specialised.

dabreegster commented 1 year ago

Hmm, https://github.com/westnordost/countryboundaries uses something from JOSM derived from OSM: https://josm.openstreetmap.de/export/HEAD/josm/trunk/resources/data/boundaries.osm Maybe we could also look into https://github.com/osm-without-borders/cosmogony.