import DTM with readRAST6()

8 messages Options
Embed this post
Permalink
Matteo Dall'Amico

import DTM with readRAST6()

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
Hello everybody,
I am a new R & Grass user.
I am interested in doing a kriging of the Temperature in a basin, based on pixel elevation (DTM).
I use Grass 6.2.1 and R 2.5.1 and have installed the spgrass6 package.

The DTM is called "DTM_trentino_100m" and has a header and data like the following:

north:5158000.0
south:5058500.0
east:1729700.0
west:1611600.0
rows:995
cols:1181
-9999.0 -9999.0 -9999.0 370.84381103515625 372.55120849609375 373.13128662109375 .....

I have opened R inside the Grass location, and imported the DTM:

>  trentino.grid<-readRAST6("DTM_trentino_100m")
Creating BIL support files ...
Header File = /Users/Matteo/Documents/DataGrass/GBovest/Permafrost/.tmp/nilo.local/DTM_trentino_100m.hdr
World File = /Users/Matteo/Documents/DataGrass/GBovest/Permafrost/.tmp/nilo.local/DTM_trentino_100m.wld
Exporting Raster as double values(bytes=8)
Using the Current Region settings ...
north=5158000.000000
south=5058500.000000
east=1729700.000000
west=1611600.000000
r=995
c=1181

Percent complete:  100%
r.out.bin complete.

> summary(trentino.grid)
Object of class SpatialGridDataFrame
Coordinates:
              min     max
coords.x1 1611600 1729700
coords.x2 5058500 5158000
Is projected: TRUE
proj4string :
[+proj=tmerc +lat_0=0.0000000000 +lon_0=9.0000000000 +k_0=0.9996000000
+x_0=1500000.0000000000 +y_0=0.0000000000 +a=6378388 +rf=297 +no_defs
+towgs84=-225.000,-65.000,9.000]
Number of points: 2
Grid attributes:
  cellcentre.offset cellsize cells.dim
1           1611650      100      1181
2           5058550      100       995
Data attributes:
DTM_trentino_100m
Min.   :1.192e-319
1st Qu.:1.065e-314
Median :1.066e-314
Mean   :1.285e-312
3rd Qu.:2.722e-312
Max.   :4.774e-312

As you can see, the import has been fully done, yet the attributes are not correct. In fact, the Min. value is 1.192e-319 and the Max is 4.774e-312 but in reality the elevation changes between 60m to 3500m.
Have I done something wrong? What should I do?
Thank you in advance,

Matteo


---------------------------------
Matteo Dall'Amico
PhD candidate
CUDAM and department of Civil and Environmental Engineering
Universita' degli Studi di Trento
Via Mesiano 77 - 38050 Trento - Italy
Tel. +39 0461 882610
Fax +39 0461 882672
---------------------------------



_______________________________________________
statsgrass mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/statsgrass
Carlos Grohmann-2

Re: import DTM with readRAST6()

Reply Threaded More More options
Print post
Permalink
try to
str(trentino.grid)

the summary() you want is probably

summary(trentino.grid$DTM_trentino_100m)

hope this helps
Carlos



On 7/9/07, Matteo Dall'Amico <[hidden email]> wrote:

>
> Hello everybody,
> I am a new R & Grass user.
> I am interested in doing a kriging of the Temperature in a basin, based on
> pixel elevation (DTM).
> I use Grass 6.2.1 and R 2.5.1 and have installed the spgrass6 package.
>
> The DTM is called "DTM_trentino_100m" and has a header and data like the
> following:
>
> north:5158000.0
> south:5058500.0
> east:1729700.0
> west:1611600.0
> rows:995
> cols:1181
> -9999.0 -9999.0 -9999.0 370.84381103515625 372.55120849609375
> 373.13128662109375 .....
>
> I have opened R inside the Grass location, and imported the DTM:
>
> >  trentino.grid<-readRAST6("DTM_trentino_100m")
> Creating BIL support files ...
> Header File =
> /Users/Matteo/Documents/DataGrass/GBovest/Permafrost/.tmp/nilo.local/DTM_trentino_100m.hdr
> World File =
> /Users/Matteo/Documents/DataGrass/GBovest/Permafrost/.tmp/nilo.local/DTM_trentino_100m.wld
> Exporting Raster as double values(bytes=8)
> Using the Current Region settings ...
> north=5158000.000000
> south=5058500.000000
> east=1729700.000000
> west=1611600.000000
> r=995
> c=1181
>
> Percent complete:  100%
> r.out.bin complete.
>
> > summary(trentino.grid)
> Object of class SpatialGridDataFrame
> Coordinates:
>               min     max
> coords.x1 1611600 1729700
> coords.x2 5058500 5158000
> Is projected: TRUE
> proj4string :
> [+proj=tmerc +lat_0=0.0000000000 +lon_0=9.0000000000 +k_0=0.9996000000
> +x_0=1500000.0000000000 +y_0=0.0000000000 +a=6378388 +rf=297 +no_defs
> +towgs84=-225.000,-65.000,9.000]
> Number of points: 2
> Grid attributes:
>   cellcentre.offset cellsize cells.dim
> 1           1611650      100      1181
> 2           5058550      100       995
> Data attributes:
> DTM_trentino_100m
> Min.   :1.192e-319
> 1st Qu.:1.065e-314
> Median :1.066e-314
> Mean   :1.285e-312
> 3rd Qu.:2.722e-312
> Max.   :4.774e-312
>
> As you can see, the import has been fully done, yet the attributes are not
> correct. In fact, the Min. value is 1.192e-319 and the Max is 4.774e-312 but
> in reality the elevation changes between 60m to 3500m.
> Have I done something wrong? What should I do?
> Thank you in advance,
>
> Matteo
>
>
> ---------------------------------
> Matteo Dall'Amico
> PhD candidate
> CUDAM and department of Civil and Environmental Engineering
> Universita' degli Studi di Trento
> Via Mesiano 77 - 38050 Trento - Italy
> email: [hidden email]
> Tel. +39 0461 882610
> Fax +39 0461 882672
> http://www.dottorato.it/trento/
> ---------------------------------
>
>
> _______________________________________________
> statsgrass mailing list
> [hidden email]
> http://grass.itc.it/mailman/listinfo/statsgrass
>
>


--
+-----------------------------------------------------------+
              Carlos Henrique Grohmann - Guano
  Visiting Researcher at Kingston University London - UK
  Geologist M.Sc  - Doctorate Student at IGc-USP - Brazil
Linux User #89721  - carlos dot grohmann at gmail dot com
+-----------------------------------------------------------+
_________________
"Good morning, doctors. I have taken the liberty of removing Windows
95 from my hard drive."
--The winning entry in a "What were HAL's first words" contest judged
by 2001: A SPACE ODYSSEY creator Arthur C. Clarke

_______________________________________________
statsgrass mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/statsgrass
Matteo Dall'Amico

Re: import DTM with readRAST6()

Reply Threaded More More options
Print post
Permalink
Hi Carlos,
thank you for your reply.
I think the problem is that the import was not successful. As you see  
from data attributes,

Data attributes:
DTM_trentino_100m
Min.   :1.192e-319
1st Qu.:1.065e-314
Median :1.066e-314
Mean   :1.285e-312
3rd Qu.:2.722e-312
Max.   :4.774e-312

the elevations are not correct. I would expect values ranging between  
60 and 3500m and not from 1.192e-319 to 4.774e-312.
I think the problem lays in the import procedure during readRAST6().
Any suggestion?
Thanks in advance,
Matteo

On 9 Jul 2007, at 15:41, Carlos Guâno Grohmann wrote:

> try to
> str(trentino.grid)
>
> the summary() you want is probably
>
> summary(trentino.grid$DTM_trentino_100m)
>
> hope this helps
> Carlos
>
>
>
> On 7/9/07, Matteo Dall'Amico <[hidden email]> wrote:
>>
>> Hello everybody,
>> I am a new R & Grass user.
>> I am interested in doing a kriging of the Temperature in a basin,  
>> based on
>> pixel elevation (DTM).
>> I use Grass 6.2.1 and R 2.5.1 and have installed the spgrass6  
>> package.
>>
>> The DTM is called "DTM_trentino_100m" and has a header and data  
>> like the
>> following:
>>
>> north:5158000.0
>> south:5058500.0
>> east:1729700.0
>> west:1611600.0
>> rows:995
>> cols:1181
>> -9999.0 -9999.0 -9999.0 370.84381103515625 372.55120849609375
>> 373.13128662109375 .....
>>
>> I have opened R inside the Grass location, and imported the DTM:
>>
>> >  trentino.grid<-readRAST6("DTM_trentino_100m")
>> Creating BIL support files ...
>> Header File =
>> /Users/Matteo/Documents/DataGrass/GBovest/Permafrost/.tmp/
>> nilo.local/DTM_trentino_100m.hdr
>> World File =
>> /Users/Matteo/Documents/DataGrass/GBovest/Permafrost/.tmp/
>> nilo.local/DTM_trentino_100m.wld
>> Exporting Raster as double values(bytes=8)
>> Using the Current Region settings ...
>> north=5158000.000000
>> south=5058500.000000
>> east=1729700.000000
>> west=1611600.000000
>> r=995
>> c=1181
>>
>> Percent complete:  100%
>> r.out.bin complete.
>>
>> > summary(trentino.grid)
>> Object of class SpatialGridDataFrame
>> Coordinates:
>>               min     max
>> coords.x1 1611600 1729700
>> coords.x2 5058500 5158000
>> Is projected: TRUE
>> proj4string :
>> [+proj=tmerc +lat_0=0.0000000000 +lon_0=9.0000000000  
>> +k_0=0.9996000000
>> +x_0=1500000.0000000000 +y_0=0.0000000000 +a=6378388 +rf=297 +no_defs
>> +towgs84=-225.000,-65.000,9.000]
>> Number of points: 2
>> Grid attributes:
>>   cellcentre.offset cellsize cells.dim
>> 1           1611650      100      1181
>> 2           5058550      100       995
>> Data attributes:
>> DTM_trentino_100m
>> Min.   :1.192e-319
>> 1st Qu.:1.065e-314
>> Median :1.066e-314
>> Mean   :1.285e-312
>> 3rd Qu.:2.722e-312
>> Max.   :4.774e-312
>>
>> As you can see, the import has been fully done, yet the attributes  
>> are not
>> correct. In fact, the Min. value is 1.192e-319 and the Max is  
>> 4.774e-312 but
>> in reality the elevation changes between 60m to 3500m.
>> Have I done something wrong? What should I do?
>> Thank you in advance,
>>
>> Matteo
>>
>>
>> ---------------------------------
>> Matteo Dall'Amico
>> PhD candidate
>> CUDAM and department of Civil and Environmental Engineering
>> Universita' degli Studi di Trento
>> Via Mesiano 77 - 38050 Trento - Italy
>> email: [hidden email]
>> Tel. +39 0461 882610
>> Fax +39 0461 882672
>> http://www.dottorato.it/trento/
>> ---------------------------------
>>
>>
>> _______________________________________________
>> statsgrass mailing list
>> [hidden email]
>> http://grass.itc.it/mailman/listinfo/statsgrass
>>
>>
>
>
> --
> +-----------------------------------------------------------+
>              Carlos Henrique Grohmann - Guano
>  Visiting Researcher at Kingston University London - UK
>  Geologist M.Sc  - Doctorate Student at IGc-USP - Brazil
> Linux User #89721  - carlos dot grohmann at gmail dot com
> +-----------------------------------------------------------+
> _________________
> "Good morning, doctors. I have taken the liberty of removing Windows
> 95 from my hard drive."
> --The winning entry in a "What were HAL's first words" contest judged
> by 2001: A SPACE ODYSSEY creator Arthur C. Clarke
>
> _______________________________________________
> statsgrass mailing list
> [hidden email]
> http://grass.itc.it/mailman/listinfo/statsgrass
>


_______________________________________________
statsgrass mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/statsgrass
Carlos Grohmann-2

Re: import DTM with readRAST6()

Reply Threaded More More options
Print post
Permalink
I just tested here in grass 6.2.1 (ubuntu package), it worked fine.

I see you have some very "precise" elevation readings:
370.84381103515625....

and that in the import process, data is exported as double (bytes=8),
maybe this is the problem?

any way you can get that elevations with less decimal values?

just a guess, but..

Carlos






On 7/9/07, Matteo Dall'Amico <[hidden email]> wrote:

> Hi Carlos,
> thank you for your reply.
> I think the problem is that the import was not successful. As you see
> from data attributes,
>
> Data attributes:
> DTM_trentino_100m
> Min.   :1.192e-319
> 1st Qu.:1.065e-314
> Median :1.066e-314
> Mean   :1.285e-312
> 3rd Qu.:2.722e-312
> Max.   :4.774e-312
>
> the elevations are not correct. I would expect values ranging between
> 60 and 3500m and not from 1.192e-319 to 4.774e-312.
> I think the problem lays in the import procedure during readRAST6().
> Any suggestion?
> Thanks in advance,
> Matteo
>
> On 9 Jul 2007, at 15:41, Carlos Guâno Grohmann wrote:
>
> > try to
> > str(trentino.grid)
> >
> > the summary() you want is probably
> >
> > summary(trentino.grid$DTM_trentino_100m)
> >
> > hope this helps
> > Carlos
> >
> >
> >
> > On 7/9/07, Matteo Dall'Amico <[hidden email]> wrote:
> >>
> >> Hello everybody,
> >> I am a new R & Grass user.
> >> I am interested in doing a kriging of the Temperature in a basin,
> >> based on
> >> pixel elevation (DTM).
> >> I use Grass 6.2.1 and R 2.5.1 and have installed the spgrass6
> >> package.
> >>
> >> The DTM is called "DTM_trentino_100m" and has a header and data
> >> like the
> >> following:
> >>
> >> north:5158000.0
> >> south:5058500.0
> >> east:1729700.0
> >> west:1611600.0
> >> rows:995
> >> cols:1181
> >> -9999.0 -9999.0 -9999.0 370.84381103515625 372.55120849609375
> >> 373.13128662109375 .....
> >>
> >> I have opened R inside the Grass location, and imported the DTM:
> >>
> >> >  trentino.grid<-readRAST6("DTM_trentino_100m")
> >> Creating BIL support files ...
> >> Header File =
> >> /Users/Matteo/Documents/DataGrass/GBovest/Permafrost/.tmp/
> >> nilo.local/DTM_trentino_100m.hdr
> >> World File =
> >> /Users/Matteo/Documents/DataGrass/GBovest/Permafrost/.tmp/
> >> nilo.local/DTM_trentino_100m.wld
> >> Exporting Raster as double values(bytes=8)
> >> Using the Current Region settings ...
> >> north=5158000.000000
> >> south=5058500.000000
> >> east=1729700.000000
> >> west=1611600.000000
> >> r=995
> >> c=1181
> >>
> >> Percent complete:  100%
> >> r.out.bin complete.
> >>
> >> > summary(trentino.grid)
> >> Object of class SpatialGridDataFrame
> >> Coordinates:
> >>               min     max
> >> coords.x1 1611600 1729700
> >> coords.x2 5058500 5158000
> >> Is projected: TRUE
> >> proj4string :
> >> [+proj=tmerc +lat_0=0.0000000000 +lon_0=9.0000000000
> >> +k_0=0.9996000000
> >> +x_0=1500000.0000000000 +y_0=0.0000000000 +a=6378388 +rf=297 +no_defs
> >> +towgs84=-225.000,-65.000,9.000]
> >> Number of points: 2
> >> Grid attributes:
> >>   cellcentre.offset cellsize cells.dim
> >> 1           1611650      100      1181
> >> 2           5058550      100       995
> >> Data attributes:
> >> DTM_trentino_100m
> >> Min.   :1.192e-319
> >> 1st Qu.:1.065e-314
> >> Median :1.066e-314
> >> Mean   :1.285e-312
> >> 3rd Qu.:2.722e-312
> >> Max.   :4.774e-312
> >>
> >> As you can see, the import has been fully done, yet the attributes
> >> are not
> >> correct. In fact, the Min. value is 1.192e-319 and the Max is
> >> 4.774e-312 but
> >> in reality the elevation changes between 60m to 3500m.
> >> Have I done something wrong? What should I do?
> >> Thank you in advance,
> >>
> >> Matteo
> >>
> >>
> >> ---------------------------------
> >> Matteo Dall'Amico
> >> PhD candidate
> >> CUDAM and department of Civil and Environmental Engineering
> >> Universita' degli Studi di Trento
> >> Via Mesiano 77 - 38050 Trento - Italy
> >> email: [hidden email]
> >> Tel. +39 0461 882610
> >> Fax +39 0461 882672
> >> http://www.dottorato.it/trento/
> >> ---------------------------------
> >>
> >>
> >> _______________________________________________
> >> statsgrass mailing list
> >> [hidden email]
> >> http://grass.itc.it/mailman/listinfo/statsgrass
> >>
> >>
> >
> >
> > --
> > +-----------------------------------------------------------+
> >              Carlos Henrique Grohmann - Guano
> >  Visiting Researcher at Kingston University London - UK
> >  Geologist M.Sc  - Doctorate Student at IGc-USP - Brazil
> > Linux User #89721  - carlos dot grohmann at gmail dot com
> > +-----------------------------------------------------------+
> > _________________
> > "Good morning, doctors. I have taken the liberty of removing Windows
> > 95 from my hard drive."
> > --The winning entry in a "What were HAL's first words" contest judged
> > by 2001: A SPACE ODYSSEY creator Arthur C. Clarke
> >
> > _______________________________________________
> > statsgrass mailing list
> > [hidden email]
> > http://grass.itc.it/mailman/listinfo/statsgrass
> >
>
>


--
+-----------------------------------------------------------+
              Carlos Henrique Grohmann - Guano
  Visiting Researcher at Kingston University London - UK
  Geologist M.Sc  - Doctorate Student at IGc-USP - Brazil
Linux User #89721  - carlos dot grohmann at gmail dot com
+-----------------------------------------------------------+
_________________
"Good morning, doctors. I have taken the liberty of removing Windows
95 from my hard drive."
--The winning entry in a "What were HAL's first words" contest judged
by 2001: A SPACE ODYSSEY creator Arthur C. Clarke

_______________________________________________
statsgrass mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/statsgrass
Matteo Dall'Amico

Re: import DTM with readRAST6()

Reply Threaded More More options
Print post
Permalink
Hello Carlos,
I tried to transform the DTM in integer values through the command:  
r.out.ascii -i

then I did again the import with readRAST6() but the result is the same:

 > summary(trent.grid.integer)
Object of class SpatialGridDataFrame
Coordinates:
               min     max
coords.x1 1611600 1729700
coords.x2 5058500 5158000
Is projected: TRUE
proj4string :
[+proj=tmerc +lat_0=0.0000000000 +lon_0=9.0000000000 +k_0=0.9996000000
+x_0=1500000.0000000000 +y_0=0.0000000000 +a=6378388 +rf=297 +no_defs
+towgs84=-225.000,-65.000,9.000]
Number of points: 2
Grid attributes:
   cellcentre.offset cellsize cells.dim
1           1611650      100      1181
2           5058550      100       995
Data attributes:
DTM_trent_100m
Min.   :1.192e-319
1st Qu.:1.065e-314
Median :1.066e-314
Mean   :1.285e-312
3rd Qu.:2.722e-312
Max.   :4.774e-312


As you see, I didn't obtain a good import, as the elevation values  
are still strange...
Any idea?

Matteo

On 9 Jul 2007, at 16:40, Carlos Guâno Grohmann wrote:

> I just tested here in grass 6.2.1 (ubuntu package), it worked fine.
>
> I see you have some very "precise" elevation readings:
> 370.84381103515625....
>
> and that in the import process, data is exported as double (bytes=8),
> maybe this is the problem?
>
> any way you can get that elevations with less decimal values?
>
> just a guess, but..
>
> Carlos
>
>
>
>
>
>
> On 7/9/07, Matteo Dall'Amico <[hidden email]> wrote:
>> Hi Carlos,
>> thank you for your reply.
>> I think the problem is that the import was not successful. As you see
>> from data attributes,
>>
>> Data attributes:
>> DTM_trentino_100m
>> Min.   :1.192e-319
>> 1st Qu.:1.065e-314
>> Median :1.066e-314
>> Mean   :1.285e-312
>> 3rd Qu.:2.722e-312
>> Max.   :4.774e-312
>>
>> the elevations are not correct. I would expect values ranging between
>> 60 and 3500m and not from 1.192e-319 to 4.774e-312.
>> I think the problem lays in the import procedure during readRAST6().
>> Any suggestion?
>> Thanks in advance,
>> Matteo
>>
>> On 9 Jul 2007, at 15:41, Carlos Guâno Grohmann wrote:
>>
>> > try to
>> > str(trentino.grid)
>> >
>> > the summary() you want is probably
>> >
>> > summary(trentino.grid$DTM_trentino_100m)
>> >
>> > hope this helps
>> > Carlos
>> >
>> >
>> >
>> > On 7/9/07, Matteo Dall'Amico <[hidden email]> wrote:
>> >>
>> >> Hello everybody,
>> >> I am a new R & Grass user.
>> >> I am interested in doing a kriging of the Temperature in a basin,
>> >> based on
>> >> pixel elevation (DTM).
>> >> I use Grass 6.2.1 and R 2.5.1 and have installed the spgrass6
>> >> package.
>> >>
>> >> The DTM is called "DTM_trentino_100m" and has a header and data
>> >> like the
>> >> following:
>> >>
>> >> north:5158000.0
>> >> south:5058500.0
>> >> east:1729700.0
>> >> west:1611600.0
>> >> rows:995
>> >> cols:1181
>> >> -9999.0 -9999.0 -9999.0 370.84381103515625 372.55120849609375
>> >> 373.13128662109375 .....
>> >>
>> >> I have opened R inside the Grass location, and imported the DTM:
>> >>
>> >> >  trentino.grid<-readRAST6("DTM_trentino_100m")
>> >> Creating BIL support files ...
>> >> Header File =
>> >> /Users/Matteo/Documents/DataGrass/GBovest/Permafrost/.tmp/
>> >> nilo.local/DTM_trentino_100m.hdr
>> >> World File =
>> >> /Users/Matteo/Documents/DataGrass/GBovest/Permafrost/.tmp/
>> >> nilo.local/DTM_trentino_100m.wld
>> >> Exporting Raster as double values(bytes=8)
>> >> Using the Current Region settings ...
>> >> north=5158000.000000
>> >> south=5058500.000000
>> >> east=1729700.000000
>> >> west=1611600.000000
>> >> r=995
>> >> c=1181
>> >>
>> >> Percent complete:  100%
>> >> r.out.bin complete.
>> >>
>> >> > summary(trentino.grid)
>> >> Object of class SpatialGridDataFrame
>> >> Coordinates:
>> >>               min     max
>> >> coords.x1 1611600 1729700
>> >> coords.x2 5058500 5158000
>> >> Is projected: TRUE
>> >> proj4string :
>> >> [+proj=tmerc +lat_0=0.0000000000 +lon_0=9.0000000000
>> >> +k_0=0.9996000000
>> >> +x_0=1500000.0000000000 +y_0=0.0000000000 +a=6378388 +rf=297  
>> +no_defs
>> >> +towgs84=-225.000,-65.000,9.000]
>> >> Number of points: 2
>> >> Grid attributes:
>> >>   cellcentre.offset cellsize cells.dim
>> >> 1           1611650      100      1181
>> >> 2           5058550      100       995
>> >> Data attributes:
>> >> DTM_trentino_100m
>> >> Min.   :1.192e-319
>> >> 1st Qu.:1.065e-314
>> >> Median :1.066e-314
>> >> Mean   :1.285e-312
>> >> 3rd Qu.:2.722e-312
>> >> Max.   :4.774e-312
>> >>
>> >> As you can see, the import has been fully done, yet the attributes
>> >> are not
>> >> correct. In fact, the Min. value is 1.192e-319 and the Max is
>> >> 4.774e-312 but
>> >> in reality the elevation changes between 60m to 3500m.
>> >> Have I done something wrong? What should I do?
>> >> Thank you in advance,
>> >>
>> >> Matteo
>> >>
>> >>
>> >> ---------------------------------
>> >> Matteo Dall'Amico
>> >> PhD candidate
>> >> CUDAM and department of Civil and Environmental Engineering
>> >> Universita' degli Studi di Trento
>> >> Via Mesiano 77 - 38050 Trento - Italy
>> >> email: [hidden email]
>> >> Tel. +39 0461 882610
>> >> Fax +39 0461 882672
>> >> http://www.dottorato.it/trento/
>> >> ---------------------------------
>> >>
>> >>
>> >> _______________________________________________
>> >> statsgrass mailing list
>> >> [hidden email]
>> >> http://grass.itc.it/mailman/listinfo/statsgrass
>> >>
>> >>
>> >
>> >
>> > --
>> > +-----------------------------------------------------------+
>> >              Carlos Henrique Grohmann - Guano
>> >  Visiting Researcher at Kingston University London - UK
>> >  Geologist M.Sc  - Doctorate Student at IGc-USP - Brazil
>> > Linux User #89721  - carlos dot grohmann at gmail dot com
>> > +-----------------------------------------------------------+
>> > _________________
>> > "Good morning, doctors. I have taken the liberty of removing  
>> Windows
>> > 95 from my hard drive."
>> > --The winning entry in a "What were HAL's first words" contest  
>> judged
>> > by 2001: A SPACE ODYSSEY creator Arthur C. Clarke
>> >
>> > _______________________________________________
>> > statsgrass mailing list
>> > [hidden email]
>> > http://grass.itc.it/mailman/listinfo/statsgrass
>> >
>>
>>
>
>
> --
> +-----------------------------------------------------------+
>              Carlos Henrique Grohmann - Guano
>  Visiting Researcher at Kingston University London - UK
>  Geologist M.Sc  - Doctorate Student at IGc-USP - Brazil
> Linux User #89721  - carlos dot grohmann at gmail dot com
> +-----------------------------------------------------------+
> _________________
> "Good morning, doctors. I have taken the liberty of removing Windows
> 95 from my hard drive."
> --The winning entry in a "What were HAL's first words" contest judged
> by 2001: A SPACE ODYSSEY creator Arthur C. Clarke
>
> _______________________________________________
> statsgrass mailing list
> [hidden email]
> http://grass.itc.it/mailman/listinfo/statsgrass
>


_______________________________________________
statsgrass mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/statsgrass
Markus Neteler-3

Re: import DTM with readRAST6()

Reply Threaded More More options
Print post
Permalink
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
Matteo Dall'Amico

Re: import DTM with readRAST6()

Reply Threaded More More options
Print post
Permalink
Hi Markus,
I own a MacBookPro with Intel processor and I am running Mac OSX  
version 10.4.10.
I have installed GRASS 6.2.1 and R 2.5.1.
I have tried all yesterday to read the raster DTM without success.
This is what I get:

 >trent.int<-readRAST6("DTM_integer")
Creating BIL support files ...
Header File = /Users/Matteo/Documents/DataGrass/GBovest/
Permafrost/.tmp/nilo.ing.unitn.it/DTM_integer.hdr
World File = /Users/Matteo/Documents/DataGrass/GBovest/
Permafrost/.tmp/nilo.ing.unitn.it/DTM_integer.wld
Exporting Raster as integer values (bytes=2)
Using the Current Region settings ...
north=5158000.000000
south=5058500.000000
east=1729700.000000
west=1611600.000000
r=995
c=1181

Percent complete:  100%
r.out.bin complete.

 > summary(trent.int)
Object of class SpatialGridDataFrame
Coordinates:
               min     max
coords.x1 1611600 1729700
coords.x2 5058500 5158000
Is projected: TRUE
proj4string :
[+proj=tmerc +lat_0=0.0000000000 +lon_0=9.0000000000 +k_0=0.9996000000
+x_0=1500000.0000000000 +y_0=0.0000000000 +a=6378388 +rf=297 +no_defs
+towgs84=-225.000,-65.000,9.000]
Number of points: 2
Grid attributes:
   cellcentre.offset cellsize cells.dim
1           1611650      100      1181
2           5058550      100       995
Data attributes:
   DTM_integer
Min.   :-32768
1st Qu.: -3624
Median : -3624
Mean   : -1991
3rd Qu.:  1028
Max.   : 32525

 > print(trent.int@data[100000:100150,])
   [1]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  
-3624  -3624
[11]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  
-3624
[21]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  
-3624
[31]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  
-3624
[41]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  
-3624
[51]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  
-3624
[61]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  
-3624
[71]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  
-3624
[81]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  
-3624
[91]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  
-3624
[101]  -3624  -3624  -3624  -3624 -19703  12298  22794   2058  -8951  
-17911
[111] -27895  29961  27401 -32759 -25079 -13815  15370  25354  30986  
-30710
[121] -15094   6923   -758  -7670 -17654 -22518 -20214 -30710  21258  
10506
[131]  17930 -28150 -26102  28938  23818   -247  26889 -31991 -15607  
10761
[141]  -4856 -18936  28936  14088  -4857 -21241   9223 -11002 -17658  
-9722
[151]   5639

As you can see, it doesn't distinguish the NODATA: instead of -9999  
it uses -3624.
Also in summary there is no notice of the NODATA.

I downloaded all the packages and then, from the terminal, I  
installed them using:

R CMD INSTALL name_of_package

I really think there are problems with my spgrass6 package and MacOS  
system.
Any idea?
Thanks,
Matteo

On 12 Jul 2007, at 11:08, Markus Neteler wrote:

>
> 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.
>
> _______________________________________________
> statsgrass mailing list
> [hidden email]
> http://grass.itc.it/mailman/listinfo/statsgrass
>

_______________________________________________
statsgrass mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/statsgrass
Markus Neteler-3

Re: import DTM with readRAST6()

Reply Threaded More More options
Print post
Permalink
On Thu, Jul 12, 2007 at 12:50:57PM +0200, Matteo Dall'Amico wrote:

> Hi Markus,
> I own a MacBookPro with Intel processor and I am running Mac OSX version
> 10.4.10.
> I have installed GRASS 6.2.1 and R 2.5.1.
> I have tried all yesterday to read the raster DTM without success.
> This is what I get:
>
> >trent.int<-readRAST6("DTM_integer")
> Creating BIL support files ...
> Header File =
> /Users/Matteo/Documents/DataGrass/GBovest/Permafrost/.tmp/nilo.ing.unitn.it/DTM_integer.hdr
> World File =
> /Users/Matteo/Documents/DataGrass/GBovest/Permafrost/.tmp/nilo.ing.unitn.it/DTM_integer.wld
> Exporting Raster as integer values (bytes=2)
> Using the Current Region settings ...
> north=5158000.000000
> south=5058500.000000
> east=1729700.000000
> west=1611600.000000
> r=995
> c=1181
>
> Percent complete:  100%
> r.out.bin complete.
>
> > summary(trent.int)
> Object of class SpatialGridDataFrame
> Coordinates:
>               min     max
> coords.x1 1611600 1729700
> coords.x2 5058500 5158000
> Is projected: TRUE
> proj4string :
> [+proj=tmerc +lat_0=0.0000000000 +lon_0=9.0000000000 +k_0=0.9996000000
> +x_0=1500000.0000000000 +y_0=0.0000000000 +a=6378388 +rf=297 +no_defs
> +towgs84=-225.000,-65.000,9.000]
> Number of points: 2
> Grid attributes:
>   cellcentre.offset cellsize cells.dim
> 1           1611650      100      1181
> 2           5058550      100       995
> Data attributes:
>   DTM_integer
> Min.   :-32768
> 1st Qu.: -3624
> Median : -3624
> Mean   : -1991
> 3rd Qu.:  1028
> Max.   : 32525
>
> > print(trent.int@data[100000:100150,])
>   [1]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624
> [11]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624
> [21]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624
> [31]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624
> [41]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624
> [51]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624
> [61]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624
> [71]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624
> [81]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624
> [91]  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624  -3624
> [101]  -3624  -3624  -3624  -3624 -19703  12298  22794   2058  -8951 -17911
> [111] -27895  29961  27401 -32759 -25079 -13815  15370  25354  30986 -30710
> [121] -15094   6923   -758  -7670 -17654 -22518 -20214 -30710  21258  10506
> [131]  17930 -28150 -26102  28938  23818   -247  26889 -31991 -15607  10761
> [141]  -4856 -18936  28936  14088  -4857 -21241   9223 -11002 -17658  -9722
> [151]   5639
>
> As you can see, it doesn't distinguish the NODATA: instead of -9999 it uses
> -3624.
> Also in summary there is no notice of the NODATA.
>
> I downloaded all the packages and then, from the terminal, I installed them
> using:
>
> R CMD INSTALL name_of_package

I would update like this:

http://grass.itc.it/statsgrass/grass6_r_install.html

# you need to be connected to the Internet to use these commands:
install.packages(c("sp","spgrass6","rgdal","maptools"), dependencies=TRUE)

> I really think there are problems with my spgrass6 package and MacOS
> system.
> Any idea?

Could you try a more recent GRASS?
http://www.kyngchaos.com/software/unixport/grass/

Markus

> Thanks,
> Matteo
>
> On 12 Jul 2007, at 11:08, Markus Neteler wrote:
>
>>
>> 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.
>>
>> _______________________________________________
>> statsgrass mailing list
>> [hidden email]
>> http://grass.itc.it/mailman/listinfo/statsgrass
>>
>

--
Markus Neteler  <neteler itc it>  http://mpa.itc.it/markus/
FBK-irst -  Centro per la Ricerca Scientifica e Tecnologica
MPBA - Predictive Models for Biol. & Environ. Data Analysis
Via Sommarive, 18        -       38050 Povo (Trento), Italy

_______________________________________________
statsgrass mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/statsgrass