Geocode Area Names of a City to get Lat and Long
Asked Answered
H

2

7

I have a list of areas names in my City and i need the Lat and Long of the same.

Is there any service which i can use the get the Data ?

I dont wanna use any map. I would like to make simple api calls and get the lat long via json or xml.

Herdic answered 27/9, 2010 at 18:8 Comment(0)
C
16

You can use the Google Geocoding service:

REST format: http://code.google.com/apis/maps/documentation/geocoding/index.html

JavaScript: http://code.google.com/apis/maps/documentation/javascript/services.html#Geocoding

EDIT: For those too lazy to read, here's the REST format example..

xml response: http://maps.googleapis.com/maps/api/geocode/xml?address=Bangalore&sensor=false

json response: http://maps.googleapis.com/maps/api/geocode/json?address=Bangalore&sensor=false

Chuckle answered 27/9, 2010 at 18:22 Comment(6)
that requires me to use google maps. isnt there a service which i can do with just a query to its api ?Herdic
@Harsha Define query, define api and define service, because you are querying Google Geocoding service, using their REST or JS api.Twyla
something like Http://website.com/api?place=Bangalore not sure what its called :DHerdic
This is REST and no js required.. read the google doc I provided, its so simple...Chuckle
@Harsha Are you kidding? Did you even open the "REST format" link Mike provided to you? maps.googleapis.com/maps/api/geocode/…Twyla
oops :D i read some place that with google maps. u need to have to map to make the call. thanks a lot. been a bit lazy to read thru i guess.Herdic
P
18

Though the question is already answered I would like to add that google is not the only service which provides geo coding support, few main providers are listed below

Available Solutions for the Address / ZipCode to (latitude, longitude) mapping...

Google API, http://code.google.com/apis/maps/documentation/geocoding/ ) The most popular due to Google’s name. Extensive support available on internet (less development time). Alas! not available freely for non-commercial usage. The free version has 2500 queries/day limitations. ( http://code.google.com/apis/maps/documentation/geocoding/ ) Their is one clause in “Usage Terms” which says the result must be displayed in google maps, reference http://code.google.com/apis/maps/documentation/geocoding/#GeocodingRequests terms and conditions are mentioned here. http://code.google.com/apis/maps/terms.html#section_10_12

Nominatium, (http://wiki.openstreetmap.org/wiki/Nominatim ) A less common organization which provides an open source, free ware solution for the address to (latitude, longitude) mapping. Can be also used in commercial projects. Their are no restrictions for number of queries per day and no hidden clauses in “usage terms”. Since the organization itself is not much popular, very less support is available.

Yahoo API, http://developer.yahoo.com/geo/placefinder/ Another popular API like google’s but some what more available. supports upto 50000 requests per day. Like google extensive support is available. Yahoo encourages us to use the “powered by yahoo logo” but doesn’t force us for that. ( http://info.yahoo.com/legal/us/yahoo/api/api-2140.html ) Can be used for non-commercial purposes (I have read Yahoo Terms and doesnt find any clause which restricts us in doing that, reference http://info.yahoo.com/legal/us/yahoo/maps/mapsapi/mapsapi-2141.html ).

YQL (Yahoo Query language see:- http://developer.yahoo.com/yql/ ) A SQl based query language which queries yahoo web service. for example if we have a zip code “382025” we can write a YQL as [ select centroid from geo.places where text="Enter some pin code here"]. Yahoo encourages us to use YQL in commercial applications. (http://developer.yahoo.com/yql/faq/ ) Most number of allowed queries as compared to all other options. (see http://developer.yahoo.com/yql/faq/ ). Support (?).

Phiphenomenon answered 15/11, 2011 at 12:28 Comment(2)
@HarshaMV if u liked the answer u can +1 it or can accept it as your answer......Phiphenomenon
a reason for the popularity of Google's api is when v search solution in google obviously it is going to give its api first... lolzPhiphenomenon
C
16

You can use the Google Geocoding service:

REST format: http://code.google.com/apis/maps/documentation/geocoding/index.html

JavaScript: http://code.google.com/apis/maps/documentation/javascript/services.html#Geocoding

EDIT: For those too lazy to read, here's the REST format example..

xml response: http://maps.googleapis.com/maps/api/geocode/xml?address=Bangalore&sensor=false

json response: http://maps.googleapis.com/maps/api/geocode/json?address=Bangalore&sensor=false

Chuckle answered 27/9, 2010 at 18:22 Comment(6)
that requires me to use google maps. isnt there a service which i can do with just a query to its api ?Herdic
@Harsha Define query, define api and define service, because you are querying Google Geocoding service, using their REST or JS api.Twyla
something like Http://website.com/api?place=Bangalore not sure what its called :DHerdic
This is REST and no js required.. read the google doc I provided, its so simple...Chuckle
@Harsha Are you kidding? Did you even open the "REST format" link Mike provided to you? maps.googleapis.com/maps/api/geocode/…Twyla
oops :D i read some place that with google maps. u need to have to map to make the call. thanks a lot. been a bit lazy to read thru i guess.Herdic

© 2022 - 2024 — McMap. All rights reserved.