gps-util v1.0.1
gps-util
GPS related functionalities. For getting and deleting gps info on an image one need to install exiftool.
http://www.sno.phy.queensu.ca/~phil/exiftool/index.html
Make sure exiftool is executable. if you have to install it manually on linux you can try ./scripts/install_exiftool.sh
Functions
getDistance(lng1, lat1, lng2, lat2)
Calculate distance of 2 given points
lng1longitude of point 1 in decimal degreeslat1latitude of point 1 in decimal degreeslng2longitude of point 2 in decimal degreeslat2latitude of point 2 in decimal degrees
getTotalDistance(points)
Calculate total distance of a serial of points
pointsarray of point, example[{lat: 59.19288511388004, lng: 17.66255029477179 },{ lat: 59.19290036894381, lng: 17.662896132096648 }]
getBoundingBox(lat, lng, distance)
latlatitude of the center, in decimal degrees.lnglongitude of the center, in decimal degrees.distanceradius that spans the bounding box, in meters.
return an array containing 2 points that represent the bounding box.
getMidPoint(points)
pointslist of coordinate, each point with properties lat and lng
return Object/point with lat and lng
toDMS(decDegrees)
Convert decimal degrees to degrees, minutes and seconds (return an object)
getDMSLatitude(decDegrees)
Return a string representation in DMS format, ie 59° 19' 59.88" N
getDMSLongitude(decDegrees)
Return a string representation in DMS format, ie 18° 3' 0" E
toDD(degrees, minutes, seconds)
Convert to decimal degrees
gpxParse(data, callback)
dataxml string of gpx formatcallbackfunction which take 2 arguments, error and result
gpxParseFile(filename, callback)
filenamefile to parse the data in of gpx formatcallbackfunction which take 2 arguments, error and result
gpxParseURL(url, callback)
urlwhere the gpx data is locatedcallbackfunction(error, result)
toGPX(trackingResult, callback, name)
trackingResultcallbackfunction(error, result)namethe name you want to call for this gpx document
toKml(points, callback)
pointsTrack points for instance returned value from gpxParse or tcxParsecallbackfunction(error, result)
tcxParse(data, callback)
dataxml string of tcx formatcallbackfunction which take 2 arguments, error and result
tcxParseFile(filename, callback)
filenamefile to parse the data in of tcx formatcallbackfunction which take 2 arguments, error and result
tcxParseURL(url, callback)
urlwhere the tcx data is locatedcallbackfunction(error, result)
calculateFromGPX(points, callback, fromIndex, toIndex)
pointsTrack points for instance returned value from gpxParsecallbackfunction(error, result) result is a TrackingResult (see calc.js for details)fromIndexInteger from 0toIndexInteger from 1
imageGpsInfo(image, callback)
imagepath to image to get GPS infocallbackfunction(error, result)
removeGPSInfo(image, callback)
imagepath to image to delete GPS infocallbackfunction(error, result) result is boolean
geohashEncode(latitude, longitude, precision)
latitudedecimal latitude of the gps positionlongitudedecimal longitude of the gps positionprecisionnumber of chars to represent the gps position, default 12
geohashDecode(hash)
hashhashed string representing the gps position- return object of latitude, longitude, error
9 years ago
9 years ago
10 years ago
11 years ago
12 years ago
12 years ago
12 years ago
12 years ago
12 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago
13 years ago