[postgis-users] Spatial query questions

Rhys Ickeringill rhysi at omnilink.com.au
Tue May 3 22:08:54 PDT 2005


Hi All,

I wish to clarify a few points from the PostGIS manual. If there is another
document which will answer all these questions, feel free to point me at it
(OGC?)...

1. Regarding the *FromWKB geometry constructors - how do I use them given
[what I presume is] a string representation of the bytea field?

For example I wish to do something like:

SELECT PointFromWKB('0101000020FF7F00009BC4C5F6FFA841C06555638D43A46240')

which doesn't work. Is it expecting octets like the postgreSQL manual
suggests? I know

SELECT '0101000020FF7F00009BC4C5F6FFA841C06555638D43A46240'::geometry

works. Do the two methods when correctly used produce exactly the same
geometry?


2. The contains binary operator "@"

The manual states this performs a comparison based on bounding boxes. Is
this true? Do *I* have to supply the bounding boxes, or are the boxes
caculated for me if I supply other geometry types? Looking at the list of
"@" operators, it seems some but not all cases are covered, for example
"line @ polygon" is missing


3. The "within" and "contains" functions (this actually applies to many
binary functions)

The manual is a ambiguous regarding the order of the comparison - is PostGIS
computing whether arg1 is contained by arg2? Or arg2 contains arg1?

Also what is the definition of "contains" - I'm assuming it is compete
rather than partial containment. Correct?


Thanks for your guidance.

Rhys




More information about the postgis-users mailing list