[GRASSLIST:8924] Re: [GRASS5] Slicing tif files

Michael Barton michael.barton at asu.edu
Mon Nov 7 17:17:21 EST 2005


Sharyn,

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).

2. Start grass in the location with your geotiff.

3. Set your region to match your geotiff file using g.region

4. display the file to make sure it is OK.

5. Set the region to match the tile extents you want using g.region

6. use r.mapcalc to clip the tile
    r.mapcalc [new_tilemap_name]=[geotiffmap name]

Repeat steps 5 and 6 for as many tiles as you want

Michael
______________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ  85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton



From: Sharyn Namnath <namnatsr at nv.doe.gov>
Date: Mon, 07 Nov 2005 12:34:33 -0800
To: Michael Barton <michael.barton at asu.edu>
Conversation: [GRASS5] Slicing tif files
Subject: Re: [GRASS5] Slicing tif files

 Michael,

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.

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.

Any help will be so much appreciated..

Sincerely,
Sharyn 


On 11·6·05 9:40 PM, "Michael Barton" <michael.barton at asu.edu> wrote:

> I don¹t understand what you are trying to do. Could you explain it a bit more?
> 
> 
> Maybe the following will help a bit too...
> 
> 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.
> 
> 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.
> 
> 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).
> 
> 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.
> 
> 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.
> 
> Michael
> __________________________________________
> Michael Barton, Professor of Anthropology
> School of Human Evolution and Social Change
> Arizona State University
> Tempe, AZ 85287-2402
> 
> phone: 480-965-6213
> fax: 480-965-7671
> www: http://www.public.asu.edu/~cmbarton
> 
> 
> 
> 
> From: Sharyn Namnath <namnatsr at nv.doe.gov>
> Date: Sun, 06 Nov 2005 13:51:55 -0800
> To: Grass List <grass5 at grass.itc.it>
> Conversation: Slicing tif files
> Subject: [GRASS5] Slicing tif files
> 
> Dear list,
> 
> 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.
> 
> First off I realized after playing with it that the greyscale required using
> d.rast while the color needed d.rgb.. So far ok..
> 
> 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.
> 
> When I first read in the file, I call :
> r.in.gdal ­o ­e input=/Volumes/Recent/SB/p663east.tif output=temp
> 
> g.region ­p gives me :
> GRASS 6.0.0 (LocationText):~ > g.region -p
> projection: 0 (x,y)
> zone:       0
> north:      3821818.5
> south:      3806127.5
> west:       251135.5
> east:       276337.5
> nsres:      1
> ewres:      1
> rows:       15691
> cols:       25202
> 
> d.mon start=PNG
> d.rast ­o map=temp
> d.mon stop=PNG
> 
> And I get a nice grainy map of my original tif file
> 
> Then I try 
> g.region n=3815204.19 s=3812771.11 w=235544.84 e=238598.83
> 
> GRASS 6.0.0 (LocationText):~ > g.region -p
> projection: 0 (x,y)
> zone:       0
> north:      3815204.19
> south:      3812771.11
> west:       235544.84
> east:       238598.83
> nsres:      0.09999918
> ewres:      0.09999967
> rows:       24331
> cols:       30540
> 
> d.mon start=PNG
> d.rast ­o map=temp
> d.mon stop=PNG
> 
> 
> And now I get a nice black image for a PNG file...
> 
> Same thing happens in the UTM location..
> 
> I¹m stumped.
> 
> Thanks for your patience...
> 
> - sharyn
> 



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20051107/4d70eca7/attachment.html


More information about the grass-user mailing list