make your own render.xml

2,037 views
Skip to first unread message

PeeWee

unread,
Dec 1, 2011, 12:23:26 PM12/1/11
to Osmand
I have just learned that it is possible to make your own render.xml in
order to make you own Osmand look. Is there an internet page or manual
that explains how the default render.xml works and how you can make
your own by changing some values etc?


http://osmand.googlecode.com/git/DataExtractionOSM/src/net/osmand/render/default.render.xml

PeeWee

unread,
Dec 2, 2011, 10:41:02 AM12/2/11
to Osmand
Well if there is no such a tutorial or internet page with some help I
will ask some questions here. Maybe someone can help.

My goal is to make a renderer specifically for bicycle. I am not
completely satisfied with the default renderer (when in bicycle mode)

I would like a different color for “highway= bicycle” . I have managed
to do this. So far so good.
I would also like to render “highway = *” that are part off a relation
(route= bicycle, type=route). I have no idea if this is feasible or
not.
Another thing I would like is that “highway=cycleway” is rendered on
top of other “highway= *” This is because in the Netherlands (and
other countries as well) cycleways are very often next to primery/
secondary/tertiary roads. When I zoom out the cycleways disappear
underneath the other “highway” I would like my renderer to do the
exact opposite so that cycleways are more visible.

Can someone give me some clue as to how I can achieve this?

Cheers Peewee


Pavol Zibrita

unread,
Dec 4, 2011, 2:16:43 AM12/4/11
to osm...@googlegroups.com
I don't know however, you can try to search the forum, there was already
lot of discussion regarding the renderer. You might find what you
seek there, or someone else has to reply.

Regards,
Pavol

Hardy

unread,
Dec 4, 2011, 4:00:58 AM12/4/11
to Osmand
Hello PeeWee,

Let me try to answer your questions below.

Also: If you share your requests(ideas around bicycle rendering with
me in detail (or even better, let's discuss them here), Ican include
them in default if we have consensus with the community.

(1) cycleway color: We are currently using the one of
openstreetmaps.org. Which one do you like? In default we have to make
sure it does not coonflict with all other layers

(2) Can you please give an OSM example of a "route= bicycle,
type=route" element you want to see rendered?

(3) Order: This should be implemented in default renderer ALREADY:
When in appMode=bicycle, all relevant tracks are on top of highways
(even bridges). Please have a look at my latest default renderer, look
our for the combination of "order" and app-Mode=bicycle. I had only
recently reviewed all order statements (which can be a bit tricky in
detail ...). Also: Our current maps still contain an order bug for
highway junctions. This will nowgo away when they are created new.

Hope this helps, any questions, please contact me or post here.

Thanx
Hardy

yvecai

unread,
Dec 4, 2011, 4:34:09 AM12/4/11
to osm...@googlegroups.com
To have highway=cycleway rendered on top, you should rise its 'order' value in the <order></order> section of your render.xml file.
Concerning route=bicycle, I'm not sur if OsmAndMapCreator indexer cares about relations.
Yves


On 04. 12. 11 08:16, Pavol Zibrita wrote:
I don't know however, you can try to search the forum, there was already
lot of discussion regarding the renderer. You might find what you
seek there, or someone else has to reply.

Regards,
Pavol

On Fri, Dec 2, 2011 at 4:41 PM, PeeWee <peterv...@telfort.nl> wrote:
Well if there is no such a tutorial or internet page with some help I
will ask some questions here. Maybe someone can help.

My goal is to make a �renderer specifically for bicycle. I am not

completely satisfied with the default renderer (when in bicycle mode)

I would like a different color for �highway= bicycle� . I have managed

to do this. So far so good.
I would also like to render �highway = *� that are part off a relation

(route= bicycle, type=route). I have no idea if this is feasible or
not.
Another thing I would like is that �highway=cycleway� is rendered on
top of other �highway= *� �This is because in the Netherlands (and

other countries as well) cycleways are very often next to primery/
secondary/tertiary roads. When I zoom out the cycleways disappear
underneath the other �highway� I would like my renderer to do the

Victor Shcherb

unread,
Dec 4, 2011, 7:09:47 AM12/4/11
to osm...@googlegroups.com
No, OsmAndMapCreator doesn't deal with relations, only with points/ways.

I guess it is not difficult file format. You can lookup all matches of 'cycleway' and figure out how to change color of :
<filter tag="highway" value="cycleway" color="#0000ff" pathEffect="2_2">
That line you probably look for.


Victor

2011/12/4 yvecai <yve...@gmail.com>
To have highway=cycleway rendered on top, you should rise its 'order' value in the <order></order> section of your render.xml file.
Concerning route=bicycle, I'm not sur if OsmAndMapCreator indexer cares about relations.
Yves


On 04. 12. 11 08:16, Pavol Zibrita wrote:
I don't know however, you can try to search the forum, there was already
lot of discussion regarding the renderer. You might find what you
seek there, or someone else has to reply.

Regards,
Pavol

On Fri, Dec 2, 2011 at 4:41 PM, PeeWee <peterv...@telfort.nl> wrote:
Well if there is no such a tutorial or internet page with some help I
will ask some questions here. Maybe someone can help.

My goal is to make a  renderer specifically for bicycle. I am not

completely satisfied with the default renderer (when in bicycle mode)

I would like a different color for “highway= bicycle” . I have managed

to do this. So far so good.
I would also like to render “highway = *” that are part off a relation

(route= bicycle, type=route). I have no idea if this is feasible or
not.
Another thing I would like is that “highway=cycleway” is rendered on
top of other “highway= *”  This is because in the Netherlands (and

other countries as well) cycleways are very often next to primery/
secondary/tertiary roads. When I zoom out the cycleways disappear
underneath the other “highway” I would like my renderer to do the

PeeWee

unread,
Dec 4, 2011, 10:04:19 AM12/4/11
to Osmand
Well thanks all for your reply. I was afraid I was a lone-bike-rider
here at Osmand ;-)

Let me first apologize for the length of this reply. Before I get back
to you I’ll tell you where I come from. I live in the Netherlands
which is almost a cyclist paradise. Lots of safe cycleways and a very
good bicycle infrastructure. I got involved with OSM because I use a
Garmin GPS device with maps based on OSM. The most popular OSM
cycling map for Garmin in NL is the free Openfietsmap
(www.openfietsmap.nl). (OFM). This map is available for the BeNeLux
and Germany and has some great features for cyclist. To get an idea of
what this map looks like try this link http://i44.tinypic.com/21l1zj6.jpg
. This is a screenshot of the map in NL. This shows some cycling
related details. Most important are these:
Solid red line: paved cycleway (highway=cycleway, surface = asphalt,
concrete etc.)
Dotted red line: Semi paved cycleway (highway=cycleway,
surface=gravel, etc.)
Dotted blue line: cycleroute (highway=*, Relation: type=route,
route=bicycle)

So a blue dotted/red solid line means that it is a paved cycleway that
is part of a cycleroute.
A blue/dotted/ white solid line means that is a ordinary road
(residential, unclassified etc.) that is part of a cycleroute.

Note that the blue dotted lines (cycleroute) can be on all sorts of
“highways” such as cycleway, track, residential, unclassified etc. The
blue dots derive from a route relation (type=route, route=bicycle).
@ Hardy: Here is the OSM relation that is shown on the map.
http://www.openstreetmap.org/?relation=553764

@ Hardy: Thanks a lot for your reply, I think I now understand what
the “order does. Regarding your first question: I like the layout of
this OFM but colors are not that important if this can be changed
easily by changing the render.xml. It is more important that we can
render things differently based on relations (route in this case),
surface etc. I prefer most “ highways” to be rendered with a black
edge for better visibility at high zooms.

I would really think it would be an improvement if Osmand would be
able to deal with relations. This way it would be possible to have all
cycle route networks available in Osmand. See this link to get an idea
http://cycling.lonvia.de/?zoom=9&lat=52.16823&lon=5.79791. A future
offline routingservice could also use the cycle networks to create
routes. (preference for cycle route networks) This is something the
OFM already does.

BTW: Relations (route, networks) are not exclusive for cyclist. See
http://wiki.openstreetmap.org/wiki/Relation:route

@ Pavel, Victor, Yves. Thanks for the reply. I will check previous
posts. I was just hoping there would be a internetpage explaining the
basics of the renderer format. For me it is still not clear what
attributes and values stand for. The kind of questions I still have
are:

• What does is pathEffect="2_2" mean and what other values are
possible?
• What is: strokeWidth_2, pathEffect_3="12_8_1_0" ,
• Can cycleways be rendered differently depending on their “surface=”
tags. (or any other for that matter)
Ut I will have a look at previous posts.

In short: I would the bicycle-renderer a bit more sophisticated but
have no idea if this is possible at this moment. The lack of relations
in Osmand unfortunately does not make it any easier.

It is also a shame that the current offline routingservice for cyclist
is nowhere near the possibilities of a Garmin device but I am sure
this will improve in the (near) future. Based on different OSM tags a
routing service for all kinds of cyclist should be feasible in the
future. If Osmand would provide extra preferences for cyclists such
as : Avoid unpaved, prefer cycleroutes, (or even more specific bases
on SOM tags) etc. this would mean a cyclists GPS Walhalla. (One has to
have a dream not? ;-))

NB
You can take a look at the OFM even if you do not have a Garmin GP.
If you want to see and use the Openfietsmap on a PC/MAC this can be
done by downloading Garmins Basecamp (http://www8.garmin.com/support/
download_details.jsp?id=4435 ) . After that download the basecamp/
mapsourse installer of the Openfietsmap Benelux or Germany
(www.openfietsmap.nl ) and install it. You now have the OFM installed.
Start Basecamp and see if you like it.

cheers PeeWee

Victor Shcherb

unread,
Dec 4, 2011, 4:42:30 PM12/4/11
to osm...@googlegroups.com
Hi
I will try to answer some simple points :
2) Any object-line can be drawn by many lines. Like motorway-bridge :
color_1 = black width_1 = 14   (first is solid black line)
color_2 = white width_2 = 13 pathEffect_2=2_3_4_5 (second is white dashed line 2-line, 3-space, 4-line, 5-space) http://developer.android.com/reference/android/graphics/DashPathEffect.html

3) Creating route maps is actually good. But in that case many of the work can be done on preparation step. So you can create OSM file combining all relations cycleway to 'cycleway' ways and after that run OsmAndMapCreator on top of it.

I really doubt that relations will be supported on device. Anyway it should be part of preparation work such as Transport Routes or Hiking Routes.
For instance people are creating contour/elevation maps for Osmand using scripts from different sources. And I remember creation of world base map from different source using XML transformations.

The task to transform initial OSM file to the target (that will contain only ways with preferrable attributes) can be done as Osmosis plugin! That would be scalable solution I think.

Workaround : currently multitag issue can be solved if you change original tags to something like cycleway_paved, cycleway_route and put special rendering rules into render.xml. 

Best Regards,
Victor

2011/12/4 PeeWee <peterv...@telfort.nl>

PeeWee

unread,
Dec 5, 2011, 1:00:41 AM12/5/11
to Osmand
Thanks Victor

Although do not understand everything (yet) it has given my some more
hints to a solution I am looking for. I will have a look at the
Osmosis plugin. Looks promising. The workaround also may be a
solution. I think this may be sort of the same thing as transformig
OSM data into Garmin format with mkgmap style files.

The thing that puzzles me is what the effect of these solutions will
be on the offline routingservice. Can this service be altered to
handle tags like "cycleway_paved" etc so that routing differs
depending on these newly created tags?

Cheers Peter


Victor Shcherb

unread,
Dec 5, 2011, 9:26:02 AM12/5/11
to osm...@googlegroups.com
Offline routing service is not very smart now and in future it was planned to make completely independent from Map rendering. And for sure it will support osm base functionality.

For now I don't know any workarounds, so the offline routing doesn't deal with it.
But for rendering there is workaround. You can also check thread about custom maps/rendering sky pistes.

Best Regards,
Victor

2011/12/5 PeeWee <peterv...@telfort.nl>

PeeWee

unread,
Dec 7, 2011, 1:14:07 PM12/7/11
to Osmand
Thanks Victor

I hope offline routing will improve soon (especially for cycling) . As
for now I will just change some rendering accorinding to my liking. I
have already changed color and width of the cycleways. See
http://tinypic.com/r/i24pqb/5
I would now like to change mayor highways so that they have a black
edge for better visibility. I have seen this with the free app
NavFree. See http://tinypic.com/r/i24pqb/5

While making the screenshots on my Samsung galaxy Gio I ran into a
possible Osmand bug but I am not sure. When you want to capture a
screen you have to touch and hold the "back" button of the device and
push the main button. On Navfree (and other apps) this works fine. On
Osmand this is impossible. It looks like (in Osmand) the Back button
is applied when TOUCHING. On the other apps it seems to be applied
when RELEASED.

For this reason the Osmand capture shows some menu-items because this
seems to be the only way to take a capture.

Cheers PeeWee

Hardy

unread,
Dec 8, 2011, 3:45:33 AM12/8/11
to Osmand
Hey PeeWee,

One thing to keep in mind here is: If you give all roads a black edge,
you will not see the bridges any longer, as they are customarily
depicted by black edges ...

That's why roads have the dark grey edges in default rendering,
sufficently different from black.

Which roads exactly are you talking about? All of them, or only the
"white roads"? Because I think the visibility issue maybe exists only
with the 'white' roads on a default color background?

Best,
Hardy

On 7 Dez., 19:14, PeeWee <petervanwe...@telfort.nl> wrote:
> Thanks Victor
>
> I hope offline routing will improve soon (especially for cycling) . As
> for now I will just change some rendering accorinding to my liking. I

> have already changed color and width of the cycleways. Seehttp://tinypic.com/r/i24pqb/5


>  I would now like to change mayor highways so that they have a black
> edge for better  visibility. I have seen this with the free app

> NavFree. Seehttp://tinypic.com/r/i24pqb/5

PeeWee

unread,
Dec 8, 2011, 1:33:40 PM12/8/11
to Osmand

Thanks Hardy for your post

On my "quest" to change rendering I found exactly the black edge I was
looking for on bridges. I am no expert on XML so I just looked for
the word Bridge in de file and soon found out what I had to change to
give this edge to all rouds. So far I have added edges to bigger
highways (Motorway, trunk, primary ....tertiary, uncllassified) and
changee color to my liking. Cycleways ar solid red without the edge. I
do not mind that I do not see bridges anymore. If a road crosses a
river it is very likely that there may be a bridge ;-)
I have tried to give the map a "Openfietsmap" look.

I agree that especially the white roads on the map were hard to see
in some cases. That problem is solved now.

One thing that still bothers me is that the edges of roads are also
visible on road intersections. See : http://i43.tinypic.com/ilhyrt.png
That may have something to do with this code that I do not
understand:

filter cap_2="SQUARE" color="#000000" shadowRadius="0" cap="BUTT">

(what do "Square and BUTT do? )

Maybe you can help me here.

Cheers PeeWee

Hardy

unread,
Dec 8, 2011, 3:12:03 PM12/8/11
to Osmand
H PeeWee,

If I get you right,I think you are making it way too complcated
here ...

In order to produce a different "edge", I suggest you leave all
"bridge" code as is in my default, but simply play with the following:
(1) In section <renderingAttribute name="shadowRendering">, play with
the "ShadowColor" tag. As you can see in my comment in that section,
this defines the edge color itself. (Roads with shadow need to have
shadowLevel="1" tag.)
(2) You may in addition want to play with attrIntValue, there are 4
(0-3) different values of producing a shadow, with different
advantages and disadvantages (in default renderer the cutover is a
zoom 14, as you can see)

That shoudl resolve the issues you see, I think.
Let me know if I can help any further.

Best
Hardy

Hardy

unread,
Dec 8, 2011, 3:18:00 PM12/8/11
to Osmand
PS: I am not sure if you have come across the concept of a "depends"
renderer as yet: You can make you own renderer by using
<renderingStyle name="WHATEVER" depends="default" version="1">
in line 1, and then put only the stuff in your file you explicitly
want to differ from default renderer. All other rules will be taken
from there (this would automatically account for any future update of
the default renderer without any manual maintenance on your part).

> > Cheers PeeWee- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -

yvecai

unread,
Dec 8, 2011, 3:39:12 PM12/8/11
to osm...@googlegroups.com
Would this override existing rules?
Yves

Hardy

unread,
Dec 8, 2011, 4:45:15 PM12/8/11
to Osmand
Should. Please check out this example:
http://code.google.com/p/osmand/source/browse/DataExtractionOSM/src/net/osmand/render/test_depends.render.xml

> >> - Zitierten Text anzeigen -- Zitierten Text ausblenden -

PeeWee

unread,
Dec 9, 2011, 2:07:12 AM12/9/11
to Osmand

Thanks Hardy

I think you are right. My lack of knowledge of XML and the
understanding of the current default.render.xml has produced a map
that looks OK but I agree that my way of doing this is far from
perfect.The "depends" concept seems to be the way to go. If I
undersand correctly I have to make a seperate WHATEVER.render.xml
with only the things I want to differ. I'll look into your
suggestions.

Thanks again.

tamteram

unread,
Feb 23, 2013, 3:32:12 PM2/23/13
to osm...@googlegroups.com
Hi PeeWee.

I have found this old thread looking for the same thing you were working on: Making bike routes visible in OsmAnd. Did you get any further with your work? This would be very interesting for me!
Right now my alternate solution is to use tiles from OpenCycleMap (which marks all local, regional and long-distance bike routes), but the drawback is that it either needs an online connection (no-go in holidays abroad) or I have to pre-fetch the tiles, which is no good way for longer biking tours either.

Victor Shcherb

unread,
Feb 23, 2013, 5:30:14 PM2/23/13
to osmand
I think you better join the latest discussion because there is a big progress with that. So now we proccess all lcn, rcn,ncn network and all that information is in the file. We just missing a small piece of rendering.

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.
 
 

tamteram

unread,
Feb 25, 2013, 4:16:02 AM2/25/13
to osm...@googlegroups.com
OK, thank you for the reply. I have searched the group on recent discussions in this matter and it seems that this https://groups.google.com/forum/#!topic/osmand/39svypq1X48 is the most recent one.
I appreciate very much the work going on, and it would be great to see this new feature getting available in OsmAnd so the bicicle networks become visible on the maps.

I have a question on the status of this work, but I will post it in the discussion mentioned above.

dpkal...@gmail.com

unread,
Aug 3, 2015, 1:45:00 PM8/3/15
to Osmand, hm.gg...@googlemail.com

I am using OsmAnd+ Ver. 2.1.1 and would like to change the color to red and width of the gpx track. I have modified the default.render.xml. for gpx this way:

<renderingAttribute name="gpx">
     
<case strokeWidth="3:2" cap="ROUND">
         
<case nightMode="true" color="#b4b319ff"/>
         
<case additional="routePoints=true" pathEffect="6_5" color="#ffff0000"/>
     
<case color="#ffff0000"/></case>
</renderingAttribute>

I see no change in my gpx track style. Is there a problem with my modification or is changing one attribute in render.xml not as simple as this?

Harry van der Wolf

unread,
Aug 3, 2015, 1:51:55 PM8/3/15
to osmand
As OsmAnd does not entirely remove itself from memory (see the topics about exit/close button), your render file is not read again (and neither some other files like routing.xml etc). Please try to stop OsmAnd from a task manager or reboot your device.

And of course make sure your file is really named default.render.xml

Harry

--
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/d/optout.

dpkal...@gmail.com

unread,
Aug 3, 2015, 3:09:36 PM8/3/15
to Osmand
Thanks Harry,

Finally! Your suggestions about memory etc., got me to take another look at the OsmAnd file structure. I had used OsmAnd to move my files to the sd card. That worked fine. So I was putting my experimental render.xml files in this folder: SDcard>osmand>rendering/default.xml. Well, as I you probably know, that's not the location that should be used. The location that got things working is:

SDcard>Android>data>net.osmand.plus>files>rendering/default.render.xml.

What is the first default.xml used for?


Thanks, again.

Harry van der Wolf

unread,
Aug 4, 2015, 3:28:37 AM8/4/15
to osmand
The default.xml is more or less a template. 
You can also create derived render files where only parts are changed instead of modifying the default.render.xml. It's even better as changes/additions/fixes to the default.render.xml are also propagated to your derived render file.
If you take a look at https://github.com/osmandapp/OsmAnd-resources/tree/master/rendering_styles, you see that only the default.render.xml is a "complete" file. All the others are derivatives and only describe what's changed from the default. This "derivation" is reflected in the top line of those render files.
The default.render.xml has <renderingStyle name="default" depends="" defaultColor="#f1eae4" version="1">
As you can see it depends on nothing.
If I take any of the others, for example the UniRS, you see in the top line
<renderingStyle name="UniRS" depends="default" defaultColor="#f1eae4" version="1.2">
It depends on the default.render.xml (not the template).

Harry


P Wat

unread,
Aug 4, 2015, 8:02:05 AM8/4/15
to Osmand
Hi Harry.
If this question is off topic please let me know so I can raise a new one.
The solid purple route line obscures the road/track/path which is about to be followed.  This is a real nuisance because you cannot make your own judgement about whether it is suitable (surface/speed, etc).
Last December Jan van Bekkum provided a file to generate a route line which did not obscure the route.  This was really useful but the "recent" Osmand update reverted to solid purple route line.
Is your info about rendering relevant to this issue, or should I re-install Jan vB's files?
Thanks
PaulW
==============

Harry van der Wolf

unread,
Aug 4, 2015, 8:25:18 AM8/4/15
to osmand
It is indeed off topic :) , but I will answer it here as it is related.

If Jan vB's file was also a default.render.xml instead of a derived file, that would explain why your change is now gone. This means that you could copy Jan vB's file back, but that would mean that the changes done to the default.render.xml would be lost again.

That's exactly the reason why you should make a derived file and not a copy of the default.render.xml.
All colors are defined by there hexadecimal RGB values. This means 6 "digits" like #00FFFF . This means "no red, full green and full blue".
If you want transparency you have to add a hexadecimal value in front of it, which makes it an 8 "digit" value: 00 for full transparency and FF for opaque.
The current value for the gpx color is#B400FFFF, The B4 value means that it is close to opaque.
I assume that Jan used a much lower value like 99 or so. Please also keep in mind that with more transparency, a lower value, also the brilliance of the other colors is reduced giving a more "washed out" pale effect.

In this case I would make a derived render file like gpxcolor.render.xml, containing something like:

<?xml version="1.0" encoding="utf-8"?>
<renderingStyle name="gpxcolor" depends="default" defaultColor="#f1eae4" version="1">

<renderingAttribute name="gpxColor"> <!-- deprecated -->
<case attrColorValue="#b400ffff"/>
</renderingAttribute>

<renderingAttribute name="gpx">
<case strokeWidth="7:6" cap="ROUND">
<case nightMode="true" color="#b4b319ff"/>
<case additional="routePoints=true" pathEffect="6_5" color="#b400ffff"/>
<case color="#b400ffff"/>
</case>
</renderingAttribute>

</renderingStyle>


Note that I used both the old deprecated gpxcolor value as well as the new gpx attribute.
Play with (reduce) the b4 value until you are satisfied.

Note also that when selecting a new render file it is displayed immediately, but upon changes of the a render file, as mentioned in the above posts, that you really need to close OsmAnd by using a task manager or reboot your phone/device to get the wanted effect.

Harry


P Wat

unread,
Aug 4, 2015, 10:22:19 AM8/4/15
to Osmand
Hello Harry
Thank you for the swift reply.

The significance of "default.render.xml" Vs "derived file" goes over my head but maybe that doesn't matter.

The file from JanVB on 30/12/14 was called GPXR08.render and contained:-

<?xml version="1.0" encoding="UTF-8"?>
-<renderingStyle version="1" defaultColor="#ffffff" depends="default" name="Route"> -<renderingAttribute name="route"> -<filter color="#FF0000" strokeWidth="4" pathEffect="4_8"> <filter nightMode="true"/> </filter> </renderingAttribute> -<renderingAttribute name="gpx"> -<filter color="#FF0000" strokeWidth="2"> <filter nightMode="true"/> </filter> </renderingAttribute> </renderingStyle>

Would it have much the same effect?
I will try yours' first, anyway.  Thank you.

Regards
Paul W
===========

Harry van der Wolf

unread,
Aug 4, 2015, 12:47:33 PM8/4/15
to osmand
Hi,

What I meant with derived should actually be parent-child. 
The default.render.xml is the parent. All the other render files are chillds (depends="default"). 
All attributes are inherited from the parent except the ones you specify in the child.

The original gpxcolor is a greenish color. My example simply makes that greenish color more transparent.

Jan's example creates a red dashed line for a route and a narrow red line for the gpx track. No transparency.
But the file structure is weird and the dashed line should have two color values (if this is the complete file).

Harry

dpkal...@gmail.com

unread,
Aug 4, 2015, 1:42:24 PM8/4/15
to Osmand
Hello Harry,

I tried adding your gpxcolor.render.xml to my SDcard>Android>data>net.osmand.plus>files>rendering/ folder and the map displayed the default gpx color, not the one in gpxcolor.render.xml. If, however, I repeated what I did initially, putting the full default.render.xml into the above folder with the gpx color modified then the tracks show the modified color.

I noticed another thing. If there is no file with the name default.render.xml in the above rendering folder, say I delete it, then it appears there when I again start up OsmAnd. It seems like it's being automatically copied there if there a default.render.xml there when OsmAnd is started.

Thoughts? Hope my description isn't too confusing.

Harry van der Wolf

unread,
Aug 4, 2015, 4:44:30 PM8/4/15
to osmand
I can't answer your first observation. It can also be a minor bug in OsmAnd (there are more).

The default.render.xml is packed within the apk (among with a few other config files). Upon installation this file is copied into the correct folder. And when you remove it, either on purpose or by accident, it is copied back again from inside the apk upon restart. You can replace the default.render.xml by another default.render.xml. Only the fact whether the file exists is checked, not the contents or a CRC-check or something like that.

I did not use another color in my gpxcoler example. I used a slightly more transparent color.

dpkal...@gmail.com

unread,
Aug 4, 2015, 5:14:08 PM8/4/15
to Osmand
The behavior you describe with the default.render.xml file is what I'm observing.

Furthermore, now I see gpxcolor as one of the choices in the Vector renderer list under Map style. When I select it, the gpx tracks are displayed as styled in gpxcolor.xml. When I select OsmAnd as the vector renderer, the tracks return to the default style. So it seems to be working as expected...at least for now :)

Thanks again for your help.

P Wat

unread,
Aug 4, 2015, 5:52:02 PM8/4/15
to Osmand
Harry. Can you clarify (because I'm not accustomed to manipulating the innards of the app)
In my device, Osmand, rendering, there are 6 files; GPXR08, default, LightRS, nautical, Touring-view.....detals), UniRS.  all ending in .render.
Should I take one out?  Which one? What should be the name of the replacement file? Should it consist of your entire text (below), and should anything else be in the "new" file?
Will this give me a route line which is not thick solid purple, and will it be possible to adjust it as you described earlier.  (I do understand Hex-RGB values)
Thanks
Paul W
================

<?xml version="1.0" encoding="utf-8"?>
<renderingStyle name="gpxcolor" depends="default" defaultColor="#f1eae4" version="1">

<renderingAttribute name="gpxColor"> <!-- deprecated -->
<case attrColorValue="#b400ffff"/>
</renderingAttribute>

<renderingAttribute name="gpx">
<case strokeWidth="7:6" cap="ROUND">
<case nightMode="true" color="#b4b319ff"/>
<case additional="routePoints=true" pathEffect="6_5" color="#b400ffff"/>
<case color="#b400ffff"/>
</case>
</renderingAttribute>

</renderingStyle>
==================

stf

unread,
Aug 4, 2015, 6:31:09 PM8/4/15
to Osmand
You shouldn't have to manipulate the innards of the app.

1. Take that XML you have posted, put it into a file with a name like gpxcolor.render.xml (the "render.xml" is significant).
2. Put that file in the osmand rendering folder. On my phone without an actual micro SD card the path is /sdcard/osmand/rendering
3. Exit osmand (on newer versions you will need to kill it through the settings->apps or reboot your phone)
4. Start osmand.
5. Select display style. On current versions that is via the little layers icon at the top left of the screen. You will want to select "gpxcolor" as that is the name given to the style in the XML you posted.

Hardy

unread,
Aug 5, 2015, 1:41:26 AM8/5/15
to dpkal...@gmail.com, Osmand, Hardy
In principal that's how it should work, the question is how do you use the new render.xml? Maybe renaming it and explicitly selecting it (under  the Map Style menu) will solve your issue.
 
I also know we had a small bug in this area, I noticed when I did introduce the GPX color and GPX width menu for the Touring view Map style.  This feature is part of the current nightly builds (under the Configure Map menu), and will be in the next release. Best - Hardy

dpkal...@gmail.com

unread,
Aug 11, 2015, 12:51:45 PM8/11/15
to Osmand
I have been able to change both the gpx track width and color and that is working well. I now realize that the same values are used in the Pedestrian and Car profiles. A thin track works well for Pedestrian, but is a bit too thin for Car because the map is generally zoomed out further when tracking a car as opposed to Pedestrian.

Can the track width and color be configured differently for Car and Pedestrian? One way would be to have a separate render.xml file for each profile and go into the Map Style menu and select a different rendering file. Is there an easier way which would change the track values when the Car or Pedestrian profiles is selected?

Harry van der Wolf

unread,
Aug 11, 2015, 1:34:11 PM8/11/15
to osmand
Yes, you can.

Look for the many occurrences of "<case appMode="car"" (same for bicycle/pedestrian)
and for "<apply_if appMode="pedestrian"" (same for car/bicycle)
and for a few "<switch appMode="pedestrian">" (same for car/bicycle)

some examples:  
<apply_if appMode="car" tag="highway" value="pedestrian" strokeWidth_2="0" strokeWidth_3="0"/>

<case appMode="bicycle" minzoom="14" additional="bicycle=designated" color_5="$cyclewayColor" pathEffect_5="4_2" strokeWidth_5="1:1"/> 

This should give you some hints.

Harry

Harry van der Wolf

unread,
Aug 11, 2015, 1:43:26 PM8/11/15
to osmand
And some extra hints:
And at lines to 5796 to 5832. 

search also for "trackline".

This should give you even more hints. 

(Already some time ago I fiddled with render options)

dpkal...@gmail.com

unread,
Aug 11, 2015, 2:08:15 PM8/11/15
to Osmand
Thanks, I'll take a look at your suggestions.

Peter B

unread,
Aug 12, 2015, 2:34:34 AM8/12/15
to Osmand
After some tests it looks like, that the settings for color/with can be made different for different profiles, but the switching does not work correctly.
Tested with #12455.
Hope for soon fixing.
Regards Peter

Harry van der Wolf

unread,
Aug 12, 2015, 2:51:28 AM8/12/15
to osmand
I have seen that in the past as well. When switching to another appmode the specific appmode switches are not applied.
To test whether I did it correct, I set the default profile to the profile I changed (bicycle for example) and really stopped OsmAnd and restarted it again coming up in the app profile I had set as default.
This is already an ages old bug, which seems to appear and disappear (ir)regularly.

Harry

dpkal...@gmail.com

unread,
Aug 12, 2015, 6:31:57 AM8/12/15
to Osmand
I took a look at some of your suggestions and I think I'll leave it to others who know more about the code than I do.

What I did do is make a separate track width and color render.xml for Car. I now have one for Pedestrian and Car. When I want to change, I go into the Map Style>Vector Render menu and select the appropriate file.
Reply all
Reply to author
Forward
0 new messages