[postgis-users] Splitting a Polygon with a Linestring
Martin Davis
mbdavis at refractions.net
Wed May 21 12:02:32 PDT 2008
That should work. You may also have the problem of determining which of
the resultant polygons fell on each side of the drawn line. The usual
way to do this would be to run some point-in-polygon queries.
It's amazing how much this use case comes in many different venues
(PostGIS, GUI tools, etc). Some day I hope to get this into JTS/GEOS as
a provided operation, at which point this will be much easier to accomplish.
James Beaudoin wrote:
> I think the steps below will work but I have one question. I am
> creating an application that allows a user to split a polygon by
> drawing a linestring across the polygon they wish to change. The
> crossing linestring has parts that are outside the polygon and I want
> to remove that before I geomunion. What's the easiest way to do that?
>
> - extract the lines that make up the polygon
> - add to this your crossing linestring
> - geomunion the lines together.
> - polygonize the union-ed set
>
> Thanks,
>
> Jim
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
--
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022
More information about the postgis-users
mailing list