Skip to content
Prev 12827 / 29559 Next

[raster] a railroad, a raster with a different value on each side of it

On Fri, Sep 16, 2011 at 4:51 PM, Barry Rowlingson
<b.rowlingson at lancaster.ac.uk> wrote:
Actually you dont even need rgeos...

 If your RR goes from the S edge of a rectangular study region to the
N edge, and is a single line, then your W and E polygons are then:

bottom left corner, intersection point of RR with S edge, RR points,
intersection point of RR with N edge, top left corner

bottom right corner, intersection point of RR with S edge, RR points,
intersection point of RR with N edge, top right corner

 - in other words you just trace along the bounding rectangle and the
RR. Get the RR coords from the SpatialLines* object and you're pretty
much set to make polygons out of it. Once you have the polygons you
can overlay them on rasters. Should be pretty quick.

Barry