5 points · by ColinWright · 13y ago · 17 comments
So for example, given "Lady Lever Art Gallery" it could produce something like "53.35,-3.00" and that would be good enough. Or given something like "Golden Gate Bridge" it could return "37.81,-122.48"
Does anyone here do this? What do you use?
Currently this is for personal use, and would be limited to at most a few requests per week. I can use Google by hand, but if the project takes off then usage would increase, would need to be automated, and I would, of course, be willing to pay for an appropriate service.
Suggestions and comments welcome, especially descriptions of what you currently use, and your experience with it/them.
TIA.
You get 100k free requests per month and then it's $15 per 100k.
Their APIs are licensed under the Creative Commons Attribution 2.0 License.
http://cloudmade.com/products/geocoding
http://developers.cloudmade.com/projects/show/geocoding-http...
Then ...
It appears with CloudMade that to get an API key I have to pretend I'm building an APP, and have to have a web site describing my awesome new product. Then when I try to ask a question, I get all the way through the tedious process of constructing my question in their model of how a customer should behave, only to have to login with a completely different account! Google, Facebook, GetSatisfaction, something, but not the account I just registered with them.
WTF?!?
In the meantime I've factored out and lifted all the GeoCoding from my application and added my own internal "API", so whatever service I end up using, I can switch fairly easily to another when necessary.
- parsed locations from an html file and stored them in a list
- parsed them into this url: 'https://maps.google.com/maps?q=%s' % (location)
-parsed the html for an address
-parsed the address into this url: 'https://maps.google.com/maps/api/geocode/json?address=%s&sen... % (address)
-parse the coordinates
I used it to get oil refineries in the united states and it worked pretty well… i can put it on github if you would like.
It probably can also be done between the front-end and back-end with a little bit of trickery (the calls to google on the front-end, POST'ed html processing on the back from the front-end), so that users ip is using the service and not the servers.
Thanks.
I'm curious, how does your method break? Is it the query string not finding any results to a location, wrong locations, or something else?
'https://maps.google.com/maps?q=%s' % sanitise(location)
and then parsing the result to find the lat/lng. However, this isn't an "official" way of doing it, and the format of the html has changed. The result used to match this: 'viewport_center_lat=([-0-9.]*);var viewport_center_lng=([-0-9.]*)'
but now it looks like this: 'latlng:{lat:([-0-9.]*),lng:([-0-9.]*)}'
Yes, I'm using regexs to parse HTML.However, now that's working again, but I might switch to the explicit two phase process used in https://news.ycombinator.com/item?id=6058751 - or I might directly use the second link mentioned there, instead of calling the URL I currently use.
Does that all make sense?
And you've given me no indication of how to find what you're recommending, apart simply from searching for the text "Nokia here map/geocoding". Is that what I should do to find it?
Added in edit ...
So now I've done that search and found a description. Based on your recommendation I decided to try it, so I clicked on the link on how to get my API credentials, and I got this:
404 Not Found
Code: NoSuchKey
Message: The specified key does not exist.
Key: docs/maps_js/topics/credentials.html
RequestId: 92390AF64837E443
HostId: <omitted>
An Error Occurred While Attempting to Retrieve a Custom Error Document
Code: NoSuchKey
Message: The specified key does not exist.
Key: /error.html
This seems typical - things just don't work.I will try to remember to post more later, but for now here is a basic geocoding example: http://developer.nokia.com/Community/Wiki/HERE_Maps_API_-_Us...
Thanks for the suggestion - I'll return to it later and see if it's been fixed.