[MAPSERVER-USERS] PostGIS: Intersection of 2 areas

SUSANNE susanne.kalliany at tefis.at
Thu May 15 07:09:20 EDT 2008


Hello,

I am struggling with interserction of 2 areas of the same layer.

$sql=	"SELECT the_geom FROM " . $layername . " where gid= " . $gid1;
$res = pg_query ($sql);
$row = pg_fetch_array ($res);
$geom1= $row[0];					
			
$sql=	"SELECT the_geom FROM " . $layername . " where gid= " . $gid2;
$res = pg_query ($sql);
$row = pg_fetch_array ($res);
$geom2= $row[0];				
			
$sql=	"SELECT ST_Difference($geom1,$geom2)"  ;
$res = pg_query ($sql);
$row = pg_fetch_array ($res);
$geom= $row[0];		
^^^
The current problem is that the last statement does not return anything !

The final goal of my efforts is to get rid of the common area in one of
two partially overlapping areas.

Is my approach (see above) proper at all for that purpose ?!?

With many thanks in advance for any comments and suggestions.

Susanne
-- 
View this message in context: http://www.nabble.com/PostGIS%3A-Intersection-of-2-areas-tp17250805p17250805.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the mapserver-users mailing list