Skip to content

Instantly share code, notes, and snippets.

@drnextgis
Created July 8, 2011 03:08
Show Gist options
  • Save drnextgis/1071042 to your computer and use it in GitHub Desktop.
Save drnextgis/1071042 to your computer and use it in GitHub Desktop.
gpxconv
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os,fnmatch
def main():
rootPath = 'c:/personal/gpx'
for root, dirs, files in os.walk(rootPath):
gpxfiles = fnmatch.filter(files, '*.gpx')
if (len(gpxfiles) != 0):
for filename in gpxfiles:
os.system('ogr2ogr '+os.path.join(root,filename)+'.shp '+os.path.join(root,filename)+' tracks')
return 0
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment