Google Maps reverse geocoding API can be a thousand miles off
placekit.io
placekit.io
> Out of 1,000,000 tests conducted, we encountered 60 failures, instances where Google Maps and our API diverged on the state or country returned.
That sounds way less dramatic as the headline makes it out to be.
I love that it does that.
https://community.t-mobile.com/troubleshooting-38/nat-forwar...
Other providers mostly rely on WHOIS data and other public databases. These sources are not very accurate and often contain stale data because the IP range geolocation reporting mechanism for ISPs is mainly voluntary.
Sometimes, even though an IP address is pingable and we have evidence of the round trip time, the majority of providers will indicate one location while we indicate another. So, who is correct in this situation? Is it the majority or us?
If someone needs to verify the location of an IP, I usually recommend visiting that site first. If there are any discrepancies, I recommend pinging the IP address and checking the WHOIS records.
https://nominatim.openstreetmap.org/reverse?format=json&lat=...
{ "place_id": 344147672, "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright", "osm_type": "way", "osm_id": 59390991, "lat": "30.304411869782914", "lon": "-93.74218940151427", "class": "place", "type": "house", "place_rank": 30, "importance": 9.999999994736442e-8, "addresstype": "place", "name": "", "display_name": "5289, LA 12, Lunita, Starks, Calcasieu Parish, Louisiana, 70661, United States", "address": { "house_number": "5289", "road": "LA 12", "hamlet": "Lunita", "village": "Starks", "county": "Calcasieu Parish", "state": "Louisiana", "ISO3166-2-lvl4": "US-LA", "postcode": "70661", "country": "United States", "country_code": "us" }, "boundingbox": [ "30.3043619", "30.3044619", "-93.7422394", "-93.7421394" ] }
Per-inch precision? Seems doubtful
Unrelated, I hate how GIS systems built on text search are turning geometry problems which are easy to reason about into unpredictable database problems.
> It appears that the API might be following this process:
> 1. Takes the coordinates and identifies the nearest building + street address.
> 2. Performs a textual best match query across its datasets.
> 3. Returns the first record, mixing up the fields from different locations.
The fact that the first Google autocomplete for the address "3520 S State St" happens to be the State St. in Utah, not Illinois, has absolutely nothing to do with whether the lat/lon coordinates (41.8,-87.6) are in the geographical boundary which describes Illinois and Utah.
Those already exists, but people always want it to be more precise since then you can put them more densely.
yet we have polled this endpoint and have received the place type "supermarket_or_grocery" which is not documented there. Fun!
{ "error_message": "Google has disabled use of the Maps API for this site. Learn more: http://www.google.com/help/terms_maps.html", "results": [], "status": "REQUEST_DENIED" }
The solution we ended up going with was to use the free Tiger shape files from the US Census (https://www.census.gov/geographies/mapping-files/time-series...), which enabled us to statically "lock" our geocordinates. Apart from filing our approach and getting it approved, the logic was that we could always point back to it being a government database if there was ever a problem.
Because my typical first test for geocoding SaaS is to search for Paris and see if they get the continent right.
if you're doing this at scale, geocoded data needs to verified against multiple sources. even then, you'll probably still need a human in the loop to catch edge cases.