Skip to content

Instantly share code, notes, and snippets.

@mikaelhg
Last active October 19, 2022 06:24
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 mikaelhg/60f7e70d79ae8c11cdc1a3e75065816e to your computer and use it in GitHub Desktop.
Save mikaelhg/60f7e70d79ae8c11cdc1a3e75065816e to your computer and use it in GitHub Desktop.
Postinumeroalueet 2022 query and conversion to GeoJSON (Paavo)
#!/bin/bash
wget -O pno_2022.zip \
'https://geo.stat.fi/geoserver/wfs?service=WFS&version=2.0.0&request=GetFeature&typeName=postialue:pno_2022&outputFormat=SHAPE-ZIP'
unzip pno_2022.zip
ogr2ogr -f GeoJSON -s_srs pno_2022Polygon.prj -t_srs EPSG:4326 \
-lco RFC7946=YES pno_2022.geojson.iso88591 pno_2022Polygon.shp
iconv -f iso-8859-15 -t utf-8 < pno_2022.geojson.iso88591 > pno_2022.geojson
pigz -k pno_2022.geojson
wget -O pno_2022.json \
'https://geo.stat.fi/geoserver/wfs?request=GetFeature&typeName=postialue:pno_2022&srsName=EPSG:4326&outputFormat=json'
@mikaelhg
Copy link
Author

mikaelhg commented Oct 18, 2022

@mikaelhg
Copy link
Author

mikaelhg commented Oct 19, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment