[postgis-devel] measures test fail

Nicklas Avén nicklas.aven at jordogskog.no
Mon Oct 18 06:42:58 PDT 2010


Hallo Sandro

I was about to do the same a few weeks ago when I realized that
snaptogrid is only workin in 2 dimensions now. 

I think we said then we should open up for the third dimension in
snaptogrid to. As I understand it it is all prepared (you are the author
aren't you :-)  ). I have not looked at it since the discussion on the
list a few weeks ago, but maybe it is easier and faster for you to open
up for 3D snapping. 


When we are on the topic I have thought about those precision problems
we sometimes meet. I spent a few hours the other day to understand it a
little bit more. The more annoying result of this I think is that it is
not possible to split a line with a point with the new st_split
function. Even if you find the point to split with through functions
like ST_Line_Interpolate_Point or ST_closestpoint.

But I found no way to solve it. 

And the problem is not just the last digit when working with real data.
The problem is the last 6 or 7 digits. That is because the coordinates
like here around has 6 to 7 digits to the left of the decimalplace. So
we don't have a precision in our coordinates better than 9 to 10
decimals. So, giving the answer in a small distance calculation in 16
decimals is quite misleading and the last 6 to 7 digits can vary
depending on how the calculation is done. 

This does not matter in most cases because no one measures distances in
GIS in ten decimals anyway. 

But in the case of ST_Split and ST_Intersects it can be quite annoying. 

I guess this is a little related to question number six here
http://trac.osgeo.org/postgis/wiki/DevWikiISO19125

Regards
Nicklas




On Mon, 2010-10-18 at 15:18 +0200, strk wrote:
> On Mon, Oct 18, 2010 at 03:08:41PM +0200, strk wrote:
> 
> > 7619047619 -0.190476190476191 4.90476190476191)
> > 7619047619 -0.19047619047619 4.90476190476191)
> > 
> > A SnapToGrid call would seem appropriate.
> > This is trunk against pgsql 8.4.3 on OpenSUSE
> 
> I've committed grid snapping (1e-14) in r6083, fixing
> it for me.
> 
> --strk;
> 
>   ()   Free GIS & Flash consultant/developer
>   /\   http://strk.keybit.net/services.html
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
> 





More information about the postgis-devel mailing list