raster integer *3 ?

Hi!

I'm exporting a Grass raster to another
software. I'm surprised by the fact
that the raster is 321x414x3 bytes.
Normally, it should be either 321x421x2 or
321x414x4.

Besides using r.mapcalc and transforming it
to float, is there any way to pass it
to int*4 (long integer)?

Thanks

Agus
Dr. Agustin Lobo
Instituto de Ciencias de la Tierra (CSIC)
Lluis Sole Sabaris s/n
08028 Barcelona SPAIN
tel 34 93409 5410
fax 34 93411 0012
alobo@ija.csic.es
http://pangea.ija.csic.es/alobo

Hi, Agus!
I don't really have an answer to your problem, but I wanted to comment
on it. I always considered it a plus that GRASS used only the minimum
number of bytes necessary (1, 2, 3, or 4) to store its raster data. When
converting to Intergraph's raster format, file size often grew
considerably due to being forced to long int.

Truth is, I guess I'm usually more interested in importing data to
GRASS, rather than exporting from GRASS! :slight_smile:

Best regards,
  -Malcolm

Malcolm D. Williamson malcolm@cast.uark.edu
Center for Advanced Spatial Technologies Voice: 501-575-2734
12 Ozark Hall Fax: 501-575-5218
University of Arkansas, Fayetteville AR 72701
http://www.cast.uark.edu/

Agustin Lobo wrote:

Hi!

I'm exporting a Grass raster to another
software. I'm surprised by the fact
that the raster is 321x414x3 bytes.
Normally, it should be either 321x421x2 or
321x414x4.

Besides using r.mapcalc and transforming it
to float, is there any way to pass it
to int*4 (long integer)?

Thanks

Agus
Dr. Agustin Lobo
Instituto de Ciencias de la Tierra (CSIC)
Lluis Sole Sabaris s/n
08028 Barcelona SPAIN
tel 34 93409 5410
fax 34 93411 0012
alobo@ija.csic.es
http://pangea.ija.csic.es/alobo

--
Best regards,
  -Malcolm

Malcolm D. Williamson malcolm@cast.uark.edu
Center for Advanced Spatial Technologies Voice: 501-575-2734
12 Ozark Hall Fax: 501-575-5218
University of Arkansas, Fayetteville AR 72701
http://www.cast.uark.edu/

Thanks Bill and Malcolm.

Bill said

"Probably the easiest way is to use mapcalc to reassign one of the
category values to a value that requires 4 bytes for storage"

ok, this is equivalent to use float(raster).

" Make sure you have an uncompressed
raster - mapcalc and other programs write compressed. (use r.compress)"

Yes, I'm aware of this. Actually, I've found that sometimes
compressed files are larger than uncompressed ones!

Malcolm said:

"I always considered it a plus that GRASS used only the minimum
number of bytes necessary (1, 2, 3, or 4) to store its raster data"

Yes, I agree, this is a good feature, as compressing by default. We just
have to be aware of both.

Agus

Dr. Agustin Lobo
Instituto de Ciencias de la Tierra (CSIC)
Lluis Sole Sabaris s/n
08028 Barcelona SPAIN
tel 34 93409 5410
fax 34 93411 0012
alobo@ija.csic.es
http://pangea.ija.csic.es/alobo