logo separator

[mkgmap-dev] area_size() function to be used in points file

From Gerd Petermann gpetermann_muenchen at hotmail.com on Thu Apr 19 10:49:38 BST 2018

Hi Joris,

thanks for testing. The severe messages were introduced with the latest patches from Ticker:
http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap&rev=4167

The added source in Subdivision.java:
                if (w <= 0) { // think can get this from empty/unbounded maps
                        log.error("Subdivision neg width ", w, "min=", area.getMinLong(), "mid=", longitude, "max=", area.getMaxLong(), "shift=", shift, "mask=", mask, "@", getCenter());
                        w = 0x7fff;
                }

@Ticker:
I don't know why we have those new messages?

Gerd

________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Joris Bo <jorisbo at hotmail.com>
Gesendet: Donnerstag, 19. April 2018 09:31:40
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] area_size() function to be used in points file

Hi Gerd,

I tested this version and I do see a 'severe (subdivision) error', but the map is created successfully and area_size is available at poi-level.
Does it make sense to already test larger maps or does this first needs finetuning?

===========
Node generated from 29044917 [building=yes, jbprocessedpoints=true, leisure=sports_centre, mkgmap:admin_level2=NOR, mkgmap:admin_level4=Oslo, mkgmap:admin_level7=Oslo, mkgmap:admin_level9=Nordstrand, mkgmap:area2poi=true, mkgmap:cache_area_size=2658.291, mkgmap:country=NOR, name=Ekeberghallen] all

Way 29044917 [building=yes, jbprocessedlines=true, leisure=sports_centre, mkgmap:admin_level2=NOR, mkgmap:admin_level4=Oslo, mkgmap:admin_level7=Oslo, mkgmap:admin_level9=Nordstrand, mkgmap:cache_area_size=2658.291, name=Ekeberghallen] all

Way 29044917 [building=yes, jbprocessedlines=true, jbprocessedpolygons=true, leisure=sports_centre, mkgmap:admin_level2=NOR, mkgmap:admin_level4=Oslo, mkgmap:admin_level7=Oslo, mkgmap:admin_level9=Nordstrand, mkgmap:cache_area_size=2658.291, mkgmap:city=Nordstrand, mkgmap:country=NOR, mkgmap:region=Oslo, name=Ekeberghallen] all

===========
SEVERE (Subdivision): C:\Temp\Garmin\8030 - JBM - TypTest\Output Splitter\80300001.osm.pbf: Subdivision neg width  0 min= 495438 mid= 495438 max= 495439 shift= 0 mask= 0 @ 2789482/495438
SEVERE (Subdivision): C:\Temp\Garmin\8030 - JBM - TypTest\Output Splitter\80300001.osm.pbf: Subdivision neg height  0 min= 2789482 mid= 2789482 max= 2789483 shift= 0 mask= 0 @ 2789482/495438

===========





-----Oorspronkelijk bericht-----
Van: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> Namens Gerd Petermann
Verzonden: donderdag 19 april 2018 09:09
Aan: Development list for mkgmap <mkgmap-dev at lists.mkgmap.org.uk>
Onderwerp: Re: [mkgmap-dev] area_size() function to be used in points file

Hi all,

the attached patch is an improved version of the poi_aera.patch from 2017-09-30.
Like the first version it adds the tag mkgmap:cache_area_size to the POI generated for polygons, but now also for POI generated for multipolygons.
It also changes the value in the tag so that it is rounded to 1/1000 , so instead of  e.g.
"1211.34554234542"
you'll get
"1211.346"
when you evaluate style function area_size() or this special tag.

I guess nobody is interested in the precise value, but I did not want to remove all decimals. For example small buildings can have values below 1.

I think the additional computations are no problem and the rounding reduces the additional memory needed. A compiled binary is here:
http://files.mkgmap.org.uk/download/431/mkgmap.jar

If I hear no complains I'll commit this patch on sunday.

Gerd

________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <gpetermann_muenchen at hotmail.com>
Gesendet: Donnerstag, 19. April 2018 08:01:58
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] area_size() function to be used in points file

Hi Joris,

ah, sorry, I did not notice the date, so I referred to the latest patch reg. mkgmap:cache_area_size, and I totally forgot about this older one.
I'll have a closer look reg. the side effects of the patch today.

Gerd



________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Joris Bo <jorisbo at hotmail.com>
Gesendet: Donnerstag, 19. April 2018 07:20:44
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] area_size() function to be used in points file

Hi Gerd,

Yes, the only change in between was the mkmap.jar file.
In both situations it looks like its processing the points file first, then the lines and then de polygons. I don't; know if that's the common order.

In your post form 30-9 you wrote that you use a dirty trick which causes possible extra memory consumption. Probably for that reason it never ended up in the main branch?

Gr Joris


Your post from 30-9-2017 says
=================================================================================================
[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
=================================================================================================



-----Oorspronkelijk bericht-----
Van: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> Namens Gerd Petermann
Verzonden: woensdag 18 april 2018 23:13
Aan: Development list for mkgmap <mkgmap-dev at lists.mkgmap.org.uk>
Onderwerp: Re: [mkgmap-dev] area_size() function to be used in points file

Hi Joris,

the patch was for the use in the lines file, and I think I've committed it unchanged:
http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap&rev=4159

I have no idea why the generated POI for way 29044917  has different attributes, the patch was for way members of multipolygon relations. I don't even understand how the POI can have the mkgmap:cache_area_size tag.
The tag is added by the code that handles multipolygons and by the style function area_size, which only works with ways.
My current understanding is that the POI is generated before the evaluation of the style, so I don't see a way that the tag is assigned by mkgmap. I assume that you used the same input files and options for the above results?

Gerd

________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Joris Bo <jorisbo at hotmail.com>
Gesendet: Mittwoch, 18. April 2018 22:39:40
An: Development list for mkgmap
Betreff: [mkgmap-dev] area_size() function to be used in points file

Hello Gerd

A while a go (30-9-2017) you made a patch to make the usage of  the area_size() function available in the points-file through the mkgmap:cache_area_size  value.
I used it to only display names and symbols on bigger area's to avoid cluttering.

In the latest releases up to 4165 you mentioned fixes with 'area_size()' being not  yet branched and some others  which are branched. I lost the overview a little bit.

I tested the special build of 30-9-2017 which does make the mkgmap:cache_area_size  value available in the points file. (Example 1) and compared it to the mkgmap build 4165 (Example 2) which does not.

Does this mean this feature is not branched or can I achieve a similar result else way?
Thanx in advance

Kind regards
Joris

mkgmap 30-9-2017 Example 1 (ok - mkgmap:cache_area_size available in poi)
-----------------------------------------------------------------------------------------------------------------------------------
Node generated from 29044917 [building=yes, jbprocessedpoints=true, leisure=sports_centre, mkgmap:admin_level2=NOR, mkgmap:admin_level4=Oslo, mkgmap:admin_level7=Oslo, mkgmap:admin_level9=Nordstrand, mkgmap:area2poi=true, mkgmap:cache_area_size=2658.2913818359375, mkgmap:country=NOR, name=Ekeberghallen] all

Way 29044917 [building=yes, jbprocessedlines=true, leisure=sports_centre, mkgmap:admin_level2=NOR, mkgmap:admin_level4=Oslo, mkgmap:admin_level7=Oslo, mkgmap:admin_level9=Nordstrand, mkgmap:cache_area_size=2658.2913818359375, name=Ekeberghallen] all

Way 29044917 [building=yes, jbprocessedlines=true, jbprocessedpolygons=true, leisure=sports_centre, mkgmap:admin_level2=NOR, mkgmap:admin_level4=Oslo, mkgmap:admin_level7=Oslo, mkgmap:admin_level9=Nordstrand, mkgmap:cache_area_size=2658.2913818359375, mkgmap:city=Nordstrand, mkgmap:country=NOR, mkgmap:region=Oslo, name=Ekeberghallen] all

mkgmap-4165 Example 2  ('not ok' - mkgmap:cache_area_size not available in poi anymore)
-----------------------------------------------------------------------------------------------------------------------------------
Node generated from 29044917 [building=yes, jbprocessedpoints=true, leisure=sports_centre, mkgmap:admin_level2=NOR, mkgmap:admin_level4=Oslo, mkgmap:admin_level7=Oslo, mkgmap:admin_level9=Nordstrand, mkgmap:area2poi=true, mkgmap:country=NOR, name=Ekeberghallen] all

Way 29044917 [building=yes, jbprocessedlines=true, leisure=sports_centre, mkgmap:admin_level2=NOR, mkgmap:admin_level4=Oslo, mkgmap:admin_level7=Oslo, mkgmap:admin_level9=Nordstrand, mkgmap:cache_area_size=2658.2913818359375, name=Ekeberghallen] all

Way 29044917 [building=yes, jbprocessedlines=true, jbprocessedpolygons=true, leisure=sports_centre, mkgmap:admin_level2=NOR, mkgmap:admin_level4=Oslo, mkgmap:admin_level7=Oslo, mkgmap:admin_level9=Nordstrand, mkgmap:cache_area_size=2658.2913818359375, mkgmap:city=Nordstrand, mkgmap:country=NOR, mkgmap:region=Oslo, name=Ekeberghallen] all

_______________________________________________
mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


More information about the mkgmap-dev mailing list