On 7/8/2011 9:33 AM, Johan Van de Wauw wrote:
Apart from grass gis, you can also do this in saga gis, or run this
through RSAGA. Since it seems you have to do this only once, it would
be much easier to just use the GUI.

1) Open your shapefile
2) run the module grid\shapes to grid (choose a reasonable cell size)
3) run the module grid\close gaps (you now have a altitude grid)
4) run the module terrain analysis\morphometry\slope,aspect... (you
now have a slope grid)
5) you could now overlay your points, or do that in R.

Or if you prefer coding ;)

> rm(volcano)
> volcano <- ContourLines2SLDF(contourLines(volcano))
> volcano$altitude <- as.numeric(as.character(volcano$level))
> writeLinesShape(volcano, "volcano.shp")

> rsaga.get.usage(lib="grid_gridding", module=0)
# SAGA 2.0.7
library name:   grid_gridding
module name :   Shapes to Grid
# interpolate lines to rasters:
> rsaga.geoprocessor(lib="grid_gridding", module=0, param=list(GRID="DEM.sgrd", INPUT="volcano.shp", FIELD=0, LINE_TYPE=0, USER_SIZE=10))
# close gaps with splines:
> rsaga.geoprocessor(lib="grid_tools", module=7, param=list(INPUT="DEM.sgrd", RESULT="DEM.sgrd")) # write to the same file


for more examples see also

http://spatial-analyst.net/book/Geomorphmapping

http://geomorphometry.org/content/uncertainty-stream-networks-derived-elevation-data


T. Hengl
http://www.wewur.wur.nl/popups/vcard.aspx?id=HENGL001



http://www.saga-gis.org


Johan

On Thu, Jul 7, 2011 at 6:25 PM, Sarah Papworth
<sarah.papwort...@imperial.ac.uk>  wrote:
Dear all,

I have a jpg map of altitudinal contours in my study area which I
would like to map and use in R to calculate the altitude and slope of
GPS coordinates.
So far, I have painstakingly traced these contours in ArcMap to create
a shapefile (of polylines) with altitude. I have now imported this
file shapefile into R.

  What I would like to do is turn it into a raster of slope and
altitude, but I can't seem to find any method of doing this in the
online R help archives. Does anyone have any idea which package I
should be using, or perhaps if it is even possible to turn this type
of shapefile into a raster?

Thanks in advance!

Sarah


--
Imperial College London
http://www.iccs.org.uk/sarahpapworth.htm

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo


_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to