0

I have a list of place around 900-1200

I would like to get each of their latitude and longitude in a File like csv or anyother suitable format as i need to push it into a database.

would there be any possible code to do that..any method that would make it simple, as it would be a very tedious task to find info of each place one by one

Rahul Mehrotra
  • 639
  • 5
  • 15
  • 31
  • I didn't ask to do it..just to provide some useful link or resources that can get me started...its not my fault that i am a beginner in such stuffs and that doesn't mean i don't have the right to learn.(Have done a lot of googling and searches before posting here) Plus this question might help someone in future.. – Rahul Mehrotra Mar 19 '13 at 05:08
  • It is not a way to ask questions here.When asking questions you should always present to us what you've tried.Its totally Ok to be beginner.We all are.But the text like you've asked,simply shows a lackadaisical attitude. – Nezam Mar 19 '13 at 05:23
  • I am sorry if you felt like So.. i have tried my best..and still doing it.cause this thing is important for me. – Rahul Mehrotra Mar 19 '13 at 05:26
  • even i ask questions.Just read and try to find the difference: http://stackoverflow.com/questions/15492160/yahoo-authorization-oauthoauth-problem-timestamp-refused – Nezam Mar 19 '13 at 05:35
  • sure..will keep that in mind in future..anyways thanks – Rahul Mehrotra Mar 19 '13 at 05:52

1 Answers1

0

Use Google Geocoding API

It is of the format A Geocoding API request must be of the following form:

http://maps.googleapis.com/maps/api/geocode/output?parameters

where output may be either of the following values:

json (recommended) indicates output in JavaScript Object Notation (JSON) xml indicates output as XML

Eg... 
http://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=true_or_false

For your problem, You can create a Javascript array of places and call this Google Geocoder in a loop and then parse JSON and populate another array with names of places and then push them to DB.

In case you want to parse it in Java use Jackson JSON or Google GSON , both works fine and are popular.

AurA
  • 12,135
  • 7
  • 46
  • 63
  • can you provide me a function or a link where i can see Google Geocoding Api in use.really confused how to do that.. – Rahul Mehrotra Mar 19 '13 at 04:29
  • @RahulMehrotra the very first link, in my answer (Google Geocoding API) https://developers.google.com/maps/documentation/geocoding/ in this link you will find the eg. query and the JSON response, parse it is very easy in Javascript – AurA Mar 19 '13 at 04:31
  • Have never used javascript before..thats the problem – Rahul Mehrotra Mar 19 '13 at 04:34
  • @RahulMehrotra I have updated the answer with parsing it with Java, for other languages visit.. http://www.json.org/ – AurA Mar 19 '13 at 05:05
  • @ AurA thanks a lot for your help..with some small tutorials of javascript i was able to get my work done..thanks – Rahul Mehrotra Mar 19 '13 at 05:51