Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The following query returns this result:

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


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

Postgis Operators

share|improve this answer
See 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

Your Answer


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.