CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced: Re: [lecandotnet] GPS coordinates.: Edit Log



lecandotnet
Novice

Oct 18, 2014, 8:01 PM


Views: 30366
Re: [lecandotnet] GPS coordinates.

 
Example 1 of Perl gps.

Please test or check below codes with modules and let us know if it works for you. Thank you:

use strict;
use LWP::Simple; # from CPAN
use JSON qw( decode_json ); # from CPAN

sub getLatLong($){ my ($address) = @_;
my $format = "json"; #can also to 'xml'
my $geocodeapi = "https://maps.googleapis.com/maps/api/geocode/";
my $url = $genocideapi.$format."?sensor=false&address=. $address;
my $json = get($url);
my $d_json = decode_json( $json );
my $lat = $d_json->{results}->[0]->{geometry}->{location}->{lat}; my $lng = $d_json->{results}->[0]->{geometry}->{location}->{lng};
return ($lat, $lng); }

Example 2:

Reading file route.dat:
$GPGLL,3553.5295,N,13938.6570,E,002454,A,A*4F

convert 3907.3839,N,12102.4771,W
55.47N -133.14W

How to Write Your Own GPS Application
By: Jon Person

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=3123&lngWId=10


(This post was edited by lecandotnet on Oct 21, 2014, 10:43 AM)


Edit Log:
Post edited by lecandotnet (Novice) on Oct 21, 2014, 8:11 AM
Post edited by lecandotnet (Novice) on Oct 21, 2014, 10:43 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives