[R-sig-Geo] Delimit a polygon for the region which is> 1000 m from my raster altitude

MacQueen, Don macqueen1 at llnl.gov
Fri May 1 01:02:11 CEST 2015


Look into the help page for the contour function in the raster package
It refers to
  RasterToContour

Follow the example given in ?RasterToContour
(copied here)
f <- system.file("external/test.grd", package="raster")
r <- raster(f)
x <- rasterToContour(r, levels=500)
class(x)
plot(r)
plot(x, add=TRUE)


Then see:
class(x)

Then x can be written to a shapefile using writeOGR in the rgdal package.


-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





On 4/30/15, 3:12 PM, "sadaoui" <sadaouimahrez at outlook.com> wrote:

>*Hello,
>I am new to this forum
>
>My goal is to define a polygon for the region> 1000 m from raster of
>altitude
>  then export to shapefile.
>
>I tried with this code:
>
>#import the raster: (attachment)
>
>library (raster)
>map <- raster ("Adige.tif")
>
>#Delimit the area (> 1000 m) with the "contour"
>
>
>contour (map, add = T, levels = c (1000))
>
>
>but I can not export the contour to shapefile
>
>thank you in advance for helping me
>
>sadaoui*
>
>
>
>--
>View this message in context:
>http://r-sig-geo.2731867.n2.nabble.com/Delimit-a-polygon-for-the-region-wh
>ich-is-1000-m-from-my-raster-altitude-tp7588147.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



More information about the R-sig-Geo mailing list