Skip to content

Instantly share code, notes, and snippets.

@thbaumann
Last active December 28, 2022 14:59
Show Gist options
  • Save thbaumann/f426bfec12e8ae67222d10fde957b9e4 to your computer and use it in GitHub Desktop.
Save thbaumann/f426bfec12e8ae67222d10fde957b9e4 to your computer and use it in GitHub Desktop.
download wfs to shapefile or gepacke with ogr2ogr
@echo off
set OSGEO4W_ROOT=C:\OSGeo4W64
set basis_url="https://www.geodatenportal.sachsen-anhalt.de/gfds/ws/wfs/942f5d74-6c2b-263a/GDI-LSA_Schutzgebiete/ows.wfs?REQUEST=GetCapabilities&SERVICE=WFS"
set layer="sg:lau_br_lsa"
call "%OSGEO4W_ROOT%\bin\o4w_env.bat"
echo Layer wird importiert...
rem Kommentar: ogr2ogr.exe anstelle nur ogr2ogr falls probleme auftauchen...
rem Layerliste abrufen
rem ogrinfo --config GDAL_HTTP_UNSAFESSL YES -ro -so WFS:"https://www.geodatenportal.sachsen-anhalt.de/gfds/ws/wfs/942f5d74-6c2b-263a/GDI-LSA_Schutzgebiete/ows.wfs?REQUEST=GetCapabilities&SERVICE=WFS"
rem wfs zu shapefile
rem ogr2ogr -skipfailures wfs_layer.shp --config GDAL_HTTP_UNSAFESSL YES WFS:"https://www.geodatenportal.sachsen-anhalt.de/gfds/ws/wfs/942f5d74-6c2b-263a/GDI-LSA_Schutzgebiete/ows.wfs?REQUEST=GetCapabilities&SERVICE=WFS" sg:lau_br_lsa"
rem wfs zu geopackage unter nutzung von variablen
ogr2ogr -skipfailures -f gpkg wfs_download2.gpkg --config GDAL_HTTP_UNSAFESSL YES WFS:%basis_url% %layer%
echo Layer fertig importiert
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment