Use of is_in in style

Hi Jan, the result of the is_in discussion was the ResidentialHook which computes the special tag mkgmap:residential. It would be possible to duplicate the code to calculate also a tag for landuse=cemetary. Not sure if that makes sense? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von jan_m23@gmx.net <jan_m23@gmx.net> Gesendet: Montag, 9. Dezember 2019 13:15 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: [mkgmap-dev] Use of is_in in style Can mkgmap use is_in to filter out objects inside specific (multi)polygons? In my case I´d like to unify ways inside cemeteries/grave-yards, e.g.
highway=* & is_in:landuse=cemetery {set highway=path}
Check-styles isn´t complaining of the syntax, but the rule has no effect. Similar has been discussed here, but without particular answer: http://gis.19327.n8.nabble.com/is-in-filter-td5890564.html#a5890836 Thanks

Hi Jan, attached source could replace ResidentialHook. It implements new option --x-is-in-landuse so that one can use e.g. --x-is-in-landuse=residential,cemetery,industrial Without any option it works like the old ResidentialHook. For each given value, mkgmap checks if an element is inside a landuse with that value, if so, it adds the corresponding tag like mkgmap:residential or mkgmap:industrial This is all done before the style rules are executed, so all calculations are done for all elements. With a bit more work I can also add other polygon tags like natural=* or place=* but it would probably slow down mkgmap and require a lot more heap. A binary compiled with this is source is here: http://files.mkgmap.org.uk/download/458/mkgmap.jar Please try if it works for you. I'd prefer to have a general style function like is_in which could be used with is_in(landuse=cemetery) or is_in(natural=wood) but I have no idea how to implement the syntax parser etc. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com> Gesendet: Montag, 9. Dezember 2019 14:18 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Use of is_in in style Hi Jan, the result of the is_in discussion was the ResidentialHook which computes the special tag mkgmap:residential. It would be possible to duplicate the code to calculate also a tag for landuse=cemetary. Not sure if that makes sense? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von jan_m23@gmx.net <jan_m23@gmx.net> Gesendet: Montag, 9. Dezember 2019 13:15 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: [mkgmap-dev] Use of is_in in style Can mkgmap use is_in to filter out objects inside specific (multi)polygons? In my case I´d like to unify ways inside cemeteries/grave-yards, e.g.
highway=* & is_in:landuse=cemetery {set highway=path}
Check-styles isn´t complaining of the syntax, but the rule has no effect. Similar has been discussed here, but without particular answer: http://gis.19327.n8.nabble.com/is-in-filter-td5890564.html#a5890836 Thanks _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Jan, sorry, I compiled the binary before removing some debug code. Here is a clean one: http://files.mkgmap.org.uk/download/459/mkgmap.jar Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com> Gesendet: Montag, 9. Dezember 2019 16:31 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Use of is_in in style Hi Jan, attached source could replace ResidentialHook. It implements new option --x-is-in-landuse so that one can use e.g. --x-is-in-landuse=residential,cemetery,industrial Without any option it works like the old ResidentialHook. For each given value, mkgmap checks if an element is inside a landuse with that value, if so, it adds the corresponding tag like mkgmap:residential or mkgmap:industrial This is all done before the style rules are executed, so all calculations are done for all elements. With a bit more work I can also add other polygon tags like natural=* or place=* but it would probably slow down mkgmap and require a lot more heap. A binary compiled with this is source is here: http://files.mkgmap.org.uk/download/458/mkgmap.jar Please try if it works for you. I'd prefer to have a general style function like is_in which could be used with is_in(landuse=cemetery) or is_in(natural=wood) but I have no idea how to implement the syntax parser etc. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com> Gesendet: Montag, 9. Dezember 2019 14:18 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Use of is_in in style Hi Jan, the result of the is_in discussion was the ResidentialHook which computes the special tag mkgmap:residential. It would be possible to duplicate the code to calculate also a tag for landuse=cemetary. Not sure if that makes sense? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von jan_m23@gmx.net <jan_m23@gmx.net> Gesendet: Montag, 9. Dezember 2019 13:15 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: [mkgmap-dev] Use of is_in in style Can mkgmap use is_in to filter out objects inside specific (multi)polygons? In my case I´d like to unify ways inside cemeteries/grave-yards, e.g.
highway=* & is_in:landuse=cemetery {set highway=path}
Check-styles isn´t complaining of the syntax, but the rule has no effect. Similar has been discussed here, but without particular answer: http://gis.19327.n8.nabble.com/is-in-filter-td5890564.html#a5890836 Thanks _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd, thanks a lot! I tried the binary with the new option and it works exactly as I want it. To the .args-file I added
x-is-in-landuse=residential,cemetery,industrial and to the beginning of lines highway=* & mkgmap:cemetery=* {set highway=path}
Result is, as expected, the unified representation of lines inside the asked landuse. Other landuse-tags seem to work as well, I also played with allotments successfully: —x-is-in-landuse=residential,cemetery,allotments,industrial So, even with this „rough“ approach only for landuse, it´s a huge step ahead. Hopefully the option will remain in later releases. Unfortunately, me either am not able to dig into code to generalize the function. Jan
Am 09.12.2019 um 17:28 schrieb Gerd Petermann <gpetermann_muenchen@hotmail.com>:
Hi Jan,
sorry, I compiled the binary before removing some debug code. Here is a clean one: http://files.mkgmap.org.uk/download/459/mkgmap.jar <http://files.mkgmap.org.uk/download/459/mkgmap.jar>
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk <mailto:mkgmap-dev-bounces@lists.mkgmap.org.uk>> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com <mailto:gpetermann_muenchen@hotmail.com>> Gesendet: Montag, 9. Dezember 2019 16:31 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Use of is_in in style
Hi Jan,
attached source could replace ResidentialHook. It implements new option --x-is-in-landuse so that one can use e.g. --x-is-in-landuse=residential,cemetery,industrial Without any option it works like the old ResidentialHook.
For each given value, mkgmap checks if an element is inside a landuse with that value, if so, it adds the corresponding tag like mkgmap:residential or mkgmap:industrial This is all done before the style rules are executed, so all calculations are done for all elements. With a bit more work I can also add other polygon tags like natural=* or place=* but it would probably slow down mkgmap and require a lot more heap. A binary compiled with this is source is here: http://files.mkgmap.org.uk/download/458/mkgmap.jar Please try if it works for you.
I'd prefer to have a general style function like is_in which could be used with is_in(landuse=cemetery) or is_in(natural=wood) but I have no idea how to implement the syntax parser etc.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen@hotmail.com> Gesendet: Montag, 9. Dezember 2019 14:18 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Use of is_in in style
Hi Jan,
the result of the is_in discussion was the ResidentialHook which computes the special tag mkgmap:residential. It would be possible to duplicate the code to calculate also a tag for landuse=cemetary. Not sure if that makes sense?
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von jan_m23@gmx.net <jan_m23@gmx.net> Gesendet: Montag, 9. Dezember 2019 13:15 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: [mkgmap-dev] Use of is_in in style
Can mkgmap use is_in to filter out objects inside specific (multi)polygons?
In my case I´d like to unify ways inside cemeteries/grave-yards, e.g.
highway=* & is_in:landuse=cemetery {set highway=path}
Check-styles isn´t complaining of the syntax, but the rule has no effect.
Similar has been discussed here, but without particular answer: http://gis.19327.n8.nabble.com/is-in-filter-td5890564.html#a5890836
Thanks _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev <LanduseHook.java>_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk <mailto:mkgmap-dev@lists.mkgmap.org.uk> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev <http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev>
participants (3)
-
Gerd Petermann
-
jan meisters
-
jan_m23@gmx.net