[postgis-users] Split One Layer of Polygons With Another Layer ofPolygons?

Gilbert, Antoine AGilbert at korem.com
Wed Sep 6 07:37:13 PDT 2006


I wonder what software you talking about :p

-----Original Message-----
From: Bill Thoen [mailto:bthoen at gisnet.com] 
Sent: September 6, 2006 8:46 AM
To: Paul Ramsey
Cc: PostGIS Users Discussion
Subject: Re: [postgis-users] Split One Layer of Polygons With Another
Layer ofPolygons?

Thanks! If I didn't ask questions I'd certainly make mountains out of
molehills. One of my big problems seems to be unnlearning the techniques
capabilities of the software I have been using before I ran across
PostgreSQL and PostGIS.

 
On Tue, Sep 05, 2006 at 06:06:45PM -0700, Paul Ramsey wrote:
> CREATE TABLE new_fields AS
> SELECT intersection(f.the_geom, c.the_geom) as the_geom, f.*,
c.clu_name
> FROM fields f, clu c
> WHERE
>   f.the_geom && c.the_geom
> AND
>   Intersects(f.the_geom, c.the_geom)
> 
> On 5-Sep-06, at 2:31 PM, Bill Thoen wrote:
> 
> >Using PopstgreSQL/PostGIS, what are the steps I need to use to  
> >split one layer of polygons with another layer and also maintain  
> >data attrributes among the polygons that are split? For example,  
> >I've got corn and soybean field polygons that need to be split at  
> >the borders of overlaying CLU (Common Land Unit) polygons, and if a  
> >corn field crosses under a CLU boundary, I want to split the field  
> >at the CLU boundary and copy the orignal field id, crop code and  
> >other attributes into the two (or more) resulting farm field  
> >polygons (and probably assign a new unique polygon id to them all  
> >too.)
> >
> >I'm thinking that the approach would be to create a cursor  
> >selection of CLUs and for each of these find the set of farm fields  
> >that overlap it. Then for each of those farm fields, split them  
> >against the CLU polygon (using Intersection()?) and insert each new  
> >polygon with associated data into a new table, and deleting the  
> >orignal farm polygon. Then at the end merge all the split polygons  
> >back into the orignal table and assign unique ids of all of them.
> >
> >Is this the right approach? It seems like a bit of a job, but it  
> >also seems like a common enough operation that I'm wondering if  
> >there is a simpler way already available in PostGIS or has somebody  
> >written a function to do this sort of thing?
> >
> >TIA,
> >- Bill Thoen
> >
> >
> >_______________________________________________
> >postgis-users mailing list
> >postgis-users at postgis.refractions.net
> >http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
_______________________________________________
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