Verschlagwortet: 

Betrachte 15 Beiträge - 1 bis 15 (von insgesamt 21)
  • Autor
    Beiträge
  • #27195
    Anonym
    Inaktiv

    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
    Avatar-FotoChristianK
    Administrator

    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 Teilnehmer(n) gefällt dieser Beitrag
    #27209
    Anonym
    Inaktiv

    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
    Anonym
    Inaktiv

    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 Teilnehmer(n) gefällt dieser Beitrag
    #27223
    Avatar-FotoChristianK
    Administrator

    Next step is integrating contour lines

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

    1 Teilnehmer(n) gefällt dieser Beitrag
    #27238
    Anonym
    Inaktiv

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

    (edm)bash-3.2$ phyghtmap -a 6.8375554:44.9932994:6.9037348:45.0400038 --earthexplorer-user solitone --earthexplorer-password bayou.Rename9 --source=srtm1 -o sauze --max-nodes-per-tile=0 --write-timestamp
    
    bash$ osmosis --rx sauze.osm --rx sauze_lon6.84_6.90lat44.99_45.04_srtm1v3.0.osm --merge --wx sauze_contours.osm
    
    bash$ osmosis --read-xml file=sauze_contours.osm --tag-transform file=transform.xml --write-xml file=sauze_contours.trs.osm
    
    bash$ osmosis --read-xml file=sauze_contours.trs.osm --mapfile-writer file=sauze_contours.trs.map tag-conf-file=tag-mapping.xml 

    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
    Avatar-FotoChristianK
    Administrator

    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 Teilnehmer(n) gefällt dieser Beitrag
    #27367
    Anonym
    Inaktiv

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

    $ osmosis --read-xml file=sauze_contours.osm --tag-transform file=tt_andromaps.xml --write-xml file=sauze_contours.trs.osm
    $ osmosis --read-xml file=sauze_contours.trs.osm --mapfile-writer file=sauze_contours.trs.map tag-conf-file=tagmapping-urban.xml 

    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
    Avatar-FotoTobias
    Administrator

    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

    Developer of Elevate mapstyle

    1 Teilnehmer(n) gefällt dieser Beitrag
    #27387
    Anonym
    Inaktiv

    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
    Avatar-FotoTobias
    Administrator

    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).

    Developer of Elevate mapstyle

    #27398
    Avatar-FotoChristianK
    Administrator

    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 Teilnehmer(n) gefällt dieser Beitrag
    #27404
    Anonym
    Inaktiv

    Ok, I’ll check that, thanks!

    #27435
    Anonym
    Inaktiv

    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:

    (edm)bash-3.2$ phyghtmap -a 6.8375554:44.9932994:6.9037348:45.0400038 --earthexplorer-user solitone --earthexplorer-password <PWD> --source=srtm1 -o sauze --max-nodes-per-tile=0 --write-timestamp
    
    bash$ ~/opt/osmosis-0.39/bin/osmosis --read-xml sauze_lon6.84_6.90lat44.99_45.04_srtm1v3.0.osm --simplify-ways epsilonMeters=10 --wx sauze_lon6.84_6.90lat44.99_45.04_srtm1v3.0_simpld.osm
    
    bash$ osmosis --rx sauze.osm --rx sauze_lon6.84_6.90lat44.99_45.04_srtm1v3.0_simpld.osm --merge --wx sauze_contours_simpld.osm
    
    bash$ osmosis --read-xml file=sauze_contours_simpld.osm --tag-transform file=tt_andromaps.xml --write-xml file=sauze_contours_simpld.trs.osm
    
    solitone$ osmosis --read-xml file=sauze_contours_simpld.trs.osm --mapfile-writer file=sauze_contours_simpld.trs.map tag-conf-file=tagmapping-urban.xml

    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
    Avatar-FotoChristianK
    Administrator

    I use epsilonMeters=3

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

Betrachte 15 Beiträge - 1 bis 15 (von insgesamt 21)
  • Sie müssen angemeldet sein, um zu diesem Thema eine Antwort verfassen zu können.