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

Brent Wood pcreso at pcreso.com
Wed Apr 6 17:40:02 PDT 2005


--- 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



More information about the postgis-users mailing list