Closed FredFronky closed 5 years ago
Hm, looks like Google has been closing down yet another API. GeoToad has been using v3 (XML interface) while https://developers.google.com/maps/documentation/geocoding/ now describes JSON requests. This must have happened some time ago (apparently already in 2018?=)... I didn't notice because geocoding had been rather problematic for me all the time.
There are two places where their API is used: for conversion of "location" to "coordinates" (from the command line) and for conversion of (cache) coordinates to street addresses. Both now appear to require usage of an API key - which must be purchased, and I suppose it would violate the rules to set it free inside an open-source code. You would be free to purchase your own key, and with some code adjustments, GeoToad would be able to read it from a local file and use it, fully under your control. [If you're in a hurry, and prefer the Google way, you may probably hardcode the key into lib/geocode.rb - I'd first suggest to replace the string "sensor=false" in the @@maps_base definition with "key=YOUR_API_KEY") and get along with the XML request; rewriting this to analyze JSON responses should be rather straightforward.]
While this would supposedly solve your issue, I wouldn't be happy with it, and I'd be unable to test the whole thing.
So there must be another solution - I'll look into Nominatim (https://wiki.openstreetmap.org/wiki/Nominatim) which looks promising. GeoToad already caches results, adding a delay of 1 second per request would only slow down HTML output generation (once), this seems feasible. I can see though that there are about a dozen Adelaides around (only some of which are dupes): https://nominatim.openstreetmap.org/search.php?q=Adelaide&polygon_geojson=1&viewbox= - I guess you're not in Washington State nor in Colombia?
Give me a few days to figure out the details.
There's a first shot at the issue in the work-in-progress patch set now. I'll do some more testing (in particular, with special characters in the search string) before committing upstream. Feel free to join me ;)
Just for documentation purposes, there was a similar issue (with an easier (?) fix) in #279.
Please try (using "patch -p1" as usual) the attached diff: 362-geocoder.diff.txt which has been in use for more than a day now (but not for location queries) - it hasn't shown any regressions yet. Torture it...
Caveat: "html" will no longer include reverse address lookups, there's "html-revloc" now - which is heavily penalized by adding a 5-second delay per address query.
The next official release is a few weeks away, but if there are no major issues with the patch I'll commit the changes.
I'm having the same problem.
I'm having the same problem.
Can you try the git head (which contains the fix), or if you cannot, apply the patch to the previous version? It will take a while longer until I'll be able to roll another release.
Fixed in 3.29.1
Hi there, Just trying to download some caches before I go away, and the location finding feature seems to be broken, at least for me. Was able to fix by manually setting coords in
seach.rb
, but this is obviously not ideal. Running withgeotoad.rb --delimiter='|' --distanceMax=10 --output='D:/' --queryType=location Adelaide
, though even inputting coords gives the same error.Sorry for the brief error description, happy to elaborate more when I get back.