Reverse geocoding is hard
11–20 of 139 posts
Re: Reverse geocoding is hard
#12Re: Reverse geocoding is hard
#13Re: Reverse geocoding is hard
#14But that's at least better than when it's some local place name which it's never heard of, and thinks sounds most similar to a place in Afghanistan (this happens all the time).
And to add to it, there are administrative regions, and ecclesiastical regions. Do you put them in the parish, or in the municipality? The birth in the parish and the baptism in the municipality, maybe? How about the burial then...
Re: Reverse geocoding is hard
#15It's a lot more expensive, but measuring navigation distance rather than straight line distance would avoid the "river" issue. Although depending on the routing engine and dataset it might well introduce more issues where points can be really close on foot but the only known route is a driving route.
Re: Reverse geocoding is hard
#16If I were giving directions to another human and not using house addresses I'd say something like "Queen street about half way down the block between Crawford and Shaw"
How would you give directions to something in the middle of a park?
Re: Reverse geocoding is hard
#17Uses OpenStreetmap file, Python and SQLite3.
First it finds all addresses using +/- like a square from lat/lon, then calculate distance based on the smaller list (Pythagoras), and pick the closest. It expands until a set maximum if no address is found in the first search.
Re: Reverse geocoding is hard
#18Have you looked at the geonames database?, https://www.geonames.org/ Info and schema is here, https://download.geonames.org/export/dump/readme.txt Could be a good source. Not sure how good it is worldwide, but the countries I’ve used it for, it’s been useful and pretty good. Try the search too, https://www.geonames.org/search.html?q=R%C3%ADo+grande&count... Not just roads, but there’s rivers, and other things too
Thanks!
Re: Reverse geocoding is hard
#19Fun fact that was dredged up because the author mentions Australia: GPS points change. Their example coordinates give 6 decimal places, accurate to about 10-15cm. Australia a few years back shifted all locations 1.8m because of continental drift they’re moving north at ~7cm/year). So even storing coordinates as a source of truth can be hazardous. We had to move several thousand points for a client when this happened.
If you have only a name field that has a single value that is going to be a crazy workaround. If your names are referencing a person with a date that is much easier. But you need to make that ddcision pretty early.
Re: Reverse geocoding is hard
#20Have you looked at the geonames database?, https://www.geonames.org/ Info and schema is here, https://download.geonames.org/export/dump/readme.txt Could be a good source. Not sure how good it is worldwide, but the countries I’ve used it for, it’s been useful and pretty good. Try the search too, https://www.geonames.org/search.html?q=R%C3%ADo+grande&count... Not just roads, but there’s rivers, and other things too
That does look interesting. I could search through it for a lat & long, but it looks like it only gives a name (e.g. "Silicon Oasis") without a corresponding country. Food for thought though. Thanks!
You can use admin fields, and it’s a recursive query to find.
I have recursive CTE (thanks to ChatGPT).
Could also be done on save, since they shouldn’t change for locations.
The recursiveness though, gives you a benefit if you extract type and save the intermediate steps, it allows you to start grouping things together at different levels which is one of the use cases you mentioned.