[R-sig-Geo] External "Envelope" of a set of points in space - not convex hull

Pedro de Barros pedrocontebarros at gmail.com
Wed Jun 27 16:00:17 CEST 2012


Hi there,

Building upon your suggestion, I managed to get the alphahull to work 
(I had to play a little with the alpha parameter to get the scale 
right, but it worked).

To transform it into a SpatialPolygon (only one polygon, that was 
enough for me), I used the code from Andy Bevan in 
http://r-sig-geo.2731867.n2.nabble.com/alpha-hull-ahull-to-polygon-shapefile-td7342734.html. 
I ended up not needing to smooth it, as I chose a large value for 
the  alpha parameter of the ahull function.

I had a little difficulty at first, but managed to get it to work 
choosing a small value to the rnd parameter (with the default value 
it would not close the polygon). Overall, it worked quite well for my purposes.
I then used this to define a consecutive area for a raster (a 
SpatialPixels object) with rasterize (from the raster package).
I also used it to export as a shapefile (using writeOGR) for further 
use in Quantum GIS.

I hope this helps others looking for the same problem, and thank you 
all a lot for the support!



At 15:04 2012-06-27, Michael Sumner wrote:
>Can you share what you've tried? A triangulation is really at odds
>with the representation available with "polygons" in their usual GIS
>form, but there are ways to do it. The basic options (to me) are
>either a set of the triangles as individual polygons, or even a set of
>shapes in a "multipolygon", or to dissolve them to get the hull/s from
>the alphahull code. Any feeling for which option is more important?
>Got an example of running the alphahull to help someone start, and why
>you want a SpatialPolygonsDataFrame? (For plot, export, both, or
>other?).
>
>
>
>On Wed, Jun 27, 2012 at 6:31 PM, Mathieu Rajerison
><mathieu.rajerison at gmail.com> wrote:
> > Hi,
> >
> > alphahull is nice but having a SpatialPolygonsDataFrame from the result is
> > quite tricky
> >
> > If anyone has the solution..
> >
> >
> > 2012/6/22 Michael Sumner <mdsumner at gmail.com>
> >>
> >> Try the alphahull package, which is on CRAN.
> >>
> >> I don't believe it will smooth the result for you, but you could take
> >> it from there and use other R functions to do that.
> >>
> >> Cheers, Mike.
> >>
> >>
> >> On Fri, Jun 22, 2012 at 4:56 PM, PCB <pedrocontebarros at gmail.com> wrote:
> >> > Dear All,
> >> >
> >> > I have a set of observations on an area, and I would like to define the
> >> > "investigated area" as the smallest polygon (preferably smoothed with
> >> > e.g.
> >> > splines fit) that encloses all the points. This is similar to the convex
> >> > hull problem, except that my data have "gulfs", i.e. areas that are not
> >> > sampled (and should not be), between two "fingers" of areas
> >> > investigated. I
> >> > am sure I have seen something about solving this lately, but after a
> >> > couple
> >> > days searching could not find it (I am sure I am using the wrong
> >> > keywords...).
> >> >
> >> > Any help would be appreciated
> >> >
> >> > --
> >> > View this message in context:
> >> > 
> http://r-sig-geo.2731867.n2.nabble.com/External-Envelope-of-a-set-of-points-in-space-not-convex-hull-tp7580290.html
> >> > Sent from the R-sig-geo mailing list archive at Nabble.com.
> >> >
> >> > _______________________________________________
> >> > R-sig-Geo mailing list
> >> > R-sig-Geo at r-project.org
> >> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >>
> >>
> >>
> >> --
> >> Michael Sumner
> >> Hobart, Australia
> >> e-mail: mdsumner at gmail.com
> >>
> >> _______________________________________________
> >> R-sig-Geo mailing list
> >> R-sig-Geo at r-project.org
> >> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
> >
>
>
>
>--
>Michael Sumner
>Hobart, Australia
>e-mail: mdsumner at gmail.com



More information about the R-sig-Geo mailing list