[postgis-users] Examples SQL for spatial searches in post gis eg intersect

Maher Karim Maher_Karim at dorsch.com.jo
Tue Apr 3 22:14:37 PDT 2007





Hi Mohammed,

You can use this example as a guide for you.
select count(*) from layer1,layer2 where layer1.the_geom&&layer2.the_geom
and intersects(layer1.the_geom,layer2.the_geom)

you should use the "layer1.the_geom&&layer2.the_geom" because it will
reduce the query time

Regards
Maher Abdel Karim
GIS systems analyst/Programmer
Dorsch Water and Environment



|---------+--------------------------------------------->
|         |           "Mohammed Wahead"                 |
|         |           <Mohammed.Wahead at cadcorp.com>     |
|         |           Sent by:                          |
|         |           postgis-users-bounces at postgis.refr|
|         |           actions.net                       |
|         |                                             |
|         |                                             |
|         |           04/03/2007 05:32 PM               |
|         |           Please respond to PostGIS Users   |
|         |           Discussion                        |
|---------+--------------------------------------------->
  >--------------------------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                                                  |
  |        To:      <postgis-users at postgis.refractions.net>                                                                                          |
  |        cc:                                                                                                                                       |
  |        Subject: [postgis-users] Examples SQL for spatial searches in post gis eg  intersect                                                      |
  >--------------------------------------------------------------------------------------------------------------------------------------------------|



Hi folks,


Can anyone point mw in the right direction. I would like examples of SQL
syntax for running spatial searches in postgis. For example what is the SQL
for determining which spatial features intersect with another spatial
feature.


Thanks.


Mohammed Wahead
"Subscribe to Cadcorp eNews at www.cadcorp.com."

GIS & RDBMS Specialist
Cadcorp
Computer Aided Development Corporation Ltd Sterling Court,
Norton Road,
Stevenage, Herts,
SG1 2JY, UK
Tel: +44 (0)1438 731440
Fax: +44 (0)1438 747997



                                                                            
                                                                            
 ************************************************************************** 
 **                                                                         
 This email is confidential and may be privileged and should not be used,   
 read or copied by anyone who is not the  original intended recipient. If   
 you                                                                        
 have received this email in error  please inform the sender and delete it  
 from your mailbox or any other storage mechanism. Unless specifically      
 stated, nothing in this email constitutes an offer by Cadcorp and Cadcorp  
 does not warrant that any information contained in this email is accurate. 
                                                                            
 Cadcorp cannot accept liability for any statements made which are clearly  
 the sender's own and not expressly made on behalf of Cadcorp or one of its 
                                                                            
 agents. Please rely on your own virus check. No responsibility is taken by 
                                                                            
 Cadcorp for any damage arising out of any bug or virus infection.          
 ************************************************************************** 
 **                                                                         
                                                                            


_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users





More information about the postgis-users mailing list