developmentseed / moz-datapipeline

Mozambique Road Planning data pipeline
MIT License
4 stars 1 forks source link

Flood array not encoded properly in .osm #69

Closed olafveerman closed 6 years ago

olafveerman commented 6 years ago

The issue

The arrays with flood depths and lengths are not properly encoded in the OSM file.

This:

"flood_depths": [1.1,1.29,1.47,1.73,1.82,1.91,2.08,2.12,2.36,2.6]

is encoded into something like this:

<tag k="flood_depths" v="(10:1.1,1.29,1.47,1.729999999999999,1.82,1.9089999999999999,2.08...)" />

When there are multiple values with floating points issues, the array gets truncated. This causes issues in the calculation of the EAUL, which expects there to be flood data for 10 return periods.

Solution

Instead of decoding the flood data in the .osm file, load the data from the two JSON files directly.