[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] selecting geometries, using 2 polygons
From:       nicklas.aven () jordogskog ! no
Date:       2009-04-28 13:37:12
Message-ID: 200904281337.n3SDbCOB015874 () mail-core ! space2u ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


sorry strk, you are right
 
I was mixing symdifference with something else in my head.
Both should work
 
Sorry
/Nicklas

2009-04-28 strk wrote:

On Tue, Apr 28, 2009 at 03:16:04PM +0200, Malm Paul wrote:
>> Hi,
>> I have 2 polygons (rectangeles) p1 and p2, they intersect each other.
>> I would like to select all geometries within p1 excluding all geometries within p2.
>> 
>> How can I do this with postGIS and SQL ?
>
>I suggest you first get p3 as difference(p1, p2),
>then use ST_intersect on p3 and your geom column.
>
>You should be careful in the way you construct the query 
>so that difference() is computed only once, and make sure
>the gist index is used by ST_intersect.
>
>--strk;
>
> Free GIS & Flash consultant/developer () ASCII Ribbon Campaign
> http://foo.keybit.net/~strk/services.html /\ Keep it simple! 
>_______________________________________________
>postgis-users mailing list
>postgis-users@postgis.refractions.net
>http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
[Attachment #5 (text/html)]

<html>
<head>
	<title></title>
	
<meta content="MSHTML 6.00.6000.16825" name="GENERATOR"></meta>
</head>

<body>
	
<div>sorry strk, you are right</div>
	
<div>&nbsp;</div>
	
<div>I was mixing symdifference with something else in my head.</div>
	
<div>Both should work</div>
	
<div>&nbsp;</div>
	
<div>Sorry</div>
	
<div>/Nicklas<br />
		<br />
		2009-04-28 strk wrote:<br />
		<br />
		On Tue, Apr 28, 2009 at 03:16:04PM +0200, Malm Paul wrote:<br />
		>> Hi,<br />
		>> I have 2 polygons (rectangeles) p1 and p2, they intersect each other.<br />
		>> I would like to select all geometries within p1 excluding all geometries within p2.<br />
		>> <br />
		>> How can I do this with postGIS and SQL ?<br />
		><br />
		>I suggest you first get p3 as difference(p1, p2),<br />
		>then use ST_intersect on p3 and your geom column.<br />
		><br />
		>You should be careful in the way you construct the query <br />
		>so that difference() is computed only once, and make sure<br />
		>the gist index is used by ST_intersect.<br />
		><br />
		>--strk;<br />
		><br />
		> Free GIS &amp; Flash consultant/developer () ASCII Ribbon Campaign<br />
		> http://foo.keybit.net/~strk/services.html /\ Keep it simple! <br />
		>_______________________________________________<br />
		>postgis-users mailing list<br />
		>postgis-users@postgis.refractions.net<br />
		>http://postgis.refractions.net/mailman/listinfo/postgis-users<br />
		><br />
		></div>
</body>
</html>


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic