v2.11 = 48.501558 , v2.12 = 48.50155799999999

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

v2.11 = 48.501558 , v2.12 = 48.50155799999999

kartenfreak
Hello group,

first of all, thanks to all devs for the excellent work.

We have a very large GIS App developed with 2.10 / 2.11.
The UI was made with jQuery 1.6.1.

No MapServer,GeoServer,WMS,WFS ... only xyz-Tiles and a Vector-Layer.
The Vector Layer is large but only lines and points.

After switch to 2.12 everthing works fine,
but in the result of

new OpenLayers.Format.WKT ( myobj ).write ( myfeatures , true );
new OpenLayers.Format.KML ( myobj ).write ( myfeatures , true );
new OpenLayers.Format.GML.v2 ( myobj ).write ( myfeatures , true );
new OpenLayers.Format.GML.v3 ( myobj ).write ( myfeatures , true );
new OpenLayers.Format.GeoJSON ( myobj ).write ( myfeatures , true );
new OpenLayers.Format.OSM ( myobj ).write ( myfeatures , true );
new OpenLayers.Format.GPX ( myobj ).write ( myfeatures , true );

myobj = {'internalProjection': map.baseLayer.projection,
        'externalProjection': new OpenLayers.Projection("EPSG:4326");};


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'.


any ideas ?
Reply | Threaded
Open this post in threaded view
|

Re: v2.11 = 48.501558 , v2.12 = 48.50155799999999

Peter Robins
On 22 August 2012 14:21, midi <[hidden email]> 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.
_______________________________________________
Dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-dev