[R] Creating polygons from scattered points

Keith Jewell k.jewell at campden.co.uk
Wed Mar 14 15:05:38 CET 2012


No time to really think about this, but:

a) to "convert scattered point distributions to polygons" you might look at 
convex hulls; e.g. convhulln {geometry}
b) to identify islands some kind of cluster analysis

Hope that helps a little.

KJ

"Louise Mair" <lm609 at york.ac.uk> wrote in message 
news:CAMkzT57pep1zKPgm2DG5TN6r0P-_O5Tf+wSnURXdOHF8zVMnpw at mail.gmail.com...
> Hello,
>
> I have a distribution dataset for species consisting of xy coordinates at
> the 1km resolution, with only presence data. So a simplified example of a
> species distribution might be:
>
> y <- rbind(as.integer(rnorm(100,50,20)), as.integer(rnorm(200,100,30)),
> as.integer(rnorm(100,180,15)))
> x <- rbind(as.integer(rnorm(200,50,20)), as.integer(rnorm(200,100,20)),
> as.integer(rnorm(100,200,15)))
> plot(y~x)
>
> I would like to create polygons for each species distribution, where if an
> island is present (as I have tried to show in the example), it would be a
> seperate polygon, and the jagged edges of coastlines etc are maintained. I
> have spent ages trying to find a package that will allow me to convert
> scattered point distributions to polygons but haven't found anything that
> works, the functions I have found require the data already to be in the
> format where the only xy coordinates present are the outline of the
> polygon.
>
> Can anyone please recommend a function I can use here, or suggest a way of
> extracting the outline points? I have tried this manually but cannot seem
> to write a code that will effectively take account of jagged edges and
> islands.
>
> Thanks very much for your help,
>
> Louise.
>
> [[alternative HTML version deleted]]
>



More information about the R-help mailing list