getcontour {adehabitat} | R Documentation

## Computes the Contour Polygon of a Raster Object

### Description

`getcontour` computes the contour polygon of a raster object of class `asc`. When the object is made of several parts, the function returns one polygon per part.

### Usage

    getcontour(x)

### Arguments

`x` | an object of class `asc`

### Value

Returns an object of class `area`.

### Warning

Holes in the polygons are not taken into account by the function.

### Author(s)

Clément Calenge calenge@biomserv.univ-lyon1.fr

### See Also

`import.asc` for additionnal information on objects of class `asc`, `as.area` for information on objects of class `area`, and `area2dxf` to export the results toward a GIS.

### Examples

    data(puechabon)
    kasc <- puechabon$kasc

    #########################################
    ## Example with one object:
    ## Gets the first map of the "kasc" object
    ## Map of the elevation
    elev <- getkasc(kasc, "Elevation")
    image(elev)

    ## Get the contour polygon
    cpol <- getcontour(elev)

    ## Draw the polygon
    i <- cpol[,2:3]
    polygon(i, col = "green", lwd = 2)

    #########################################
    ## Example with two objects:
    ## home ranges of wild boar

    hr <- getsahrlocs(puechabon$sahr, "hr")
    u <- getkasc(hr, "Jean")
    image(u)

    ## Get the contour polygons
    p <- getcontour(u)
    plot(p, lwd = 2)

[Package adehabitat version 1.3 Index]