logo separator

[mkgmap-dev] mkgmap:area2poi in combination with area_size()

From Gerd Petermann GPetermann_muenchen at hotmail.com on Sat Sep 30 06:10:01 BST 2017

Hi Joris,

I see no easy way to calculate the value on demand, but the function area_size() sets a tag mkgmap:cache_area_size when called for the first time.
The attached patch uses this feature for a rather dirty trick. It calls the functionn before the node for the POI is generated, therefore the new tag is also copied to the node.
So, you can use something like
mkgmap:area2poi=true & mkgmap:cache_area_size > 1000 {do something ...}

Disadvantage:
The area size is calculated for all polygons, and additional memory is needed to store the value as the tag is added to the polygon way and the POI.

BTW: The current code calculates and stores the value like this:
mkgmap:cache_area_size="45.771240234375"
I assume it would be good enough to store the rounded value as
mkgmap:cache_area_size="46"

A compiled binary can be found here:
http://files.mkgmap.org.uk/download/358/mkgmap.jar

Please let me know if this works for you.
Gerd
________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Joris Bo <jorisbo at hotmail.com>
Gesendet: Freitag, 29. September 2017 19:22
An: mkgmap-dev at lists.mkgmap.org.uk
Betreff: [mkgmap-dev] mkgmap:area2poi in combination with area_size()

Hello

Using the mkgmap:area2poi feature it’s easy to create a poi for a polygon but i would like to combine that with the area_size() function
Eg. Only show poi-icons on larger areas (forest, industrial areas, commercial areas etc.) and not if they are small of size
Is there a way to achieve this?

mkgmap:area2poi is added after processing the ‘relations’ file, and in this relations file, area_size() is not supported
Can this property be made available by default or be added somewhere before processing the points file?

Thx in advance
Gr Joris Bovens
-------------- next part --------------
A non-text attachment was scrubbed...
Name: poi_aera.patch
Type: application/octet-stream
Size: 1348 bytes
Desc: poi_aera.patch
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20170930/544b6d5c/attachment.obj>


More information about the mkgmap-dev mailing list