WFS to PostGIS in 1 Step
This is an update to my previous post “WFS to PostGIS in 3 Steps”. Thanks to Even Rouault’s comments and improvements to GDAL, it is now possible to load Latin1-encoded WFS (like the one by data.wien.gv.at) into PostGIS in just one simple step.
To use the following instructions, you’ll have to get the latest GDAL (release-1600-gdal-mapserver.zip)
You only need to run SDKShell.bat to set up the environment and ogr2ogr is ready for action:
C:\Users\Anita>cd C:\release-1600-gdal-mapserver C:\release-1600-gdal-mapserver>SDKShell.bat C:\release-1600-gdal-mapserver>ogr2ogr -overwrite -f PostgreSQL PG:"user=myuser password=mypassword dbname=wien_ogd" "WFS:http://data.wien.gv.at/daten/geoserver/ows?service=WFS&request=GetFeature&version=1.1.0&typeName=ogdwien:BEZIRKSGRENZEOGD&srsName=EPSG:4326"
Thanks everyone for your comments and help!
Anita, can you tag this one PostGIS. It’s not showing up on postgis feed like it’s related article.
Done. Thanks for the reminder :)
Anita, I’ve just tried the ogr2ogr command with a utf-8 based wfs service.
It works too, so it’s not only latin-1 based wfs services that works
Thanks. Actually, I was aware that UTF8-encoded services already did work. The new thing is that Latin1-encoded services work too :)