Skip to content

Instantly share code, notes, and snippets.

@shawnbot
Created July 24, 2013 23:05
Show Gist options
  • Select an option

  • Save shawnbot/6075429 to your computer and use it in GitHub Desktop.

Select an option

Save shawnbot/6075429 to your computer and use it in GitHub Desktop.
A shell script to convert OGR point datasources to CSV, re-projecting to WGS84 and encoding latitude and longitude as Y and X columns, respectively.
#!/bin/sh
ogr2ogr -F CSV -lco GEOMETRY=AS_XY -t_srs EPSG:4326 $2_dir $1
mv $2_dir/*.csv $2
rm -r $2_dir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment