[postgis-users] St_length anomaly

Stephen Woodbridge woodbri at swoodbridge.com
Thu Jan 31 10:27:42 PST 2013


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


More information about the postgis-users mailing list