Skip to content

Instantly share code, notes, and snippets.

@knudmoeller
Last active July 11, 2023 09:25
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 knudmoeller/4b177b7a4d6ce8531d729db80c403cbe to your computer and use it in GitHub Desktop.
Save knudmoeller/4b177b7a4d6ce8531d729db80c403cbe to your computer and use it in GitHub Desktop.
Get WGS84-GeoJSON from WFS with Soldner-Coordinates

Get WGS84-GeoJSON from WFS with Soldner-Coordinates

The problem: get GeoJSON data from a WFS that uses a projection other than WGS84. This is e.g. true for all geo data in Berlin's FIS-Broker GIS. The data there uses the "Soldner" projection (or EPSG:25833).

Download as XML

curl --output $(LAYER).xml "https://fbinter.stadt-berlin.de/fb/wfs/data/senstadt/s_wfs_baumbestand?service=wfs&version=2.0.0&request=GetFeature&typeNames=$(LAYER)"
  • For our example, this would be:
curl --output s_wfs_baumbestand.xml "https://fbinter.stadt-berlin.de/fb/wfs/data/senstadt/s_wfs_baumbestand?service=wfs&version=2.0.0&request=GetFeature&typeNames=s_wfs_baumbestand"
  • (that's quite a lot of data, roughly 350mb)

Convert to GeoJSON and change projection

  • I'm using the ogr2ogr tool for this.
ogr2ogr -fieldTypeToString All -f "GeoJSON" s_wfs_baumbestand.geojson -s_srs EPSG:25833 -t_srs WGS84 s_wfs_baumbestand.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment