Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-08 Thread Gerd Petermann
From: m...@tvage.co.uk To: mkgmap-dev@lists.mkgmap.org.uk Date: Fri, 9 Jan 2015 00:20:56 + Subject: Re: [mkgmap-dev] small issue with Way.getCofG() Hi Gerd/WanMil, I now have a mechanism working that has no performance overhead. I have derived a new class from Node and have moved the evaluation

Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-08 Thread Mike Baggaley
mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] small issue with Way.getCofG() Hi WanMil, yes, I had something like this in mind. StyledConverter could call the POIGenerator for each polygon. The POIGenerator creates a dummy node, opies the tags, adds the mkgmap:area2poi=true tag and

Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-08 Thread Gerd Petermann
> > -------------------- > > From: m...@tvage.co.uk > > To: mkgmap-dev@lists.mkgmap.org.uk > > Date: Wed, 7 Jan 2015 09:29:51 + > > Subject: Re: [mkgmap-dev] small issue with Way.getCofG() > > >

Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-08 Thread WanMil
ith that. Gerd From: m...@tvage.co.uk To: mkgmap-dev@lists.mkgmap.org.uk Date: Wed, 7 Jan 2015 09:29:51 +0000 Subject: Re: [mkgmap-dev] small issue with Way.getCofG() HI Gerd, the method I’ve used won’t work if the polygon is thinner than th

Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-08 Thread Gerd Petermann
To: mkgmap-dev@lists.mkgmap.org.uk Date: Wed, 7 Jan 2015 09:29:51 +0000 Subject: Re: [mkgmap-dev] small issue with Way.getCofG() HI Gerd, the method I’ve used won’t work if the polygon is thinner than the resolution of the bitmap. I hadn’t considered that it might be used on rivers; my main testing

Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-07 Thread Mike Baggaley
o:gpetermann_muenc...@hotmail.com] Sent: 07 January 2015 06:55 To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] small issue with Way.getCofG() Hi Mike, on my PC the performance of your algo is quite good. Attached is a patch that contains your patch as well as my quick impleme

Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-06 Thread Gerd Petermann
sort that out. Gerd > Date: Tue, 6 Jan 2015 13:23:57 -0700 > From: gpetermann_muenc...@hotmail.com > To: mkgmap-dev@lists.mkgmap.org.uk > Subject: Re: [mkgmap-dev] small issue with Way.getCofG() > > Hi Mike, > > I like the idea, but it seems to be slow. > Is it possibl

Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-06 Thread GerdP
mber is processed twice, once because of the POI, once > because the Generator uses Way.getCofG(). If both have different positions > this might have a negative impact. > > Gerd > > > From: > mike@.co > To: > mkgmap-dev@.org > Date: Tue, 6 Jan 2015 14:56:30 +

Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-06 Thread Gerd Petermann
processed twice, once because of the POI, once because the Generator uses Way.getCofG(). If both have different positions this might have a negative impact. Gerd From: m...@tvage.co.uk To: mkgmap-dev@lists.mkgmap.org.uk Date: Tue, 6 Jan 2015 14:56:30 + Subject: Re: [mkgmap-dev] small

Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-06 Thread Mike Baggaley
I have a working solution for ensuring that the created point is placed within the polygon when using --add-pois-to-areas, based on drawing the polygon on to a small monochrome bitmap and then looking for the point that is furthest from the surrounding area. I used a 9x9 bitmap for polygons having

Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-06 Thread Gerd Petermann
, but I think the improvement is too small for now. Gerd > Date: Sun, 4 Jan 2015 22:08:51 +0100 > From: wmgc...@web.de > To: mkgmap-dev@lists.mkgmap.org.uk > Subject: Re: [mkgmap-dev] small issue with Way.getCofG() > > Hi Gerd, > > yep, good catch. Seems to be a

Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-04 Thread WanMil
Hi Gerd, yep, good catch. Seems to be a good solution for mkgmap! WanMil Hi WanMil, I think the problem is similar to finding the "largest circle in a concave polygon", and we are not interested in the exact solution, any point close enough to the center is good. See e.g. http://arxiv.org/ftp

Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-04 Thread Andrzej Popowski
Hi Gerd, > we are not interested in the exact solution See example from QGIS plugin, function centroids(self): https://github.com/zsiki/realcentroid/blob/master/realcentroid.py -- Best regards, Andrzej ___ mkgmap-dev mailing list mkgmap-dev@lists.mkgm

Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-04 Thread GerdP
Hi WanMil, I think the problem is similar to finding the "largest circle in a concave polygon", and we are not interested in the exact solution, any point close enough to the center is good. See e.g. http://arxiv.org/ftp/arxiv/papers/1212/1212.3193.pdf which contains an iterative algo. Gerd Wa

Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-04 Thread WanMil
Hi Gerd, a good algorithm to find a point for the --add-pois-to-areas option would be to use the straight skeleton algorithm (http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2011q3/012394.html). This might be used to find a point with maximum distance to the border of a polygon. Anyhow it seems

Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-04 Thread GerdP
Hi Steve, Steve Ratcliffe wrote > On 03/01/15 08:15, Gerd Petermann wrote: >> @Steve: >> The routine was initially created for the --check-roundabouts option. >> >> Later it was also used for --add-pois-to-areas and the --housenumbers >> option. >> I got the impression that it might be better to c

Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-04 Thread Steve Ratcliffe
On 03/01/15 08:15, Gerd Petermann wrote: @Steve: The routine was initially created for the --check-roundabouts option. Later it was also used for --add-pois-to-areas and the --housenumbers option. I got the impression that it might be better to calculate the center of the way bbox for those two,

Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-03 Thread Andrzej Popowski
Hi Gerd, when using --add-pois-to-areas I would prefer to get a point inside a polygon. See some ideas here: http://mathoverflow.net/questions/56655/get-a-point-inside-a-polygon But I accept average as a simple practical solution, in most cases point will be inside. -- Best regards, Andrzej

Re: [mkgmap-dev] small issue with Way.getCofG()

2015-01-03 Thread Gerd Petermann
Hi, forgot to attach the patch. Note that points added by --add-pois-to-areas are more likely in the middle of a shape. @Steve: The routine was initially created for the --check-roundabouts option. Later it was also used for --add-pois-to-areas and the --housenumbers option. I got the impressio