[STATSGRASS] import DTM with readRAST6()

Markus Neteler neteler at itc.it
Thu Jul 12 05:08:27 EDT 2007


hi Matteo,

I have just made a test on a fresh installed machine with latest R
and sp* packages using a synthetic DEM (still don't have a real
DEM on this computer):

GRASS 6.3.cvs (bellunoOvest):~ > r.surf.fractal dem
Steps=1
Preliminary surface calculations.
Calculating surface 1 (of 1)
GRASS 6.3.cvs (bellunoOvest):~ > R

R version 2.5.1 (2007-06-27)
...
> trentino.grid<-readRAST6("dem")
Error: could not find function "readRAST6"
> library(spgrass6)
Loading required package: sp
Loading required package: maptools
Loading required package: foreign
Loading required package: rgdal
Geospatial Data Abstraction Library extensions to R successfully loaded

> trentino.grid<-readRAST6("dem")
Creating BIL support files ...
Header File =
/home/neteler/grassdata/bellunoOvest/PERMANENT/.tmp/localhost/dem.hdr
World File =
/home/neteler/grassdata/bellunoOvest/PERMANENT/.tmp/localhost/dem.wld
Exporting Raster as double values(bytes=8)
Using the Current Region settings ...
north=5175700.000000
south=5084600.000000
east=1787600.000000
west=1706300.000000
r=911
c=813
 100%

> summary(trentino.grid)
Object of class SpatialGridDataFrame
Coordinates:
              min     max
coords.x1 1706300 1787600
coords.x2 5084600 5175700
Is projected: TRUE
proj4string :
[+proj=tmerc +lat_0=0 +lon_0=9 +k=0.999600 +x_0=1500000 +y_0=0 +no_defs
+a=6378388 +rf=297 +towgs84=-225.000,-65.000,9.000 +to_meter=1]
Number of points: 2
Grid attributes:
  cellcentre.offset cellsize cells.dim
1           1706350      100       813
2           5084650      100       911
Data attributes:
      dem
 Min.   :-604.82
 1st Qu.:-289.55
 Median :  49.31
 Mean   :  23.07
 3rd Qu.: 334.70
 Max.   : 669.46

> system("r.info -r dem")
min=-604.821087
max=669.457656

> system("r.info -t dem")
datatype=DCELL

Looks all functional. I am using 6.3, though. Do you use a 64bit machine
(like me)? Probably there were 64bit fixes after GRASS 6.2.1, I don't
remember in this moment.

Did you run
update.packages()
for your R installation?

ciao
Markus

-- 
View this message in context: http://www.nabble.com/import-DTM-with-readRAST6%28%29-tf4049321.html#a11556201
Sent from the Grass - Stats mailing list archive at Nabble.com.




More information about the grass-stats mailing list