[postgis-users] ST_Difference and many polygons?

Paul Ramsey pramsey at opengeo.org
Tue Feb 7 09:38:43 PST 2012


I would actually go with st_intersection to generate a resultant table...

create table t1t2 as
select
  st_intersection(t1.geom, t2.geom) as geom,
  t1.attr_of_interest,
  t2.attr_of_interest
from
  t1, t2
where
  st_intersects(t1.geom, t2.geom);

That gives you a table where you can ask questions like "what areas
changed from a value of foo to a value of bar?"

P.

On Tue, Feb 7, 2012 at 9:13 AM, charlie <carowan at yahoo.com> wrote:
> Hi.  I am a new PostGIS user and have successfully installed and been using
> PostGIS for about a month now, but have hit a roadblock on a particular
> issue.  I have imported 2 shapefiles with approximately 70k polygons and 50k
> polygons respectively, which covers the identical shoreline 3 decades
> apart.  I am looking to parse out the changes in the 2 shorelines databases
> to illustrate the changes over time and save it separately in PostGIS.  As
> it stands now, I have fixated upon ST_Difference as the likely way to handle
> this, but all the examples I have found only show how to use ST_Difference
> on 2 polygons, rather than many thousands.  As a new  PostGIS user  is this
> the the best way to handle this? Can anyone share any examples?  Thanks in
> advance for your advice!
>
> _______________________________________________
> 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