logo separator

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

From Joris Bo jorisbo at hotmail.com on Sat Sep 30 11:18:04 BST 2017

Hallo Gerd

Thanx for your quick response, how cool is that!
Your solution works perfect. For me personally the memory consumption is not an issue as modern laptops have 8gb-16gb of memory, but I can imagine that you care.

I used it right away
	leisure = golf_course & mkgmap:cache_area_size > 10000 [0x3b05 resolution 20 continue]
	leisure = golf_course & mkgmap:cache_area_size < 10000 [0x3b05 resolution 24]

Hopefully you implement this change or similar in an official build.
I agree on the rounded number, no need for decimal values, mayby it helps memory consumption a little bit

FYI: I'm working on a Style-file and TYP-file to create a garmin map which is identical to the www.openstreetmap.org Mapnik default style layer.
On the higest zoomlevel 22-24 its already identical, on the lower zoomlevels there is still some work todo
I started two months ago from your default style.
Most recent style en typ in the zip

Thx Again,

Met vriendelijke groet,

Joris Bovens


T: +31 (0) 887 751 300
M: 0031 653 233 898
E: joris.bovens at perfectview.nl
W: www.perfectview.nl

-----Oorspronkelijk bericht-----
Van: mkgmap-dev [mailto:mkgmap-dev-bounces at lists.mkgmap.org.uk] Namens Gerd Petermann
Verzonden: zaterdag 30 september 2017 07:10
Aan: Development list for mkgmap <mkgmap-dev at lists.mkgmap.org.uk>
Onderwerp: Re: [mkgmap-dev] mkgmap:area2poi in combination with area_size()

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 ...}

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:
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:

Please let me know if this works for you.
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()


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: Style - Joris.zip
Type: application/x-zip-compressed
Size: 76771 bytes
Desc: Style - Joris.zip
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20170930/4d40c695/attachment-0001.bin>

More information about the mkgmap-dev mailing list