logo separator

[mkgmap-dev] styles and multipolygons

From Ticker Berkin rwb-mkgmap at jagit.co.uk on Wed Jun 21 19:01:50 BST 2023

Hi Diego

It is probably better to have something like this in "lines":

natural=valley & is_closed()=false [0x12005 resolution 21]

then the rule won't be triggered for closed ways and will be passed on
to "polygons" processing:

natural=valley [0x10f09 resolution 21]

If you wanted both line and polygon, remove the & is_closed() and add
continue in the "lines" [].

Looking at some examples I had of something similar I have also tests
for mkgmap:mp_created=true and area!=yes as well - I'm not sure how
significant these would be for your usage/

You shouldn't need the {name ...} bit if your style is like the default
style and handles this generally after the <finalize>

Hope this helps

On Wed, 2023-06-21 at 15:37 +0000, helter skelter wrote:
> Hello
> I am rendering lines that are tagged NATURAL=VALLEY to show the name
> along a trasparent line on the map, using this style code:
>       natural=valley    { name '${name}'
> }                                          [0x12005 resolution 21]
> It works, but gives a problem with multipolygons that use the same
> tag: I get the name all along the borders of the polygon, while I
> would want to see it only inside.
> Following the style manual (page 11) I am then trying with this code
> in LINES style file:
>       natural=valley & !(is_in(type,multipolygon,on)) { name
> '${name}' }                        [0x12005 resolution 21]
> and this in POLYGON style file:
>       natural=valley  { name '${name}' }
>                                                                    [0
> x10f09 resolution 21]
> It now works for multipolygons: I see the name only inside, and not
> along the boundaries.
> But doesn't work anymore for lines, meaning that I don't get the name
> anymore.
> What am I doing wrong ?
> This is one of the areas with multipolygons tagged as valley, if you
> want to take a look:
> https://www.openstreetmap.org/#map=14/46.2816/9.6947
> Thank you in advance
> Diego
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

More information about the mkgmap-dev mailing list