Skip to content
Back to formatted view

Raw Message

Message-ID: <AANLkTin2u672oYhw4E9sLypfKTPR2fCwuh=HENh5RX45@mail.gmail.com>
Date: 2010-09-06T08:21:12Z
From: Barry Rowlingson
Subject: Attach values from polygons to points
In-Reply-To: <4C8491F9.4030302@gmx.de>

On Mon, Sep 6, 2010 at 8:02 AM, Jens Oldeland <oldeland at gmx.de> wrote:
> Hi,
>
> I am working with two shapefiles in R; one is a point.shp the other is a
> polygon.shp. Now, I would like to intersect/join/attach all the values from
> the polygon to the table of the point.shp.
>
> I tried overlay() and spRbind in package sp, but nothing did what I expected
> them to do.
>
> Could anyone give me a hint how I can combine both shapefiles?
>

 You could read the reply I posted on stackoverflow :) But the short answer is:

 overlay(pts,polys) returns the index of the row of polys that the
points in pts are inside. How did this not work for you?

Barry