Live data from Hacker News

Reverse geocoding is hard

shkspr.mobi

41–50 of 139 posts

Re: Reverse geocoding is hard

#41
post #15

It'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.

If you know of an API which does navigation distance to POI, I'd love to hear about it!

Google has Routes API: https://developers.google.com/maps/documentation/routes

Re: Reverse geocoding is hard

#42
post #29

Fun 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.

Can this be solved by storing a timestamp of the record along with precise GPS coordinates? Could we then utilize some database to compute the drift from then and now?

Yes, in fact it should essentially be mandatory because the spatial reference system for GPS is not fixed to a point on Earth. This has become a major issue for old geospatial data sets in the US where no one remembered to record when the coordinates were collected.

To correct for these cases you need to be able to separately attribute drift vectors due to the spatial reference system, plate tectonics, and other geophysical phenomena. Without a timestamp that allows you to precisely subtract out the spatial reference system drift vector, the magnitude of the uncertainty is quite large.

Re: Reverse geocoding is hard

#43
post #19

Earlier quoted context omitted.

In the past year or so I have thought a lot about how to design tables and columns within databases and there is nearly nothing that wouldn't get more robust by adding in a "valid_from" and "valid_till" and make it accept multiple values. Someone's name is Foo ? What if they change it to Bar at some point and you need to access something from before with the old name? If you have only a name field that has a single v…

If you have an "audit" table, where you write a copy of the data before updating it in the primary table, that's a decision you can make at any point. Of course, you don't get that historical data, but you do get it going forward from there.

something like https://www.pgaudit.org/ ?

Basically you keep an history of all changes so you can always roll-back / get that data if needed?

Re: Reverse geocoding is hard

#44
post #15

It'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.

If you know of an API which does navigation distance to POI, I'd love to hear about it!

Check out Graphopper. But if your POIs are from OSM, OSRM might be okay as well.

Re: Reverse geocoding is hard

#45

Fun 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.

My knowledge of geospatial sets is fairly shallow, but I’ve worked a bit with Australian map data and I’m assuming are you referring to the different CRSs, GDA2020 and GDA1994?

I’d imagine older coordinates would work with the earlier CRS?

But I can understand not all coordinates specify their CRS. This have really been an issue for me personally, but I’ve mostly worked with NSW spatial and the Australian Bureau of statistics geodata.

Re: Reverse geocoding is hard

#46

Not my area of expertise, but is this not a form of perfectionist problem? I mean, most places have a clear and simple address. For the rest, either a human can solve it, or we can make a few examples and let an AI do the work. We can go back to them later and revise them if we need to. Addresses don't change often, so I think things can stay the same for a long time. Except for emergency dispatch and a few high-prof…

I was going to take this tack.

80% of the problem is just transforming floating point coordinates into API calls.

Getting to something useful with it is the hard 20%, and it will be a diminishing returns problem after that.

While not anybody's LLM proponent, that last mile might be a good AI application.

Re: Reverse geocoding is hard

#47

Fun 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.

Even accounting for tectonic drift, there is a concept of positioning reproducibility that is separate from precision. In general the precision of the measurements is much higher than the reproducibility of the same measurements. That is, you may be able to measure a fixed point on the Earth using an instrument with 1cm precision at a specific point in time but if you measure that same point every hour for a year with the same instrument, the disagreement across measurements will often be >10cm (sometimes much greater), which is much larger than e.g. tectonic drift effects.

For this reason, many people use the reproducibility rather than instrument precision as the noise floor. It doesn’t matter how precise an instrument you use if the “fixed point” you are measuring doesn’t sit still relative to any spatial reference system you care to use.

Re: Reverse geocoding is hard

#48
post #19

Fun 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.

In the past year or so I have thought a lot about how to design tables and columns within databases and there is nearly nothing that wouldn't get more robust by adding in a "valid_from" and "valid_till" and make it accept multiple values. Someone's name is Foo ? What if they change it to Bar at some point and you need to access something from before with the old name? If you have only a name field that has a single v…

See also "Eventual Business Consistency"[0] by Kent Beck. Really good read.

> Double-dated data—we tag each bit of business data with 2 dates:

> * The date on which the data changed out in the real world, the effective date.

> * The date on which the system found out about the change, the posting date.

> Using effective & posting dates together we can record all the strange twists & turns of feeding data into a system.

[0] https://tidyfirst.substack.com/p/eventual-business-consisten...

Re: Reverse geocoding is hard

#49
post #8

Have 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

Geonames is a great dataset, in fact it's one of the "OG" open-source databases of the modern era, dating back to 2005.

It has fairly comprehensive coverage of countries, cities, and major landmarks. It also has stable, simple identifiers that are somewhat of a lingua-franca in the geospatial data world (i.e. Geonames ID 5139572 points to the Statue of Liberty and if you have other data that you need to unambiguously associate with the one Statue of Liberty in New York Harbor, putting a `geonames_id` column in your database with that integer will pretty much solve it, and will allow anyone else you work with to understand the connection clearly too).

However, to be honest, it hasn't really kept pace with modern times. The velocity of changes and updates is pretty low, it doesn't actively grow the community anymore. The data format is simple and rigid and built on old tech that's increasingly hard to work with. You can trust Geonames to have the Statue of Liberty, but not the latest restaurants in NYC.

For a problem like the post author has of finding ways everyday people can easily navigate to something like a park bench that might not have a single address associated with it, or even if it does, needs more granularity to find _that_ specific bench in a park with 100 benches, Geonames probably won't help.

Source: I'm co-founder of Geocode Earth, one of the geocoding companies linked in the blog post. We use Geonames as one source of POI data amongst many others.

Re: Reverse geocoding is hard

#50
post #43

Earlier quoted context omitted.

If you have an "audit" table, where you write a copy of the data before updating it in the primary table, that's a decision you can make at any point. Of course, you don't get that historical data, but you do get it going forward from there.

something like https://www.pgaudit.org/ ? Basically you keep an history of all changes so you can always roll-back / get that data if needed?

The last time we did this, we basically hand-rolled our own, with a database trigger to insert data into a different table whenever an `UPDATE` statement happened.

But this seems like it's probably a better solution.

Post reply on HN