<HTML>
<HEAD>
<TITLE>Re: [GRASS5] Slicing tif files</TITLE>
</HEAD>
<BODY>
<FONT FACE="Verdana, Helvetica, Arial"><SPAN DEFANGED_STYLE='font-size:12.0px'>Sharyn,<BR>
<BR>
1. Import the geotiff into the appropriate UTM location (gdal will make the location for you if you enter a name in the new location name field).<BR>
<BR>
2. Start grass in the location with your geotiff.<BR>
<BR>
3. Set your region to match your geotiff file using g.region<BR>
<BR>
4. display the file to make sure it is OK.<BR>
<BR>
5. Set the region to match the tile extents you want using g.region<BR>
<BR>
6. use r.mapcalc to clip the tile<BR>
r.mapcalc [new_tilemap_name]=[geotiffmap name]<BR>
<BR>
Repeat steps 5 and 6 for as many tiles as you want<BR>
<BR>
Michael<BR>
______________________________<BR>
Michael Barton, Professor of Anthropology<BR>
School of Human Evolution and Social Change<BR>
Arizona State University<BR>
Tempe, AZ 85287-2402<BR>
USA<BR>
<BR>
voice: 480-965-6262; fax: 480-965-7671<BR>
www: <a href="http://www.public.asu.edu/~cmbarton">http://www.public.asu.edu/~cmbarton</a><BR>
<BR>
<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"><B>From: </B>Sharyn Namnath <namnatsr@nv.doe.gov><BR>
<B>Date: </B>Mon, 07 Nov 2005 12:34:33 -0800<BR>
<B>To: </B>Michael Barton <michael.barton@asu.edu><BR>
<B>Conversation: </B>[GRASS5] Slicing tif files<BR>
<B>Subject: </B>Re: [GRASS5] Slicing tif files<BR>
<BR>
Michael,<BR>
<BR>
I have a set of georeferenced UTM Tif files. They are huge.. 300Mb per file. I’d like to cut them up in into smaller areas which are georeferenced as well. Let’s say I have a file that covers 10 miles x 10 miles and I want to have smaller areas that are 1 mile x 1 mile tiles. I have successfully used grass to cut up a color georeferenced Lat/Long tif file in this manner, so I know it can be done.<BR>
<BR>
I tried using the same method I used on the Lat/Long files but it said I had an illegal south value. So Hamish suggested that I read it into an XY location which seemed to work. When I did a g.region –p I saw that it was in UTM coordinates. So I used what I thought were proper UTM coordinates to give myself a new region of the picture. Instead of seeing that portion of the picture when I view it, it is blank. I must be doing something wrong, but I don’t know what.<BR>
<BR>
Any help will be so much appreciated..<BR>
<BR>
Sincerely,<BR>
Sharyn <BR>
<BR>
<BR>
On 11·6·05 9:40 PM, "Michael Barton" <michael.barton@asu.edu> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>I don’t understand what you are trying to do. Could you explain it a bit more?<BR>
<BR>
<BR>
Maybe the following will help a bit too...<BR>
<BR>
D.rast is for displaying any raster file with a single color table. You can also select a subset of the raster values to display.<BR>
<BR>
R.colors will alter the color table of a raster file, including histogramming. You can pick grey-scale, a variety of preset color tables, or create your own color table interactively.<BR>
<BR>
D.rgb is for visual ‘data fusion’ in which the values in 3 raster images (usually grey scale, but not necessarily) are used for the red, green, and blue channels respectively of a color image display. (d.his is an alternative data fusion module in which 3 raster maps are used for hue, saturation, and intensity in a color display).<BR>
<BR>
R.composite allows you to create a new color raster map (not just to make a display) and linked color table derived from 3 raster maps that serve as the red, green, and blue chanels.<BR>
<BR>
G.region can change (among many other things) the portion of a map viewed. If a new map is created from the base map, using r.mapcalc, the new map extents will match the extents of the area viewed.<BR>
<BR>
Michael<BR>
__________________________________________<BR>
Michael Barton, Professor of Anthropology<BR>
School of Human Evolution and Social Change<BR>
Arizona State University<BR>
Tempe, AZ 85287-2402<BR>
<BR>
phone: 480-965-6213<BR>
fax: 480-965-7671<BR>
www: <a href="http://www.public.asu.edu/~cmbarton">http://www.public.asu.edu/~cmbarton</a> <BR>
<BR>
<BR>
<BR>
<HR ALIGN=CENTER SIZE="3" WIDTH="95%"><B>From: </B>Sharyn Namnath <namnatsr@nv.doe.gov><BR>
<B>Date: </B>Sun, 06 Nov 2005 13:51:55 -0800<BR>
<B>To: </B>Grass List <grass5@grass.itc.it><BR>
<B>Conversation: </B>Slicing tif files<BR>
<B>Subject: </B>[GRASS5] Slicing tif files<BR>
<BR>
Dear list,<BR>
<BR>
I’m trying to read in a greyscale georefrenced TIF file. I have successfully read in georeferenced color TIF files and sliced them into smaller sections, but I am having a great deal of trouble with this greyscale image.<BR>
<BR>
First off I realized after playing with it that the greyscale required using d.rast while the color needed d.rgb.. So far ok..<BR>
<BR>
The color file was in lat/long so I read it into a lat/long location. The greyscale seems to be UTM, so I tried both UTM and XY locations. Both work for reading in and doing a d.rast and writing the file out as a PNG, but I can’t seem to slice the files up into smaller chunks. <BR>
<BR>
When I first read in the file, I call :<BR>
r.in.gdal –o –e input=/Volumes/Recent/SB/p663east.tif output=temp<BR>
<BR>
g.region –p gives me : <BR>
GRASS 6.0.0 (LocationText):~ > g.region -p<BR>
projection: 0 (x,y)<BR>
zone: 0<BR>
north: 3821818.5<BR>
south: 3806127.5<BR>
west: 251135.5<BR>
east: 276337.5<BR>
nsres: 1<BR>
ewres: 1<BR>
rows: 15691<BR>
cols: 25202<BR>
<BR>
d.mon start=PNG<BR>
d.rast –o map=temp<BR>
d.mon stop=PNG<BR>
<BR>
And I get a nice grainy map of my original tif file<BR>
<BR>
Then I try <BR>
g.region n=3815204.19 s=3812771.11 w=235544.84 e=238598.83<BR>
<BR>
GRASS 6.0.0 (LocationText):~ > g.region -p<BR>
projection: 0 (x,y)<BR>
zone: 0<BR>
north: 3815204.19<BR>
south: 3812771.11<BR>
west: 235544.84<BR>
east: 238598.83<BR>
nsres: 0.09999918<BR>
ewres: 0.09999967<BR>
rows: 24331<BR>
cols: 30540<BR>
<BR>
d.mon start=PNG<BR>
d.rast –o map=temp<BR>
d.mon stop=PNG<BR>
<BR>
<BR>
And now I get a nice black image for a PNG file...<BR>
<BR>
Same thing happens in the UTM location..<BR>
<BR>
I’m stumped.<BR>
<BR>
Thanks for your patience...<BR>
<BR>
- sharyn<BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'><BR>
<BR>
</SPAN></FONT>
</BODY>
</HTML>