Skip to content
Back to formatted view

Raw Message

Message-ID: <BANLkTinvNEGgMpY0OWnf+Gc0m2yzk=0UrQ@mail.gmail.com>
Date: 2011-05-20T10:06:40Z
From: Barry Rowlingson
Subject: Intersection of polygons and polylines
In-Reply-To: <9BF541359D7743D0A557629911F1A0FB@mail2world.com>

On Fri, May 20, 2011 at 10:53 AM, Rija FANIRIANTSOA
<frijaf1 at mail2science.com> wrote:
>
> L<-SpatialLines(list(Lines(list(Line(cbind(c(7,6,5,4.2,3,2.8,1),
> c(4,3.5,3,2.8,2.5,1.8,1)))),"l1")))

 > require(rgeos)

 > gIntersects(L,polyg,byid=TRUE)
      l1
p1 FALSE
p2 FALSE
p3  TRUE
p4  TRUE

 - that gives you T/F for intersections of L with the polygons in
polyg. Job almost done!

Barry