Find the answer to your Linux question:
Results 1 to 5 of 5
hi! I trying to extract via command line the latitude and longitude with this command Code: curl -s 'http://maps.google.com/maps?q=Madrid, Spain' Can anybody help me to use any more command to ...
  1. #1
    Just Joined!
    Join Date
    Oct 2008
    Posts
    48

    Extract latitude and longitude from maps.google

    hi!

    I trying to extract via command line the latitude and longitude with this command

    Code:
    curl -s 'http://maps.google.com/maps?q=Madrid, Spain'
    Can anybody help me to use any more command to parse this result?

    very thanks

  2. #2
    Linux Enthusiast Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    718
    There is a public API to the google maps service. One should not parse the website content, also because it is really slow and bandwidth consuming. The service provides you data that will be easy to parse.

  3. #3
    Just Joined!
    Join Date
    Oct 2008
    Posts
    48
    but i don't have any web page to obtain a public KEY for an API.
    How can I resolve this?

    In my case I have a MySQL with all postal codes, cities and countries.
    My idea is to start a script to collect all information and insert all longitudes and latitudes.

  4. #4
    RDU
    RDU is offline
    Just Joined!
    Join Date
    Aug 2010
    Posts
    89
    You can find this easily with google search !!. Here is it : Sign Up for the Google Maps API - Google Maps API Family - Google Code

    It's a huge job to scan all cities in the world !! And probably lot of them will never be used. Try to query the API when you need one instead of storing lot of stuff !

  5. #5
    Just Joined!
    Join Date
    Oct 2008
    Posts
    48
    ok thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...