Framstag / libosmscout

Libosmscout is a C++ library for offline map rendering, routing and location lookup based on OpenStreetMap data
Other
259 stars 79 forks source link

Issue importing negative elevations #1374

Closed vyskocil closed 1 year ago

vyskocil commented 1 year ago

I built elevation contours using:

phyghtmap --no-zero-contour -s 10 --max-nodes-per-tile=0 --pbf --start-node-id=11000000000 --start-way-id=11000000000 --srtm=1 *.hgt

Then tried to import the resulting osm file like this:

nohup ~/Dev/libosmscout-vyskocil/build/Import/Import --destinationDirectory . --bounding-polygon ../namibia.poly ../Namibie-lon11.0024.00lat-28.00-16.00.osm.pbf > import.log i 2>&1 &

I could see many errors like the following:

... % 90.36 (173490892/191999417) WW Way 11000238290 - Ele tag value '-20' value is too small or too big! WW Way 11000238291 - Ele tag value '-20' value is too small or too big! WW Way 11000238292 - Ele tag value '-10' value is too small or too big! ...

Karry commented 1 year ago

Hi. I also noticed that when I was visiting Death Valley in US ;-) It may be beneficial to be able store negative values - for few undersea deserts, sailors or divers... Fix may be simple, we will just need to increase database format version I guess. Current type of Ele feature is uint32_t. But int16_t would be definitely better.

   class OSMSCOUT_API EleFeatureValue : public FeatureValue
  {
  private:
    uint32_t ele=0;

Does it worth it? Just out of curiosity, in Namibia is somewhere elevation lower than sea level? Or your DEM data contains deep of the sea?

Karry commented 1 year ago

Fix was merged, closing issue