hey list,
i just figured out that "cropping" of raster maps by the creation of a MASK and r.mapcalc is not exactly what i really intended:
i though the resulting maps are really clipped but it looks like the regions outside the mask are just white.
this is ok for me for one kind of rasters (have disturbing legends and annotations) but does not work for other maps.
is there a possibility to do something else?
by doing those operations i recognized also that the size of my data increases rapidly:
i import a 4 mb tiff (black and white) and by exporting it via r.out.tiff its size is 514 mb.
what could be the reason for this?
regards
axel
To crop a raster map, just resize your region using g.region or by using d.zoom.
Once you have the region of interest, just use
r.mapcalc newmap = oldmap
I am guessing your files are so big because you are exporting them out of a huge
region. The region determines a lot of what you do in grass. Make sure it is
set to the size you want before exporting or doing commands (it will save
significantly on processor time as well as memory).
G'luck
-Ian
Quoting Axel Orth <axel_orth@gmx.de>:
hey list,
i just figured out that "cropping" of raster maps by the creation of a
MASK and r.mapcalc is not exactly what i really intended:
i though the resulting maps are really clipped but it looks like the
regions outside the mask are just white.
this is ok for me for one kind of rasters (have disturbing legends and
annotations) but does not work for other maps.
is there a possibility to do something else?
by doing those operations i recognized also that the size of my data
increases rapidly:
i import a 4 mb tiff (black and white) and by exporting it via
r.out.tiff its size is 514 mb.
what could be the reason for this?
regards
axel
-----------------------------------------------------
Ian MacMillan
Geological Sciences-UCSB
"insert witticism here"
Axel Orth wrote:
i import a 4 mb tiff (black and white) and by exporting it via
r.out.tiff its size is 514 mb.
what could be the reason for this?
Apart from the region issue which Ian mentioned, r.out.tiff generates
24-bpp images by default, or 8-bpp images when the -p flag is used. If
your source images are 1-bpp, the resulting images will be expanded at
least 8-fold, in addition to any increase due to resampling to the
region's resolution.
There is no way to generate 1-bpp TIFF images directly from GRASS; you
will need to use a general-purpose image manipulation tool to reduce
the bit depth.
--
Glynn Clements <glynn@gclements.plus.com>
Thanks to everybody who helped me with this question.
Using g.region rast=map zoom=map instead of g.region rast=map created the cropped maps i intended.
The new set region in combination with "palette output" and the compression "deflate" improved the size a lot.
I did test concerning "palette output" before but the size grew so i did not use it anymore. I guess now that i did not
adjust the region the last time i used it.
Regards
Axel
hey,
looks like my joy has been a little bit hasty.
When i import the compressed files [no difference between -p and "deflate"] into the open source GIS JUMP, the "cropped" area
has a nasty color and is not white anymore [see attachment]. It is therefore impossible for me to make this part of the map transparent.
Though this is most probably a problem of the raster image plugin i have to use, i hope someone has a clue if this can be solved.
in hope of your help once again
Axel
hey,
looks like my joy has been a little bit hasty.
When i import the compressed files [no difference between -p and "deflate"] into the open source GIS JUMP, the "cropped" area
has a nasty color and is not white anymore [see attachment]. It is therefore impossible for me to make this part of the map transparent.
Though this is most probably a problem of the raster image plugin i have to use, i hope someone has a clue if this can be solved.
in hope of your help once again
Axel
(attachments)
