[postgis-users] St_length anomaly

Bob Pawley rjpawley at shaw.ca
Thu Jan 31 15:03:22 PST 2013



-----Original Message----- 
From: Stephen Woodbridge
Sent: Thursday, January 31, 2013 10:27 AM
To: postgis-users at lists.osgeo.org
Subject: Re: [postgis-users] St_length anomaly

On 1/31/2013 1:13 PM, Bob Pawley wrote:
> Hi
> I am running geometry at srid –1.
> I have an interesting anomaly when identifying or rejecting a
> st_length2d linestring.
> I have a linestring with it’s own row and id, and a length of
> 1.50812109467324e-008 (according to postgis).
> However when I attempt to exempt all linestrings shorter that 0.02 this
> very short linestring is included as being longer than .02.
> I checked the geometry on QGIS and it shows as being much shorter than
> its immediate neighbours(lengths of 0.0625000012910668)  that _are_
> rejected as being shorter that 0.02.(perhaps a nervous drafter or an
> anomaly in the transition from dxf)
> Actually, it still gets included even when I use st_length greater than
> 1.6. But it is finally rejected when using 1.7 as a minimum length.
> It’s almost like postgis is calculating the numerals and ignoring the 
> e-008.
> Is there another explanation for this(I hope)??
> Bob

Bob,

So are you saying that this query returns a record?

select id, st_length(the_geom), the_geom
   from mytable
  where id=<id> and st_length(the_geom)>0.02;

What is the result of this query?

If it is no records then postgis is doing the right thing.

-Steve

No it doesn't, a null is returned.

There must be something else going on.

Thanks

Bob
_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users 



More information about the postgis-users mailing list