[OpenLayers-Users] Re: getCentroid method influenced by floating-point math

srweal srweal at gmail.com
Sun May 15 20:22:31 EDT 2011


My only idea for improving this calculation was to find the minX  and minY
for the bounding box of the geometry, then shift the entire geometry back to
an origin of 0,0. 

This would lead to much smaller values and this resolve some of the
calculation issues. Once the centroid is calculated, I can then just add
back the bounding box corner coordinate to get the final centroid.

Does this sound reasonable to people? 

Also, if any of the awesome OL developers are reading, is this issue of
concern to you guys and will you be doing anything about it?

Steve

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/getCentroid-method-influenced-by-floating-point-math-tp6346365p6366982.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list