[postgis-users] Help with spatial query (bug??)

Stephen Woodbridge woodbri at swoodbridge.com
Wed Apr 6 19:07:54 PDT 2005


I would concur with Brent, if I had a valid line with a length, but all 
the length was in Z, the the XY length of the line would be zero, but it 
still should be contained in the polygon.

Seems to me anyway,
   -Steve W.

Brent Wood wrote:
> --- Carl Anderson <carl.anderson at vadose.org> wrote:
> 
> 
> 
>>Ok a little more checking
>>
>>gis=# select   disjoint ('LINESTRING(0 0,0 0)',expand('POLYGON((0 0,0 
>>1,1 1,1 0,0 0))'::geometry,3));
>> disjoint
>>----------
>> t
>>(1 row)
>> 
>>gis=# select   intersects ('LINESTRING(0 0,0 0)',expand('POLYGON((0 0,0 
>>1,1 1,1 0,0 0))'::geometry,3));
>> intersects
>>------------
>> f
>>(1 row)
>>
>>gis=# select   intersects ('LINESTRING(0 0,0 0)','POLYGON((0 0,0 1,1 1,1 
>>0,0 0))'::geometry);  intersects
>>------------
>> t
>>(1 row)
>>
>>
>>To my understanding the Boundary test is being carried out and the 
>>Interior test is not
>>
>>I think that this case should not return TRUE or FALSE but should return 
>>NULL
> 
> 
> I beg to differ (but do appreciate your comments):
> 
> Surely a line comprising one coordinate (or multiple vertices at the same
> point) should return the same result from these queries as a point at the same
> location?
> 
> If the line had a null geometry the the null result is appropriate. A zero
> length line geometry is not the same as null. Since the locations of all the
> line's vertices are specified, as they are for the polygons, a valid spatial
> overlay is possible, and the result of an overlay should therefore be t/f. 
> 
> Unfortunately, the wrong t/f is returned in some cases at present.
> 
> 
> Brent
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 




More information about the postgis-users mailing list