How to display countour elevation text from custom contour srtm files?

333 views
Skip to first unread message

wb6...@gmail.com

unread,
Aug 15, 2013, 6:12:18 PM8/15/13
to osm...@googlegroups.com


I am in the western US. The standard downloadable contour SRTM files are rendered in meters rather than the desired feet so using strm2osm I have created my own custom SRTM contour files using major elevation of 1000 feet, step 50 feet.
These were originally created for use with ORUXMaps in .map vector format and converting the .osm format to .obf using OSMAndMapCreator worked properly showing contour lines without changes to the rendering_types.xml -- except I do not see the elevation text rendered on the contour lines.

The question is then, what tags are needed or used in the source .osm data  (see sample below)  that will be properly converted to display elevation text properly in .obf format ?
or alternately are there special tag handling descriptions in the rendering_types.xml  and or default.render.xml  used for displaying contour line elevation text?

such as:         <type tag="contour" value="elevation" minzoom="11" nameTags="ele"/>


Bob
(wb6...@gmail.com)



Excerpt from a str2osm generated srtm.osm file:


  <way id="1000004135" version="1" timestamp="1-01-03T08:00:00Z">
    <nd ref="2000607576"/>
    <nd ref="2000607577"/>
    <nd ref="2000607578"/>
    <nd ref="2000607579"/>
    <nd ref="2000607580"/>
    <nd ref="2000607581"/>
    <nd ref="2000607582"/>
    <nd ref="2000607583"/>
    <nd ref="2000607584"/>
    <nd ref="2000607585"/>
    <nd ref="2000607586"/>
    <nd ref="2000607587"/>
    <nd ref="2000607588"/>
    <nd ref="2000607589"/>
    <nd ref="2000607590"/>
    <nd ref="2000607591"/>
    <nd ref="2000607592"/>
    <nd ref="2000607593"/>
    <nd ref="2000607576"/>
    <tag k="ele" v="12680"/>
    <tag k="contour" v="elevation"/>
    <tag k="contour_ext" v="elevation_minor"/>
  </way>


From my default.render xml file:

       <!-- Natural -->
        <group>
            <filter contourLines="11" minzoom="12" textSize="12" textColor="#444444" textOnPath="true" tag="contour" value=""/>
            <filter contourLines="12" minzoom="13" textSize="12" textColor="#444444" textOnPath="true" tag="contour" value=""/>
            <filter contourLines="13" minzoom="13" textSize="12" textColor="#444444" textOnPath="true" tag="contour" value=""/>
            <filter contourLines="14" minzoom="14" textSize="12" textColor="#444444" textOnPath="true" tag="contour" value=""/>
            <filter contourLines="15" minzoom="15" textSize="12" textColor="#444444" textOnPath="true" tag="contour" value=""/>
            <filter contourLines="16" minzoom="16" textSize="12" textColor="#444444" textOnPath="true" tag="contour" value=""/>
            <groupFilter nightMode="true" textColor="#777777"/>
        </group>

yvecai

unread,
Aug 16, 2013, 1:09:19 PM8/16/13
to osm...@googlegroups.com
Elevation shown on Osmand is saved in the tag 'name' if %%100m.
I think you need to tweak your osm files.

wb6...@gmail.com

unread,
Aug 16, 2013, 4:47:40 PM8/16/13
to osm...@googlegroups.com




Thanks,

Hand editing a test file to <tag k="name" v= ...

after conversion to .obf does now show elevation text.  Now I have to figure out how to batch tweak 100GB + of osm contour files....8)


Bob

yvecai

unread,
Aug 17, 2013, 4:36:34 AM8/17/13
to osm...@googlegroups.com
Not sure, but maybe there is something clever to do.
Actual meter contour lines looks like this in .osm:
<way>
...
<nd ref="3000003337"/>
<nd ref="3000003338"/>
<tag k="elevation" v="1390"/>

<tag k="contour" v="elevation"/>
<tag k="contourtype" v="10m"/></way>

<way>
...
<nd ref="3004927551" />
<nd ref="3004927552" />
<tag k="elevation" v="2300" />

<tag k="contour" v="elevation" />
<tag k="contourtype" v="100m" />
<tag k="name" v="2300" />
</way>

So yes, maybe you can add nameTags="ele" in default.render.xml, and an additionnal filter on k="contour_ext" v="elevation_major" if they exists in your file.

Yves

Victor Shcherb

unread,
Aug 17, 2013, 6:24:34 AM8/17/13
to osmand
I believe that it would be much easier if we could specify in rendering style "text-function" convertToFeet.

Regards,
Victor


--
You received this message because you are subscribed to the Google Groups "Osmand" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osmand+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

wb6...@gmail.com

unread,
Aug 17, 2013, 3:09:39 PM8/17/13
to osm...@googlegroups.com
Victor et all,


A "convertToFeet" function would be useful for rendering elevation in feet on natural elements such as "peak".  Such a function could be tied to the driving region or display units options.

However,  on US topo maps we are used to seeing an even contour interval of 20, 40 or 100 feet not 32.808398 feet which is what a meters to feet conversion would render as.

As to the batch "tweaking" the osm data, I now have a solution using a newer version of osmosis which includes a transform task. So now my workflow is something like this:

Strm2Osm                   --  extracts SRTM data for a given bounding box to osm v0.5 format. 

                                       Note: my SRTM data has been pre-downloaded and cleaned using SRTMFill free version. Since SRTMfill free does not support batch processing I have had to run this
                                       manually  for each .hgt file I have which is currently covers  the western half of the US.
 
osmosis-0.35                -- converts osm v0.5 to v0.6 format.   Newer versions of osmosis do not support v0.5.
osmosis-0.44                -- transforms osm SRTM file to add <tag k="name" v="elevation goes here"/> \
                                      for each element that has a <tag k="contour_ext" v="elevation_medium"/>  ( or v="elevation_major" )

OSMAndMapCreator     -- batch convert any and all osm files to obf


Still fine tuning the transform file.....

Regards,

Bob


Reply all
Reply to author
Forward
0 new messages