Closed GoogleCodeExporter closed 9 years ago
- Confirmed.
- It's even worse: while lib/geocode.rb refers to
http://code.google.com/apis/maps/documentation/geocoding/, that URL redirects
to https://developers.google.com/maps/documentation/geocoding/?csw=1 now which
lists a completely different query URL:
http://maps.googleapis.com/maps/api/geocode/output?parameters instead of
http://maps.google.com/maps/geo?q=...
- The document says "Note that the Geocoding API v2 has been turned down and is
no longer available." and apparently that's exactly what happened. (When? Is
there an official announcement?)
I admit I have no idea how to fix this (except throwing an error if "-q
location" is used), I have never ever worked with the GMaps API. Checking the
SVN log for geocode.rb, it's a feature that got implemented by helixblue in
2010 and never maintained thereafter.
If someone can come up with a rewrite, I'd be happy to implement it, but I'm
afraid the issue will have to wait until after 3.18.0.
Somewhat inappropriately tagging as InfoNeeded (as there's no matching tag
available)
-S
Original comment by Steve8x8
on 17 Sep 2013 at 7:25
Citing https://developers.google.com/maps/articles/geocodingupgrade:
"Version 2 ("v2") of the Geocoding API was officially deprecated on 8 March
2010 and has now been turned down. As of 9 September 2013 the v2 API will no
longer work."
As if there were no other problems ;)
Actually, there's no mention of an API key in the v3 document anymore but still
a daily access limit: "2,500 requests per day" - but somehow I don't understand
whether this is measured per IP address or whatever.
Apparently, a URL like
http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=205+Ski+Mountain+Road,+Gatlinburg,+TN
_does_ return something useful (JSON parser, anyone?), and asking for "The
house of the rising sun" even returns multiple results. "Milliways" seems to be
unknown to GMaps though ;)
So if someone comes up with a rewritten geocode.rb by Friday, it might get into
3.18.0 - any takers?
Original comment by Steve8x8
on 17 Sep 2013 at 7:45
Oh well. As the leopard can't change its spots, here we go.
Attached is a drop-in for lib/geocode.rb which will return the first match (if
there is any). Could be extended to warn the user about possible ambiguities,
but I guess if you're searching for Paris in Kentucky you'll enter "Paris, KY"
not to end up with the much bigger one in France, right? ;)
Original comment by Steve8x8
on 17 Sep 2013 at 8:53
Attachments:
Re the New API--this IS per IP address, not per app (otherwise there would be
Windows apps using the new API that would commit suicide VERY quickly because
of larger user bases--much less a lot of Android apps :D). So we'll try this
fix and see if it works out.
(If it doesn't, I do know Mapquest is apparently doing unlimited geocoding via
OSM databases, but I'd prefer to stick with GMaps if we can :D)
Original comment by windigo...@gmail.com
on 17 Sep 2013 at 5:48
And the good news is--it's definitely working now. (Even did a test build with
the new library on Windows 7 just to be sure--things DO seem to be behaving
better.)
Original comment by windigo...@gmail.com
on 17 Sep 2013 at 6:10
Thanks for sharing some good news - it looks like we can get this into 3.18.0
by next week. (I have slightly enhanced the code, to return the matching
location and the match count, and will run some more tests.)
Original comment by Steve8x8
on 17 Sep 2013 at 7:05
Test results, with some fictional locations :)
( o ) Performing location search for 205 Ski Mountain Road, Gatlinburg, TN
(constraining to 0.01 miles)
*** No closing HTML tag found (this is OK for Google Maps)
( o ) Google Maps found "205 Ski Mountain Road, Gatlinburg, TN"
( o ) Using result 1 of 1: "205 Ski Mountain Road, Gatlinburg, TN 37738, USA"
( o ) Accuracy level ROOFTOP, will use coordinates 35.7069020, -83.5241280
( o ) No geocaches were found.
( o ) Performing location search for Milliways, End of the universe
(constraining to 0.01 miles)
*** No closing HTML tag found (this is OK for Google Maps)
*** Google Maps failed to determine the location of Milliways, End of the universe
*** Could not determine search type for location "Milliways, End of the universe"
*** You may want to remove special characters or try a "coord" search instead
( o ) Performing location search for Paris (constraining to 0.01 miles)
*** No closing HTML tag found (this is OK for Google Maps)
( o ) Google Maps found "Paris"
( o ) Using result 1 of 5: "Paris, France"
( o ) Accuracy level APPROXIMATE, will use coordinates 48.8566140, 2.3522219
( o ) No geocaches were found.
( o ) Performing location search for Paris, Kentucky (constraining to 0.01
miles)
*** No closing HTML tag found (this is OK for Google Maps)
( o ) Google Maps found "Paris, Kentucky"
( o ) Using result 1 of 1: "Paris, KY 40361, USA"
( o ) Accuracy level APPROXIMATE, will use coordinates 38.2097987, -84.2529869
( o ) No geocaches were found.
( o ) Performing location search for Dark side of the moon (constraining to
0.01 miles)
*** No closing HTML tag found (this is OK for Google Maps)
*** Google Maps failed to determine the location of Dark side of the moon
*** Could not determine search type for location "Dark side of the moon"
*** You may want to remove special characters or try a "coord" search instead
( o ) Performing location search for Nuclear plant Springfield (constraining to
0.01 miles)
*** No closing HTML tag found (this is OK for Google Maps)
( o ) Google Maps found "Nuclear plant Springfield"
( o ) Using result 1 of 4: "Power Plant, Gill, MA 01354, USA"
( o ) Accuracy level APPROXIMATE, will use coordinates 42.6681293, -72.4803948
( o ) No geocaches were found.
Committing to trunk now.
Original comment by Steve8x8
on 18 Sep 2013 at 9:40
committed to trunk
Original comment by Steve8x8
on 19 Sep 2013 at 6:54
Closing.
Original comment by Steve8x8
on 24 Sep 2013 at 10:08
Original issue reported on code.google.com by
windigo...@gmail.com
on 16 Sep 2013 at 7:04