I am working on a python school project that uses gpx tracks from different devices. Latitude, Longitude, Elevation and Timestamp are the only information that are constantly available. HDOP, Speed, etc. information may or may not exist. Projection used by the devices: WGS84. The ultimate purpose of the program is the computation of travel time given a specific route.

CURRENT NEED: Snap gps track points to the nearest centerline.

CURRENT TO DO: Compute for shortest/perpendicular distance, value of which will be used in deciding which line the point snaps to.

QUESTION 1: What would be more accurate to do/use?

QUESTION 2: What would be faster computationally?

OPTION 1: Convert to UTM first.

OPTION 2: Use Haversine's Formula.

OPTION 3: Use Vincenty's Formula.


  1. Calculate distance, bearing and more between Latitude/Longitude points: http://www.movable-type.co.uk/scripts/latlong.html

  2. Distance Calculation Algorithms: http://www.ga.gov.au/scientific-topics/positioning-navigation/geodesy/geodetic-techniques/distance-calculation-algorithms

  3. Vincenty vs Haversine Distance Calculations? http://www.researchgate.net/post/Vincenty_vs_Haversine_Distance_Calculations

  4. Geographic Information Technologies for analysing the digital footprint of tourists: [http://www.agile-online.org/Conference_Paper/cds/agile_2014/agile2014_91.pdf4

  5. Adventures in GIS Programming and Development: a Geospatial Tutorial: http://www.toptal.com/gis/adventures-in-gps-track-analytics-a-geospatial-primer

  6. Is there a good GPS track analysis library? Is there a good GPS track analysis library?


  • @gene: Thanks for the edit! I didn't have the rep to post more than 2 links hence the intended typo in my original post. – curiousCat Dec 26 '14 at 14:05
  • Since this issue is just part of a bigger coding problem and my time for working on this part is limited, and also because the tracks have been batch imported unto a PostGIS database with no changes to the schema, I have decided to follow the postGIS solution as presented in Reading(4). Convert to UTM first so that distance(m) from centerline constraint can be specified immediately on the query without any additional conversion codes. No prior testing for accuracy nor process time was done. I just need to move on and so I will use a built-in solution instead(for the moment). – curiousCat Dec 26 '14 at 15:46
  • Not an experience-based answer but... 5.2.2 Choosing a Geodetic or Projected Coordinate System docs.oracle.com/cd/A97630_01/appdev.920/a96630/… – curiousCat Dec 30 '14 at 10:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.