Why not use r.patch in grass to combine them, use g.region to set a smaller region and export, or create a mask of the smaller region and have the mask set when you use r.patch?
Jerry
---- Original message ----
Date: Mon, 5 Feb 2007 17:59:44 -0400
From: Tyler Smith <tyler.smith@mail.mcgill.ca>
Subject: [GRASS-user] combining tiles
To: grass help <grassuser@grass.itc.it>
Hi,
I'm a brand-new Grass user. I'm working on an ecological niche
modelling project, for which I'm using the WorldClim bioclimatic
tiles. They are distributed as .bil files, which I've figure out how
to get into Grass. I need to convert them to ESRI ascii grid formats,
which I can also do.
My problem is that I need the data from parts of four separate
tiles. I've set up my location so that it will clip the appropriate
section as I export the grids into ascii format, but the only way I
can figure out to get the data into a single grid is to export each of
the four tiles separately, manually cut off the headers, import the
matrices into R, cbind() or rbind() them together, write.table them back
to a file, and then put the header back on. This works, but it's
tedious!
There must be some Grass function to do this all in one step?
I've searched google and the on-line manuals with no luck, but
unfortunately I don't have access to the recommended published book
(waiting for the new edition before I buy it for myself).
Gerald Nelson
Professor, Dept. of Agricultural and Consumer Economics
University of Illinois, Urbana-Champaign
office: 217-333-6465
cell: 217-390-7888
315 Mumford Hall
1301 W. Gregory
Urbana, IL 61801
On Tue, Feb 06, 2007 at 12:37:00AM -0600, Gerald Nelson wrote:
Why not use r.patch in grass to combine them, use g.region to set a
smaller region and export, or create a mask of the smaller region
and have the mask set when you use r.patch?
Jerry
Yes, r.patch is the function I need, as several people have pointed
out off-list. I read the man page for r.patch before but didn't
understand it. I didn't realize that the tiles I imported were
automatically filled out with -9999 values such that they actually
covered the whole region, and not just that portion of the region that
they have data for. Now that I understand this, r.patch is obviously
what I need, and what I was in fact duplicating with my complicated
GRASS-Emacs-R-Emacs-GRASS translation.
Yes, r.patch is the function I need, as several people have pointed
out off-list. I read the man page for r.patch before but didn't
understand it. I didn't realize that the tiles I imported were
automatically filled out with -9999 values such that they actually
covered the whole region, and not just that portion of the region that
they have data for. Now that I understand this, r.patch is obviously
what I need, and what I was in fact duplicating with my complicated
GRASS-Emacs-R-Emacs-GRASS translation.
tips o'the day:
This command will turn -9999s into NULLs:
r.null setnull=-9999
This command will zoom to the extent of non-NULL data in a map:
g.region zoom=map
This command will extend the region to cover both raster maps:
g.region rast=map1,map2
On Wed, Feb 07, 2007 at 11:38:27AM +1300, Hamish wrote:
Gerald Nelson wrote:
> > Why not use r.patch in grass to combine them,
tips o'the day:
This command will turn -9999s into NULLs:
r.null setnull=-9999
Thank you, thank you, thank you!
Either this is a very common problem, or you were reading my
mind. I've been trying to get 19 maps coloured properly, and I'd
realized that none of the automatic settings were going to work
because of the -9999 values skewing all the schemes. I hadn't yet
figured out how to change those values to NULLs. I have exported my
tiles to ESRI ascii grids, and the -9999 values don't appear to have
influenced the subsequent analysis in Maxent. But it was getting very
tedious hand-editing the colour tables.
Either this is a very common problem, or you were reading my
mind. I've been trying to get 19 maps coloured properly, and I'd
realized that none of the automatic settings were going to work
because of the -9999 values skewing all the schemes. I hadn't yet
figured out how to change those values to NULLs. I have exported my
tiles to ESRI ascii grids, and the -9999 values don't appear to have
influenced the subsequent analysis in Maxent. But it was getting very
tedious hand-editing the colour tables.
You don't have to hand-edit all color tables for each map. Just edit
a rules file for on map then run: r.colors - Creates/Modifies the color table associated with a raster map layer.
r.colors map=your_map_that_has_skewed_colortable color=a_rules_file #then
r.colors map=your_other_maps_with_skewed_colortable
rast=your_map_that_has_corrected_colortable
hope it helps.
Maning
|---------|----------------------------------------------------------|
| __.-._ |"Ohhh. Great warrior. Wars not make one great." -Yoda |
| '-._"7' |"Freedom is still the most radical idea of all" -N.Branden|
| /'.-c |Linux registered user #402901, http://counter.li.org/ |
| | /T |http://esambale.wikispaces.com|
| _)_/LI |http://www.geocities.com/esambale/philbiodivmap/philbirds.html |
|---------|----------------------------------------------------------|