Last active
August 29, 2015 14:02
-
-
Save luanlmd/d3ec89b8cdb221cfb598 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# convert a set of waypoints of a gpx file into utm ground control points txt | |
# setup: pip install gpxpy utm | |
# usage: ./gpxexport.py path/to/file.gpx | |
import sys | |
import gpxpy | |
import gpxpy.gpx | |
import utm | |
gpx_file = open(sys.argv[1], 'r') | |
gpx = gpxpy.parse(gpx_file) | |
for wpt in gpx.waypoints: | |
coord = utm.from_latlon(wpt.latitude, wpt.longitude) | |
print(wpt.name, coord[0], coord[1], wpt.elevation, '0 0') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment