[OpenLayers-Dev] v2.11 = 48.501558 , v2.12 = 48.50155799999999

Peter Robins openlayers at peterrobins.co.uk
Wed Aug 29 06:38:53 PDT 2012


On 22 August 2012 14:21, midi <info at digitale-wegeverwaltung.de> wrote:
>
> every 'lat' Value has 14 decimals (48.50155799999999)
> every 'lng' Value is Ok with 6 decimals
>
>
> switching back to 2.11 (except GPX write, which doest not exist in 2.11)
>
> every 'lat' value has 6 decimals.
> every 'lng' value has 6 decimals.
>
>
> why has only the 'lat' value 14 decimals and the 'lng' 6 decimals ?
> if there rounding problems this should be both in 'lat' and 'lng'.


I don't see any difference between lats and lons. If I use
examples/vector-formats.html and enter a simple GeoJSON geometry in
4326 with 2 latlons both with 6 decimals

{"type":"Feature", "geometry":{"type":"LineString",
"coordinates":[[2.360377, 48.936022], [2.358811, 48.935627]]}}

and then output it in 3857, enter that output, and then output that as
4326, one of the latlons is converted back to the original and one has
the superfluous decimals. And, yes, there is no problem doing the same
with http://dev.openlayers.org/releases/OpenLayers-2.11/examples/vector-formats.html

I would imagine the change was caused by
https://github.com/openlayers/openlayers/commit/4b949176d3cce6b1de9f0737087dd09ea92e69af
which changed the transform() method. It would be nice if you have
time to investigate this a bit further (I'm afraid my knowledge of
floating-point arithmetic is not large), as I too would prefer not to
have the output bloated with useless decimals.


More information about the Dev mailing list