logo separator

[mkgmap-dev] New branch is-in for experiments on style function is_in

From Gerd Petermann GPetermann_muenchen at hotmail.com on Mon Dec 30 10:47:53 GMT 2019

Hi all,

with the help of Ticker I see a way to implement an is_in style function 
I've created branch is-in to experiment with this. Sorry for the different spelling is-in in the branch name!

Unfortunately I got no response regarding the contents of the file is-in-hook-samples-v2.osm  posted here:
http://gis.19327.n8.nabble.com/Test-cases-for-possible-is-in-hook-tp5954103.html
So, Ticker and I have to guess what the function should do when a way or polygon crosses or touches the boundary of
a polygon with the given attribute.

The code in r4400 implements a function is_in with three parameters which returns either true or false.
It allows a rule like this in the lines file:
highway=* & bicycle!=* & (is_in(landuse,cemetery,all) = true | is_in(amenity,grave_yard,all) = true) {add bicycle=dismount}

or this one in the polygons file:
# render building only when completely outside of a residential area
building=* & building!=no & is_in(landuse,residential,any)=false [0x13 resolution 24]

A BIG question mark is the handling of rules which change the tags of polygons. 
Assume you have a rule like this in polygons:
landuse=residential | landuse=commercial {set mylanduse=xyz}
and somewhere else
building=* & building!=no & is_in(mylanduse,xyz,any)=false [0x13 resolution 24]

It might not be obvious but this could produce more or less unpredictable results as it depends on the 
order in which elements are processed. 

So, Ticker suggested to say "results of the is_in function are undefined when tags of polygons are changed".
I hope we can change this to something like "changing tags of polygons in the style rules has no effect on the results of the is_in function"
by creating copies of elements before the style rules are applied.

Gerd


More information about the mkgmap-dev mailing list