[postgis-users] A way to split polygons?
Peter N. Schweitzer
pschweitzer at usgs.gov
Fri Mar 4 06:25:36 PST 2011
Thanks very much, I think this is something that I can try out.
Seems like the resulting table could co-exist with the original,
and when I need tiled polygons, I can use the tiled version.
These data are expected to change only rarely, so that may suffice.
I do appreciate your willingness to spell it out for me in detail.
Sometimes it helps me to see these techniques as others might do them.
On 03/03/2011 07:03 PM, Arnold Helmut Engelmann wrote:
> If you want to go the tiling route and want to try that: Create a layer of tiles (boxes) at the size you want. Then run the following query:
> CREATE TABLE
> tiled_geo_units as
> ST_Intersection(a.geometry, b.geometry) AS geometry,
> geo_units as a,
> tiles as b
> ST_Intersects(a.geometry, b.geometry)
> Where "geo_units" is the table with your geological units, and "tiles" is the table of boxes you created. This will intersect both layers and split the polygons at the tile boundaries. You can also add to the WHERE clause if you want to filter out just the "large" polygons, otherwise this will tile all your polygons. For this ST_NPoints will probably useful.
Peter N. Schweitzer (MS 954, U.S. Geological Survey, Reston, VA 20192)
(703) 648-6533 FAX: (703) 648-6252 email: pschweitzer at usgs.gov
More information about the postgis-users