I would like to know if leafletjs has a Geocoding Web Service to get the coordinates of an address similar to the google one:
http://maps.google.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false
LeafletJS itself is a library, not web service, so there is no leaflet geocoding service.
But you can use some other alternatives:
http://wiki.openstreetmap.org/wiki/Nominatim
https://www.mapbox.com/geocoding/
http://dev.here.com/mapsAPI_geocoder/
Related
Geolocation API Removed from Unsecured Origins. Is there any other way to find geoloaction from http server? need some suggestion.
You can use IP geolocation service to translate IP address to city location. It has less accuracy compare to Geolocation API. However, it is less intrusive and can be used on all web browsers.
IP Geolocation is available in database or web service format. Below is example for free service.
(a) Database: IP2Location LITE
(b) Web Service: IPInfoDB
Reference: https://www.geolocation.com
I am specifically using Leaflet Routing Machine plugin and I have been trying to add a geocoding service to the plugin but I have been facing some difficulties. I tried Bing, Google and Nominatim but I'm unable to load any of the geocoding service successfully.
Would anyone be kind enough to help me on this? I hope to add the geocoding service for free. Thank you!
You can look at this tutorial for information on adding a geocoder to Leaflet Routing Machine: http://www.liedman.net/leaflet-routing-machine/tutorials/geocoders/
For most of the geocoders, alternatives are fetched when hitting enter in the input field. The Mapbox geocoder has autocomplete, as mentioned in the tutorial. You can also add autocomplete yourself, depending on which service you use (note that for example Nominatim explicitly forbids using their public servers for autocomplete).
is it possible to request Google Map tiles using something other than Lat/Long?
I'd like to pass the x and y in as web mercator values. I'm not using the Google Maps API and this will be a custom tiled layer where the map object is in web mercator. I can't use the standard Google Maps URL because that only accepts lat/long values, which won't draw properly on my web mercator map.
Thanks for any assistance.
Ed
You can't use the Google Map tiles unless you use the Google Maps API. From the Terms of Use at https://developers.google.com/maps/terms :
10.1.1. General Restrictions.
(a) No Access to Maps API(s) except through the Service. You must not access or use the Maps API(s) or any Content through any technology or means other than those provided in the Service, or through other explicitly authorized means Google may designate. For example, you must not access map tiles or imagery through interfaces or channels (including undocumented Google interfaces) other than the Maps API(s).
I'd like to use the Google geolocation API in my app, written in Python. My problem is that Google provides a JSON interface (easily useable from Python) but from http://code.google.com/p/gears/wiki/GeolocationAPI I see that the API "is published to allow developers to provide their own network location server for use through the Gears API. Google's network location server is only to be used through the Gears API. See section 5.3 of the Gears Terms of Service at [address]."
It is a very strange thing: there is a very cool JSON but I cannot use it. I have to use it through Google Gears instead. But how can I do it from a Python app?
For example, I see that the geolocation service provided by Firefox calls directly the JSON API. Why is FF able to do that?
Thanks,
Alessio Palmero Aprosio
Google has deprecated Gears entirely, as the geolocation feature is now standard in modern browsers (for certain values of "standard").
The pylocation module may provide the information you need. It can output the geolocation data in text, json, or xml.
Does Google offer a RESTful API where I can pass it a city name (or zip) and it returns the longitude & latitude.
I know how to do this with using the Google Maps API, but I really don't want to have my users download the huge 200k Google Maps API solely so that I can geocode a location.
Does anyone know of a URL based (REST) city/zip to longitude & latitude API?
Since geocoding this information then kicks off multiple other processes, doing this first step is of critical importance to have it perform quickly b/c its a bottleneck right now using the Google Maps API b/c of the huge download and JavaScript loadup.
Yahoo PlaceFinder is a new service offered by Yahoo! that provides services for converting addresses (including city names) into latitude / longitude pairs. The service is also capable of doing the opposite (converting coordinates into an address).
Unlike Google's Geocoding API the TOS for Yahoo PlaceFinder do not forbid using the data outside of their maps API.
You could use geonames.org web sevices (or download the server)
http://www.geonames.org/export/reverse-geocoding.html
Also keep in mind that you will likely run over your quotas for the day if you have heavy traffic using the direct HTTP call method. Google limits usage based on IP address, so using the client side code will greatly increase the number of geocode lookups you can do per day since they'll be associated with user's computers rather than your server(s).
$.get("http://ipinfo.io", function(response) {
console.log(response.city, response.country);
}, "jsonp");
Here's a more detailed JSFiddle example that also prints out the full response information, so you can see all of the available details: http://jsfiddle.net/zK5FN/2/