Project

General

Profile

Accuracy limitation when drawing Polyline in WGoogleMap

Added by Alistair Lowe almost 11 years ago

Hi guys,

I'm attempting to draw some very close quarters poly-lines of various colours in Google Maps.

I'm finding that when I pass differences in latitude of 0.00006f or less, my two lines blend together, being drawn at exactly the same coordinates.

I've used the following website to confirm that it should be possible to draw closer Polylines than this: https://developers.google.com/maps/documentation/utilities/polylineutility

Likewise, I've confirmed that the WGoogleMap::Coordinate value being fed into addPolyLine is maintaining its accuracy.

Could there perhaps be a point within this function, i.e. converting the value to JavaScript, where there is a loss of accuracy? If so could we add this one to the bug list, as it's a big requirement in my current project.

Many thanks


Replies (2)

RE: Accuracy limitation when drawing Polyline in WGoogleMap - Added by Wim Dumon almost 11 years ago

Hi Alistair,

Investigate round_js_str() in WebUtils.C. While the implementation has changed regularly, up to recently, we now settled with rendering floats with 7 significant numbers, about the precision of float. For many applications this is enough, but apparently for you case it isn't. Find out what code path you use, and modify the precision to > 7 for your case.

In general, a large precision quickly adds to the bandwidth (as well as float->string computing time) when rendering complex drawings like charts, which is why we've chosen for float precision rather than double precision. I'm wondering if we can make this precision configurable without too much performance penalty...

BR,

Wim.

RE: Accuracy limitation when drawing Polyline in WGoogleMap - Added by Alistair Lowe almost 11 years ago

Hi Wim,

If there's any way to configure this, even if it's a separate function just for GoogleMaps, it'd certainly be appreciated. Whenever I try to compile Wt from source I always end-up with troubles with regards to obtaining/compiling/configuring some of the third-party libraries which often leaves me with a half-cooked library and so I find it much more productive to use Ubuntu's pre-compiled libraries as they're released.

Many thanks

    (1-2/2)