[postgis-devel] 1.3.4rc1

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Tue Oct 28 10:49:07 PDT 2008


Courtin Olivier wrote:

> Well the point (to my opinion) is to be able to send to client only the 
> amount of data really
> needed.
> Generalisation could be a way (ST_SImplify, ST_SnapToGrid), and decimal 
> precision
> an another (and sometime both of them)
> 
> So i keep thinking that's the most usefull way to handle that for 
> PostGIS users is a decimal
> precision approach (%*.f) rather than a significant digits (%*.g)

True, but then this throws up the issue in the regression tests whereby 
different platforms have different precisions in terms of decimal 
places. The only thing we know that can control this is significant 
figures - for example, even if the user specifies a precision of 15 then 
we know for a fact that the number doesn't contain this information, and 
the problem gets worse the larger the numbers.

The problem gets worse in that the native sprintf() function only 
handles decimal places rather than significant figures in %f mode, so it 
looks like we may need to engineer ourselves a new output function. On 
the plus side, we can permanently solve the issue with regression tests 
on all platforms due to floating point drift.

So this only leaves the question of would changing the meaning of the 
function in this way cause you great problems? Given that most data 
should be within a similar area, I think specifying a slightly different 
fixed precision should give you a similar result as you have now.


ATB,

Mark.

-- 
Mark Cave-Ayland
Sirius Corporation - The Open Source Experts
http://www.siriusit.co.uk
T: +44 870 608 0063



More information about the postgis-devel mailing list