[R-sig-Geo] Divide a polygon by a line?

Roger Bivand Roger.Bivand at nhh.no
Tue Oct 30 20:22:29 CET 2007


On Tue, 30 Oct 2007, Agustin Lobo wrote:

> Is it possible to divide a polygon by a line
> into 2 polygons?

No, in general. All computational geometry ends up in having to deal with 
the type of polygon. A convex polygon is one thing, and can be divided 
into two parts, but a general polygon may be concave, and the number of 
parts does not have to be two - the line could cross it multiple times. 
The approach taken in the Rgshhs function in maptools is to overlay a 
rectangular box over the polygon(s), and see what comes out, but quite 
often it isn't two (or in that case a single part within the rectangle).

Roger

>
> Agus
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list