Re: [gdal-dev] GDAL precision for Geometry object

2015-10-16 Thread Even Rouault
Le vendredi 16 octobre 2015 20:14:44, Hermann Peifer a écrit : > On 2015-10-16 18:20, Even Rouault wrote: > > Le vendredi 16 octobre 2015 17:57:10, Hermann Peifer a écrit : > >> On 2015-10-12 11:28, Even Rouault wrote: > >>> I've changed to '%.15g' formatting for WKT in > >>> https://trac.osgeo.org

Re: [gdal-dev] GDAL precision for Geometry object

2015-10-16 Thread Hermann Peifer
On 2015-10-16 18:20, Even Rouault wrote: Le vendredi 16 octobre 2015 17:57:10, Hermann Peifer a écrit : On 2015-10-12 11:28, Even Rouault wrote: I've changed to '%.15g' formatting for WKT in https://trac.osgeo.org/gdal/ticket/6145 Hi Even, Why did you choose '%.15g', rather than '%.17g'? The

Re: [gdal-dev] GDAL precision for Geometry object

2015-10-16 Thread Even Rouault
Le vendredi 16 octobre 2015 17:57:10, Hermann Peifer a écrit : > On 2015-10-12 11:28, Even Rouault wrote: > > I've changed to '%.15g' formatting for WKT in > > https://trac.osgeo.org/gdal/ticket/6145 > > Hi Even, > > Why did you choose '%.15g', rather than '%.17g'? The latter format > should guar

Re: [gdal-dev] GDAL precision for Geometry object

2015-10-12 Thread Even Rouault
> @Even: I also tried to imagine a reasonable real-life coordinate value > that would generate scientific notation when printed with "%.15g" or: > "%.17g" (as hamish mentioned in this old ticket). Can you point me to one? No, it is unlikely that coordinates go that big in any reasonable projected

Re: [gdal-dev] GDAL precision for Geometry object

2015-10-11 Thread Hermann Peifer
On 2015-10-11 19:20, Dimitrianos Savva wrote: I just wondering if GDAL make use of any kind of custom-user-defined type that provides higher precision from a double. My question wasn’t so clear. The problem started comparing GDAL’s and GeoTools’ (Java) WKT representations of the same geometrie

Re: [gdal-dev] GDAL precision for Geometry object

2015-10-11 Thread Dimitrianos Savva
> On Oct 11, 2015, at 7:27 PM, Hermann Peifer wrote: > > On 2015-10-10 13:45, Dimitrianos Savva wrote: >> >> For example the geometry POINT (4799826.09861662145704 >> 2773995.445373429451138) cannot be represented by two double types. But >> still the ExportToWKT function produces the correct r

Re: [gdal-dev] GDAL precision for Geometry object

2015-10-11 Thread Hermann Peifer
On 2015-10-10 13:45, Dimitrianos Savva wrote: For example the geometry POINT (4799826.09861662145704 2773995.445373429451138) cannot be represented by two double types. But still the ExportToWKT function produces the correct result with full precision for the values. While thinking twice about

Re: [gdal-dev] GDAL precision for Geometry object

2015-10-11 Thread Dimitrianos Savva
> On Oct 10, 2015, at 3:06 PM, Even Rouault wrote: > > Le samedi 10 octobre 2015 13:45:05, Dimitrianos Savva a écrit : >> Hi all, >> >> Recently I noticed that the ExportToWKT >> function >> of a Geometry object that has been read

Re: [gdal-dev] GDAL precision for Geometry object

2015-10-11 Thread Jukka Rahkonen
Even Rouault spatialys.com> writes: > Hum I thought that WKT didn't allow scientific notation for coordinates, but > actually checking at http://portal.opengeospatial.org/files/?artifact_id=25355 > (SFA 1.2.1), page 52, it seems legal. So perhaps this could be changed. A quick test with OpenJ

Re: [gdal-dev] GDAL precision for Geometry object

2015-10-10 Thread Even Rouault
Le samedi 10 octobre 2015 17:56:24, Hermann Peifer a écrit : > On 2015-10-10 14:06, Even Rouault wrote: > > The implementation of ExportToWKT() in GDAL uses 15 decimal figures > > ("%.15f" printf formatting) whatever the source precision was, and as > > you point, whatever the intrinsic precision o

Re: [gdal-dev] GDAL precision for Geometry object

2015-10-10 Thread Hermann Peifer
On 2015-10-10 17:56, Hermann Peifer wrote: On 2015-10-10 14:06, Even Rouault wrote: The implementation of ExportToWKT() in GDAL uses 15 decimal figures ("%.15f" printf formatting) whatever the source precision was, and as you point, whatever the intrinsic precision of the double value is. Do

Re: [gdal-dev] GDAL precision for Geometry object

2015-10-10 Thread Hermann Peifer
On 2015-10-10 14:06, Even Rouault wrote: The implementation of ExportToWKT() in GDAL uses 15 decimal figures ("%.15f" printf formatting) whatever the source precision was, and as you point, whatever the intrinsic precision of the double value is. Does "%.15f" have any added value over "%.15g"

Re: [gdal-dev] GDAL precision for Geometry object

2015-10-10 Thread Even Rouault
Le samedi 10 octobre 2015 13:45:05, Dimitrianos Savva a écrit : > Hi all, > > Recently I noticed that the ExportToWKT > function > of a Geometry object that has been read from a Shapefile, generates the > well known text representatio

[gdal-dev] GDAL precision for Geometry object

2015-10-10 Thread Dimitrianos Savva
Hi all, Recently I noticed that the ExportToWKT function of a Geometry object that has been read from a Shapefile, generates the well known text representation without any compromise on the precision of the coordinates values. I