Hi all, I have a very simple problem, I just want to define a projection for raster data. However I have no experience with spatial analysis with R, so maybe someone could give me a hint: My data are radiation raster data for Austria, in .asc-format . I have the following information: Map projection: geographic (latitude/longitude), ellipsoid WGS84 North: 49N South: 46:30N West: 9:30E East: 17:30E Resolution 1'30'' ...giving a total of 100 rows and 320 columns. Is this information enough to get the right projection and if yes, how do I define it in R? Thank you so much and kind regards Dieter Mayr from Vienna -- View this message in context: http://r-sig-geo.2731867.n2.nabble.com/define-projection-for-Raster-data-tp6768128p6768128.html Sent from the R-sig-geo mailing list archive at Nabble.com.
define projection for Raster data
2 messages · didimayr, Fischbach, Anthony
Dear Dieter,
Please refer to the documentation of rgdal and sp. Also as another newbie
to spatial data in R, I can strongly recommend starting your reading with
Bivand, Pebesma and G?mez-Rubio (2008: Applied Spatial Data Analysis with R.
Springer).
To cast your raster map into a spatialPixelDataFrame, you will need to write
a script that has these elements.
require(rgdal)
require(sp)
##read ascii grid using GDAL binding
map <- readGDAL("[your working directory]/map.asc")
## coerce into a spatialPixelDataFrame
hab <- asc2spixdf(map)
## Assign a Coordinate Reference System using a PROJ.4 string
prj <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +
...[please see http://trac.osgeo.org/proj/wiki/GenParms to set your specific
parameters]")
proj4string(hab) <- prj
HTH
Anthony
-----
Tony Fischbach, Wildlife Biologist
Walrus Research Program
Alaska Science Center
U.S. Geological Survey
4210 University Drive
Anchorage, AK 99508-4650
AFischbach at usgs.gov
http://alaska.usgs.gov/science/biology/walrus
--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/define-projection-for-Raster-data-tp6768128p6768425.html
Sent from the R-sig-geo mailing list archive at Nabble.com.