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:
GPS coordinates.

 



lecandotnet
Novice

Oct 18, 2014, 8:18 AM

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

Hi,

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:
use GPS::NMEA

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

Thank you


lecandotnet
Novice

Oct 18, 2014, 8:01 PM

Post #2 of 5 (29149 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 = "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)


lecandotnet
Novice

Oct 19, 2014, 5:16 PM

Post #3 of 5 (29016 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:

http://placesnomore.wordpress.com/2011/02/18/thekims/

Solution :




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


lecandotnet
Novice

Oct 22, 2014, 7:07 AM

Post #4 of 5 (27839 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:

$GPGLL,3553.5295,N,13938.6570,E,002454,A,A*4F

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',
0
http://maperl.com/Hydrography/nmeafields-src.shtml


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


lecandotnet
Novice

Oct 23, 2014, 12:06 PM

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

Example 3:

http://www.pageresource.com/html5/api-geolocation/

<script>

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

navigator.geolocation.getCurrentPosition(show_position);



//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

}

</script>

Pass java value to html:

https://answers.yahoo.com/question/index?qid=20090829213928AAB7cZi


(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