[postgis] PostGIS Spatial Query Operators

Frank Warmerdam warmerdam at pobox.com
Tue Jun 26 14:30:09 PDT 2001


I have been looking through some of the spatial query operators in the SFSQL
specification, and wondering if we can make PostGIS match the spec more
closely.  I realize that implementing many of the spatial query operators
for SFSQL is considered hard, and not particularly important, but can we make
the existing operators work more like SFSQL?

For instance the following in PostGIS:

SELECT * from geom_test WHERE geom && 'BOX3D(2 2 0,3 3 0)'::box3d;

Would be expressed as this in SF SQL:

SELECT * from geom_test 
  WHERE Overlaps(geom,PolygonFromWKT('POLYGON((2 2,2 3,3 3,3 2,2 2))')) = 1;

Similarly some of the other PostGIS operators have SF SQL equivelents.

PostGIS         SF-SQL
=======         ======
  ~=            Equals()
truely_inside() Within()

Actually, that's all I see just now.  The rest seem to be PostGIS or SF-SQL

I would swear I saw an EnvelopesOverlap() operator in the SFCOM OLEDB 
specification, but I don't see any equivelent in SFSQL.  This is really
what the PostGIS && operator implements, not really Overlaps().  Nevertheless,
I think we would be better off having an Overlaps() function that really
just does a bounding boxes overlap test than not having one at all.

Best regards,

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

To unsubscribe from this group, send an email to:
postgis-unsubscribe at yahoogroups.com


Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

More information about the postgis-users mailing list