Tagged: 

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #27195

    Anonymous

    Hi,

    first sorry for originally posting this message in the German section, but I then realised that there is this English section of the forum, so I moved my message here.

    Hoping that one day I’ll be able to create a fork of OpenAndroMaps for winter sports (see Elevate Winter Fork), I’m trying to create a very small map for testing purposes. My goal is to learn and understand how OpenAndroMaps .map files (e.g. Alps_West.map) are created. I understand that the actual rendering of any such map depends also on the rendertheme file (e.g. Elevate.xml), however in this first phase I’d like to figure out how a map file is built starting from raw OpenStreetMap data.

    Here are the steps I performed:

    1. Downloaded a small amount of OSM data from a known area with JOSM (file sauze.osm)
    2. Used the tag-transform rules published on this site (pasted in a file called transform.xml) to get a transformed version of original OSM data. The command I used for this was:
    $ osmosis --read-xml file=sauze.osm --tag-transform file=transform.xml --write-xml file=sauze.trs.osm
    3. Checked that generated file sauze.trs.osm has some new tags that were unavailable in the original sauze.osm file–e.g. the new file has the mtb_scale tag.
    4. Used mapfile-writer plugin for Osmosis to get a mapsforge map file:
    $ osmosis --read-xml file=sauze.trs.osm --mapfile-writer file=sauze.trs.map

    At this point I would expect that the sauze.trs.map file had the information needed for the Elevate rendertheme. However, if I set for instance the MTB style, I don’t see paths coloured according to their MTB scale difficulty.

    What am I missing? Something big I assume…

    Thanks & Regards!

    #27207
    ChristianK
    ChristianK
    Keymaster

    You cant see the MTB-Routes cause Mapsforge-writer can’t resolve Relations.
    This is be done by my own scripts in Perl.
    The published TagTransform and TagMapping is for Theme-Devellopers and not a howto for making maps.
    This is (if you want to have all feaatures of OAM) a very complicated prozess over dozends of steps involving many tools (all free but some more than less modified) and in constant development cause mapping in OSM is changing with every month.

    Oups..
    $ osmosis –read-xml file=sauze.trs.osm –mapfile-writer file=sauze.trs.map

    you have to include a tagmapping file:
    $ osmosis –read-xml file=sauze.trs.osm –mapfile-writer file=sauze.trs.map tag-conf-file=tag-mapping.xml

    tagmapping you can find here:
    https://www.openandromaps.org/map-basics-2/tag-mapping

    Best regards
    Christian

    1 user thanked author for this post.
    #27209

    Anonymous

    Thank you very much. Actually I’m not interested so much with relations at the moment—it’s a further layer of complexity that I can’t cope with for the time being.

    My issue was with more basic features, like the colouring of paths based on mtb:scale. But I believe that your hint on tag-mapping will solve it. I’ll test it and let you know.

    Thanks again

    #27219

    Anonymous

    you have to include a tagmapping file:
    $ osmosis read-xml file=sauze.trs.osm mapfile-writer file=sauze.trs.map tag-conf-file=tag-mapping.xml
    tagmapping you can find here:
    https://www.openandromaps.org/map-basics-2/tag-mapping

    Ok, it worked! Thanks again for the hint!

    Next step is integrating contour lines, but for the time being I’m happy :-)

    1 user thanked author for this post.
    #27223
    ChristianK
    ChristianK
    Keymaster

    Next step is integrating contour lines

    phyghtmap is your friend
    http://katze.tfiu.de/projects/phyghtmap/phyghtmap.1.html

    1 user thanked author for this post.
    #27238

    Anonymous

    Thank you, man! Here’s the point where I’ve arrived, and the commands I used (file sauze.osm was exported from JOSM):

    [/crayon]

    Are the tag-transform.xml and tag-mapping.xml files on the MapBasics section up to date? My map does not show elevation labels, unless I zoom in a lot. Standard OpenAndroMaps show elevation labels also with much lower zoom levels. Besides, some other captions are missing (e.g. the caption for lake Lago Nero, compare the two pictures below).

    #27297
    ChristianK
    ChristianK
    Keymaster

    Besides, some other captions are missing (e.g. the caption for lake Lago Nero

    You are right.
    I use my own labels.
    = the area of lakes, reservoirs, etc.. is calculated, a poly_weight tag (value depends on area covered), the center of the lake(..) is calculated and a “poly_label” is set (node).
    There are a lot of such optimizations (like housnumbers derived from buildings tagged as relations), aso.

    The batch file for creating a map is 507 lines long, not included prozessing of land/sea and pois.
    However, this is fine_tunning, the core information is served by the script you created.

    1 user thanked author for this post.
    #27367

    Anonymous

    That’s a mystery–I’ve recreated my small map using the new tag-transform and tag-mapping files:

    [/crayon]

    However elevation labels are shown only for zoom level >= 17. In contrast, with a standard OpenAndroMaps elevation labels are shown for zoom level >= 15. I’m confused!

    #27379
    Tobias
    Tobias
    Moderator

    However elevation labels are shown only for zoom level >= 17. In contrast, with a standard OpenAndroMaps elevation labels are shown for zoom level >= 15. I’m confused!

    Probably your contours are more rounded. For pathtext a straight segment long enough to render the text is needed, this is an old issue in mapsforge:
    https://github.com/mapsforge/mapsforge/issues/885

    1 user thanked author for this post.
    #27387

    Anonymous

    Probably your contours are more rounded. For pathtext a straight segment long enough to render the text is needed, this is an old issue in mapsforge.

    Is it possible that my contours are more rounded because I used SRTM elevation data, in contrast to OpenAndroMaps that use @sonny‘s LaserElevationData, as pointed out here?

    #27392
    Tobias
    Tobias
    Moderator

    No, probably not as those are more detailed. But as far as I know they are simplified in the process to take up less space in the map file, Christian can tell you how (I think it’s also in the thread for Sonny’s DEMs).

    #27398
    ChristianK
    ChristianK
    Keymaster

    Contourlines are simplified by “simplify-ways” an Osmosis Plugin.
    However, it needs a very old version of Osmosis.

    If you have troubles downloading the plugin I can provide a running Osmosis configuration.

    1 user thanked author for this post.
    #27404

    Anonymous

    Ok, I’ll check that, thanks!

    #27435

    Anonymous

    OK, thanks to simplify-ways (well, indeed to ChristianK ;-) ) now contour labels do show up:

    @ChristianK, just a curiosity–what epsilonMeters value are you using for simplify-ways? I tried with 10 meters.

    Here are all the commands I ran to get to this point:

    [/crayon]

    Plugin simplify-ways works only with osmosis version 0.39 (not with current 0.47, which you need for plugin maple-writer BTW, so you need both versions). I had to manually add bounding box info in the simplified contourline file sauze_lon6.84_6.90lat44.99_45.04_srtm1v3.0_simpld.osm:

    <bounds minlat="44.9932994" minlon="6.8375554" maxlat="45.0400038" maxlon="6.9037348"/>

    #27486
    ChristianK
    ChristianK
    Keymaster

    I use epsilonMeters=3

    BTW: You are showing up here as “Anonym” – have you deleted your Account?

    • This reply was modified 2 weeks, 1 day ago by ChristianK ChristianK.
Viewing 15 posts - 1 through 15 (of 16 total)

You must be logged in to reply to this topic.