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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Advanced:
GPS coordinates.



Oct 18, 2014, 8:18 AM

Post #1 of 5 (29649 views)
GPS coordinates. Can't Post


Please show us how to print the gps coordinates from device with built-in gps chipset for a filename.cgi ?

Such as:

Latitude: 30.0
Longitude: -90.0

What if my server won't allow us to use gps module:

Can you recommand any server which has gps module for safety and track gps devices to prevent thefts?

Thank you


Oct 18, 2014, 8:01 PM

Post #2 of 5 (29641 views)
Re: [lecandotnet] GPS coordinates. [In reply to] Can't Post

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 = "";
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:

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

How to Write Your Own GPS Application
By: Jon Person

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


Oct 19, 2014, 5:16 PM

Post #3 of 5 (29508 views)
Re: [lecandotnet] GPS coordinates. [In reply to] Can't Post

Mr James Kim lost and died in the cold snow from a wrong turn to the East:

Solution :

(This post was edited by lecandotnet on Oct 19, 2014, 6:38 PM)


Oct 22, 2014, 7:07 AM

Post #4 of 5 (28331 views)
Re: [lecandotnet] GPS coordinates. [In reply to] Can't Post

NMEAfields Perl Module - Source Code:

Example to read file route.dat with word GPGLL in:


GP => 'GPS - Global Positioning System'
GLL => 'geographic Position - Latitude/Longitude',

convert 3907.3839,N,12102.4771,W
55.47N -133.14W
First 2 characters of the first word from file route.dat:

AI => 'Automatic Identification System (AIS)'

AP => 'Heading Track Controller (AutoPilot), Magnetic'

GP => 'GPS - Global Positioning System'

HC => 'Heading Calculation'

II => 'Integrated Instrument'

IN => 'Integrated Navigation'

PG => 'Proprietry Device'

SD => 'Sounder Depth'

VD => 'Doppler Velocity'

Last 3 characters of first word:
GGA => '3-dimension fix with time and accuracy',
COG => 'course over ground',
BOD => 'Course waypoint to waypoint',
BWC => 'bearing from fix to waypoint',
BWW => 'Course waypoint to waypoint',
DBS => 'depth below surface',
DBT => 'depth below transducer',
DPT => 'depth',
GLL => 'geographic Position - Latitude/Longitude',
GSA => 'GPS DOP and active satellites',
GSV => 'satellites in view',
HDG => 'heading magnetic',
HDM => 'heading magnetic',
HDT => 'heading true',
MTW => 'Water temperature',
RMA => 'Recommended Minimum Specific Loran-C Data',
RMB => 'Recommended Minimum Navigation Information',
RMC => 'Recommended Minimum Specific GNSS Data',
RMZ => 'Altitude (Garmin)',
RME => 'Estimated Error Information (Garmin)',
RMF => 'GPS Fix Data (Garmin)',
RTE => 'Routes RTE - Routes',
VHW => 'Velocity through water',
VLW => 'Distance traveled through water',
VWR => 'Relative velocity of wind',
VTG => 'track made good and ground speed',
WPL => 'waypoint position',
XTE => 'cross track error',
ZDE => 'date and time',
ZDA => 'date and time',

(This post was edited by lecandotnet on Oct 22, 2014, 11:36 AM)


Oct 23, 2014, 12:06 PM

Post #5 of 5 (27830 views)
Re: [lecandotnet] GPS coordinates. [In reply to] Can't Post

Example 3:


//Requests position and calls the show_position function when the user agrees to share location.


//This function does the work of getting the actual user coordinates

function show_position(position){

var lat = position.coords.latitude; //This gets the userís latitude information

var longi = position.coords.longitude; //This gets the userís longitude information

document.getElementById("Coord1").innerHTML=lat; //This writes the latitude information

document.getElementById("Coord2").innerHTML=longi; //This writes the longitude information



Pass java value to html:

(This post was edited by lecandotnet on Oct 25, 2014, 6:47 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