logo separator

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

From Gerd Petermann gpetermann_muenchen at hotmail.com on Sat Jan 3 08:15:41 GMT 2015

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 impression that it might be better to calculate the center
of the way bbox for those two, I am not so sure about the roundabout code.
What do you think?

Gerd

> Date: Fri, 2 Jan 2015 21:34:14 -0700
> From: gpetermann_muenchen at hotmail.com
> To: mkgmap-dev at lists.mkgmap.org.uk
> Subject: [mkgmap-dev] small issue with Way.getCofG()
> 
> Hi all,
> 
> We use the method Way.getCofG() to calculate a single 
> coordinate for shapes, e.g. for buildings with house numbers.
> The routine calculates the avg. latitude and longitude of
> all points, which typically gives a point somewhere close 
> to the middle of the shape, but it seems to ignore
> the fact that the first and last point in a shape are equal
> to close it, means, the result will be a bit too close to that
> closing point.
> Is there a good reason for this? 
> 
> We use it also to calculate the POI in --add-pois-to-areas.
> 
> Gerd
> P.S. I guess a better formular could calculate the convex hull
> first, but I doubt that the additional CPU time would 
> really improve the result that much.
> 
> 
> 
> --
> View this message in context: http://gis.19327.n5.nabble.com/small-issue-with-Way-getCofG-tp5828821.html
> Sent from the Mkgmap Development mailing list archive at Nabble.com.
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20150103/a460b363/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getCofG.patch
Type: application/octet-stream
Size: 561 bytes
Desc: not available
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20150103/a460b363/attachment.obj>


More information about the mkgmap-dev mailing list