mibe / Srtm2Osm

Srtm2Osm tool uses Shuttle Radar Topography Mission (SRTM) digital elevation model (DEM) to generate elevation contours (isohypses) of a selected terrain. The tool writes contours as OSM ways into an OSM file. This then enables rendering of the terrain using Osmarender XSLT transformations or other OSM renderers.

Home Page:https://wiki.openstreetmap.org/wiki/Srtm2Osm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About the date format

CarlosGNM opened this issue · comments

Sorry if this is not the right place for what I am asking.
I am using this program to add contour lines to my gps OSM maps.
The command I send is:

srtm2osm.exe -bounds1 -119.7 49.76 -119.25 50 -step 10 -cat 2000 1000 -corrxy 0.0005 0.0005 -maxwaynodes 5000 -large - -o srtm-kelowna.osm > srtm.log

When I tried to sort it with OSMIUM I got an error because of the node ID.
I corrected this by adding these parameters to the line:
-firstnodeid 9000000000000000000 -firstwayid 9000000000000000000 and that solved it.

Later the error is due to the timestamp:
can not parse timestamp: '2023-06-09T22:36:40.4567369Z'

Below I copy a part of the first line of the file.
<node id="9223372036854775807" timestamp="2023-06-03T12:55:25.5578799Z" user="Srtm2Osm" uid="941874" lat="43.99925"...

Is it normal for srtm2osm to produce this date format?
Or is the problem somewhere else?

Regards

Hm... does Osmium say what's wrong with the timestamp? Maybe it does not like the decimal part...
Can you provide the command line you used to invoke Osmium (and which version of Osmium you used)? I'll have a look at it.

Thank you for your response.

The line I am sending is this one, as you can see it is very simple:

osmium sort map10-st.osm -o map10.osm

The version I use is: osmium-tool-1.15.0-h8558f88_0, srtm2osm.exe ver. 1.15.4.0

The problem I think is in the number of digits in the seconds. The dates I've seen always put the seconds to two decimal places, but the file srtm2osm generates shows them to seven decimal places:
Anyway I've made a little Python program that removes the timestamps, so, not in the best way, the issue is solved.

I removed the fractional seconds from the timestamp. Could you please try the test version attached?

Srtm2Osm-test.zip
Srtm2Osm-test.asc.zip

This version also has different defaults for IDs and maxWayNodes. You should be able to omit firstnodeid, firstwayid and maxwaynodes completely.

By the way, why do you need to sort the file anyhow?

Thank you. I will try and report back.

As for ordering the nodes, splitter cancels the job with this message:

Processing srtm-prueba.osm
Error: Node ids are not sorted. Use e.g. osmosis to sort the input data.
This is not supported with keep-complete=true or --problem-list
uk.me.parabola.splitter.SplitFailedException: Node ids are not sorted

I was mapping yesterday and everything seems to be going well. I no longer get warnings for the timestamp format nor for initial nodes.

If I find something strange I will report it here.

Thank you.

Thank you.

You are welcome! 😃