Option "preserve-element-order"

Has anybody had success controlling the drawing order with the "-- preserve-element-order" option? The drawing order is random for me, with or without this option. Would be nice to get it working, though, especially for overlays. Regards Thilo

It is not for me, depends on the 0x** , and of course only for lines and POI. Polygons have to be defined in typfile. 2009/6/30 Thilo Hannemann <thannema@gmx.de>
Has anybody had success controlling the drawing order with the "--preserve-element-order" option?
The drawing order is random for me, with or without this option. Would be nice to get it working, though, especially for overlays.
Regards Thilo
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Thilo,
Has anybody had success controlling the drawing order with the "-- preserve-element-order" option?
The drawing order is random for me, with or without this option. Would be nice to get it working, though, especially for overlays.
When you say random, do you mean that each time you recreate the map from the same OSM file file, the drawing order changes? Cheers, Mark

Thank you for all the quick feedback. What I am after is the drawing order of lines. I use the overlay feature of mkgmap with the "overlays" style file. Using this feature one way in the OSM data will create several ways with an identical location in the IMG file, but with different Garmin IDs. Those ways get always added in the same order to the IMG file. So I should be able to use this feature to create more complex line styles by overlaying Garmin IDs. Another thing I use is a patch that allows me to generate ways from relations (I've published it some time ago on this mailing list). The relations are handled before the points, lines and shapes are handled, so they are always first in the IMG files. The thing is: It doesn't work. What is even worse is that I get different drawing order whether I view the map on the computer or on a GPS unit. Attached are some screenshots of the same area using the same IMG files. The thing to look at are the cycle route in blue (generated from relations) and the cycleways that go alongside roads (the blue dotted lines on both sides of a way, generated as an overlay). MapSource and RoadTrip draw the cycle way at the bottom of the screen (along Hofmannstrasse) behind the road, but the nüvi 255W and the Oregon 300 draw it on top of the road. The same is the situation with the cycle way at the upper left corner (along Gebbertstrasse). On the computer it is drawn behind the road while the GPS units draw it on top of the road. It would be nice if that behaviour would be at least consistent. But it isn't. I also get roads drawn on top of the cycle routes on the GPS units. Has anybody any idea what is happening here? Regards Thilo

First to understand, mapsource like gps drawn things on top of each other, thus what gets drawn first ends up on below things drawn later. On GPS this is even more noticable than in Mapsource. Drawing order on GPS: 1. Polygons (doesn't matter which layer nor map-id,) --> polygons themselves by draw order in typfile. 2. Polylines (layers get drawn first lowest map-id to highest map.id, thus lower higher layers are drawn on top of lower highway map-id layers) - this behaviour is opposite to what Mapsource does. Polylines themselves if not organised by map-id layers get drawn according to 1. type (some types behave differently), 2. id. 3. POI (depends on ID and type) - allways on top of polygons and polylines Drawing order in Mapsource <= 6.13.7. (I don't use crapsource >=6.14.1 which works differently again and is blody slow, and overcomes this by caching the map so you don't notice how crappy it's performance really is, but loads up to 20GB of temp files onto my 1.5TB harddisk, also antialising depending on graphic card gets tedious for the eyes - as everything gets cached before showing up difficult to analyse what gets drawn first.) 1. Overall order is defined by map-id layers. layers get preference, so polygons have to be in lowest layer (map-id). Polygons themselves are organised by draw order primarily and either type or id (have not figured this out yet) 2. Streets, layers opposite to GPS, types the same way as on GPS. thus 0x01 is drawn usually lowest. 3. POI Have not figured it out, seems to depend on type and map-id. Thilo Hannemann wrote:
Thank you for all the quick feedback.
What I am after is the drawing order of lines.
I use the overlay feature of mkgmap with the "overlays" style file. Using this feature one way in the OSM data will create several ways with an identical location in the IMG file, but with different Garmin IDs. Those ways get always added in the same order to the IMG file. So I should be able to use this feature to create more complex line styles by overlaying Garmin IDs. Another thing I use is a patch that allows me to generate ways from relations (I've published it some time ago on this mailing list). The relations are handled before the points, lines and shapes are handled, so they are always first in the IMG files.
The thing is: It doesn't work. What is even worse is that I get different drawing order whether I view the map on the computer or on a GPS unit. Attached are some screenshots of the same area using the same IMG files. The thing to look at are the cycle route in blue (generated from relations) and the cycleways that go alongside roads (the blue dotted lines on both sides of a way, generated as an overlay).
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------------------------------------------------------------
MapSource and RoadTrip draw the cycle way at the bottom of the screen (along Hofmannstrasse) behind the road, but the nüvi 255W and the Oregon 300 draw it on top of the road. The same is the situation with the cycle way at the upper left corner (along Gebbertstrasse). On the computer it is drawn behind the road while the GPS units draw it on top of the road.
It would be nice if that behaviour would be at least consistent. But it isn't. I also get roads drawn on top of the cycle routes on the GPS units.
Has anybody any idea what is happening here?
Regards Thilo
------------------------------------------------------------------------
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hello Sorry for interruption... 2009/7/1 Felix Hartmann <extremecarver@googlemail.com>:
Drawing order on GPS: 1. Polygons (doesn't matter which layer nor map-id,) --> polygons themselves by draw order in typfile.
How exactly can I control that (where/what is that typfile)? In exact, I want to have lakes on top of forests. Thank you P.S. If it changes anything - I'm using a map on Garmin Colorado. -- Tomas Straupis

Hi! Felix Hartmann schrieb:
Drawing order on GPS: 1. Polygons (doesn't matter which layer nor map-id,) --> polygons themselves by draw order in typfile.
Right.
2. Polylines (layers get drawn first lowest map-id to highest map.id, thus lower higher layers are drawn on top of lower highway map-id layers) - this behaviour is opposite to what Mapsource does. Polylines themselves if not organised by map-id layers get drawn according to 1. type (some types behave differently), 2. id.
I do not think this is correct. If this was true, the order of polylines would always be the same, regardless of order in the .osm and regardless of the preserve order option. But I have observed that the order in the .osm does matter and if you don't specify preserve-order, mkgmap does alter the order and the rendering is messed up accordingly.
3. POI (depends on ID and type) - allways on top of polygons and polylines
On top of other elements, but in the order of the .osm file. bye Nop

Hi Felix, you say that the draw order of the polylines depends on 1. type and 2. id. What do you mean by id? Is that the OSM id? Or do you refer to the order the lines are written into the .IMG file? From what I see it certainly depends on the type of the polyline, but in a way that I do not understand. Regards Thilo

2009/7/1 Thilo Hannemann <thannema@gmx.de>
Hi Felix,
you say that the draw order of the polylines depends on 1. type and 2. id. What do you mean by id? Is that the OSM id? Or do you refer to the order the lines are written into the .IMG file?
From what I see it certainly depends on the type of the polyline, but in a way that I do not understand.
Regards Thilo
Well using preserve-element order this should be the same, or? I too have not understood completely how types are ordered, but I do noticed that some types behave differently. To really find out you'ld need to draw a testmap in JOSM checking all possible combinations of types crossing

Hi! Thilo Hannemann schrieb:
you say that the draw order of the polylines depends on 1. type and 2. id. What do you mean by id? Is that the OSM id? Or do you refer to the order the lines are written into the .IMG file?
From what I see it certainly depends on the type of the polyline, but in a way that I do not understand.
From my observations, lines (and POIs) are drawn in the order of the .osm file with preserve-order on. If you use a planet file directly, it is already sorted by OSM id, but this is coincidential, you can change it to any order you like. In my hiking map I add lines as highlighting overlays. All highlights have a higher type ids than regular ways. All lines are in the same map layer. I can control whether the highlights are drawn over or below the regular ways by putting them in the correct drawing order in the osm file. If preserve-order is off, the order is randomized by mkgamp and the drawing order on the device is also randomized. I have not observed a dependency on line type id. Observations are based on mkgmap r590 to r1001. bye Nop

Hi! Thilo Hannemann schrieb:
Has anybody had success controlling the drawing order with the "--preserve-element-order" option?
The drawing order is random for me, with or without this option. Would be nice to get it working, though, especially for overlays.
Yes ist works for me (in r1001) within the limits of the garmin. Which means polygons are drawn according to the priority setting, but lines and POIs are drawn in the order of the OSM data. I have not tried a later version (see my post "recommended stable version") bye Nop
participants (5)
-
Felix Hartmann
-
Mark Burton
-
Nop
-
Thilo Hannemann
-
Tomas Straupis