Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

The following query returns this result:

select count(*) from a , b where a.geom && b.geom;

     count 
    -------
     66514

On a postgis 2 database.

What does the logical operator AND (&&) between two geometry columns return?

What about the other operators?

Edit: After a quick test it seems it returns all the rows where the bounding boxes of both the geometries overlap with each other

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

Array Functions and Operators (Postgres vs PostGIS)

edit: Returns TRUE if A's 2D bounding box intersects B's 2D bounding box.

enter image description here

enter image description here

Postgres Operator http://www.postgresql.org/docs/8.2/static/functions-array.html

Postgis Operators http://www.postgis.org/documentation/manual-2.0/reference.html#Operators

share|improve this answer
1  
See postgis.org/documentation/manual-2.0/reference.html#Operators for a PostGIS specific operator explanation. –  lynxlynxlynx Oct 5 '12 at 13:05
    
thanks updated the answer so it is correct for PostGIS. –  Mapperz Oct 5 '12 at 13:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.