Skip to content

Instantly share code, notes, and snippets.

@tmizu23
Created October 14, 2019 03:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmizu23/b859dfaf62bae8650413ba09fce1f720 to your computer and use it in GitHub Desktop.
Save tmizu23/b859dfaf62bae8650413ba09fce1f720 to your computer and use it in GitHub Desktop.
SET OSGEO4W_ROOT=C:\Program Files\QGIS 3.8
SET EPSG=6672
SET GDAL_DATA=%OSGEO4W_ROOT%\share\gdal
cd %~dp0
for %%i in (%*) do (
del "%%~ni"_out.csv
del "%%~ni"_out.geojson
"%OSGEO4W_ROOT%\bin\ogr2ogr.exe" -f CSV "%%~ni"_out.csv "%%i" -s_srs epsg:4326 -t_srs epsg:%EPSG% -lco GEOMETRY=AS_XYZ -oo X_POSSIBLE_NAMES=lon -oo Y_POSSIBLE_NAMES=lat -oo Z_POSSIBLE_NAMES=alt
"%OSGEO4W_ROOT%\bin\ogr2ogr.exe" -f GeoJSON "%%~ni"_out.geojson "%%i" -s_srs epsg:4326 -t_srs epsg:%EPSG% -oo X_POSSIBLE_NAMES=lon -oo Y_POSSIBLE_NAMES=lat -oo Z_POSSIBLE_NAMES=alt
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment