Skip to content

Instantly share code, notes, and snippets.

@wilhelmberg
Created November 29, 2014 16:54
Show Gist options
  • Save wilhelmberg/ab713b256df39dd29b19 to your computer and use it in GitHub Desktop.
Save wilhelmberg/ab713b256df39dd29b19 to your computer and use it in GitHub Desktop.
Convert Western Europe ISO-8859-1 1252 shapefiles to utf-8
@echo off
CALL "C:\Program Files\QGIS Brighton\OSGeo4W.bat"
::http://ss64.com/nt/syntax-args.html
::d=drive
::p=path
::n=name without extension
for /R %%f in (*.shp) do (
ECHO %%f
::probieren, ob's ohne --config auch funkt
ogr2ogr %%~dpnf-ORIG.shp %%f --config SHAPE_ENCODING "ISO-8859-1"
ogrinfo %%f -sql "DROP TABLE %%~nf"
:: del
:: ogr2ogr %%f %%~dpnf-ORIG.shp -lco ENCODING=UTF-8 --config SHAPE_ENCODING "ISO-8859-1"
::Gleich transformieren
ogr2ogr %%f %%~dpnf-ORIG.shp -lco ENCODING=UTF-8 -overwrite
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment