Google Map Longitute and Latitude!

Discussion in 'Google API' started by nickharper, Oct 17, 2007.

  1. #1
    Hi,

    I just wondered which ways people use to get the L & L of places when they use Google Maps?

    I have tried with the postcode but it is slightly off so it will need to move over to the right?

    Thanks

    Nick
     
    nickharper, Oct 17, 2007 IP
  2. lv211

    lv211 Peon

    Messages:
    168
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    http://geocoder.us/

    I use this perl code. The regular expression strips the excess crap it would normally return. Or you can use Google's geocoder service http://www.developer.com/lang/jscript/article.php/3615681 .

    Peace.

    #!/usr/bin/perl
    
    use LWP::Simple;
    use URI::Escape;
    use Data::Dumper;
    use strict;
    use warnings;
    
    my $where =  "5700 Occidental Road, Santa Rosa, CA 95401";
    
    my $addr = uri_escape($where);
    
    my @result = get("http://rpc.geocoder.us/service/csv?address=$addr" );
    my $loc;
    
    foreach (@result){
    	if ($_ =~ m{(.*?),(.*?),}){
            $loc = "$1" . "," . " $2";
            print $loc;
            }
            else {
            print "Not working";
            }
    }
    Code (markup):
     
    lv211, Oct 19, 2007 IP