Skip to content

Instantly share code, notes, and snippets.

@elevine
Created November 20, 2012 03:29
Show Gist options
  • Select an option

  • Save elevine/4115762 to your computer and use it in GitHub Desktop.

Select an option

Save elevine/4115762 to your computer and use it in GitHub Desktop.
ogr2ogr Python bindings example
import ogr2ogr
import string
import sys
def main():
#note: main is expecting sys.argv, where the first argument is the script name
#so, the argument indices in the array need to be offset by 1
ogr2ogr.main(["","-f", "KML", "out.kml", "data/san_andres_y_providencia_administrative.shp"])
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment