Skip to content

ubaGeoJSONFixer is a small script, which takes broken GeoJSON from the Umweltbundesamt (UBA) and fixes it

License

Notifications You must be signed in to change notification settings

GeoSci-GmbH/ubaGeoJSONFixer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ubaGeoJSONFixer

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.

What does it fix?

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.

Setup

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

  1. asdf plugin add java
  2. asdf plugin add kotlin
  3. asdf install java adoptopenjdk-8.0.282+8
  4. asdf install kotlin latest
  5. asdf global java adoptopenjdk-8.0.282+8
  6. asdf global kotlin latest

(Optional) Make script available globally

https://askubuntu.com/a/465113

Usage

cat brokenFile.geojson | ./fixUbaGeoJSON.kts

or if installed globally

cat brokenFile.geojson | fixUbaGeoJSON.kts

About

ubaGeoJSONFixer is a small script, which takes broken GeoJSON from the Umweltbundesamt (UBA) and fixes it

Resources

License

Stars

Watchers

Forks

Languages