The ubaGeoJSONFixer is a small script, which takes broken GeoJSON from the Umweltbundesamt (UBA) as input from STDIN and fixes it, making it valid (Geo)JSON.
In GeoJSON responses from the Umweltbundesamt, some doubles have a comma as a decimal separator instead of a point, making it invalid JSON.
Currently, we know of SHAPE.AREA
and SHAPE.LEN
.
You need the following to execute the script:
- Kotlin (tested with Kotlin 1.4.31)
- Java 8 (Java 11 and above trigger a bug, which pollute the output of the script)
Setup with asdf-vm
asdf plugin add java
asdf plugin add kotlin
asdf install java adoptopenjdk-8.0.282+8
asdf install kotlin latest
asdf global java adoptopenjdk-8.0.282+8
asdf global kotlin latest
https://askubuntu.com/a/465113
cat brokenFile.geojson | ./fixUbaGeoJSON.kts
or if installed globally
cat brokenFile.geojson | fixUbaGeoJSON.kts