hi!
I'm trying to find out how to clip a large geotiff landsat image into several
smaller images; but I'm not finding any commands that seems to fit the bill!
Possibly because I don't know quite where or what to look for!
Theres two things I would like to do:
1. Clip the image into several smaller "tiles"; either by defining rectangle
size or by creating a vector grid that is used to "cut" the larger image into
smaller ones.
2. Clip the image according to a municipality; i.e I have the area of the
municipality as both a raster (binary); and a vector. The resulting image
should be a geotiff or raster datasett that follows the borders of the
municipality.
Sorry if this is a FAQ. I have looked at the GRASS GIS book
(Mitasova/Neteler), GDAL docs and various searches by Google (all return too
much information).
Regards
Lars F
Archaeologist
NTFK
Lars, sounds like an easy way to do what you want is to set your region to your municipality then make a mask with
g.region rast=municipality res=big_landsat_tile_map
r.mapcalc MASK=municipality
Then just use:
r.mapcalc cropped_LANDSAT=big_landsat_tile_map
Your new file will be only the size of your municipality (at the landsat resolution). Export with r.out.gdal. To do another, just erase your masks with g.remove and start the process again.
G'luck,
-Ian
On Feb 16, 2006, at 2:47 PM, Lars Forseth wrote:
hi!
I'm trying to find out how to clip a large geotiff landsat image into several
smaller images; but I'm not finding any commands that seems to fit the bill!
Possibly because I don't know quite where or what to look for!
Theres two things I would like to do:
1. Clip the image into several smaller "tiles"; either by defining rectangle
size or by creating a vector grid that is used to "cut" the larger image into
smaller ones.
2. Clip the image according to a municipality; i.e I have the area of the
municipality as both a raster (binary); and a vector. The resulting image
should be a geotiff or raster datasett that follows the borders of the
municipality.
Sorry if this is a FAQ. I have looked at the GRASS GIS book
(Mitasova/Neteler), GDAL docs and various searches by Google (all return too
much information).
Regards
Lars F
Archaeologist
NTFK
>
What happens if a big asteroid hits Earth? Judging from realistic simulations involving a sledge hammer and a common laboratory frog, we can assume it will be pretty bad.
- Dave Barry
-------------------------------------------------------------
This message has been scanned by Postini anti-virus software.
Lars Forseth wrote:
I'm trying to find out how to clip a large geotiff landsat image into several
smaller images; but I'm not finding any commands that seems to fit the bill!
Possibly because I don't know quite where or what to look for!
Theres two things I would like to do:
1. Clip the image into several smaller "tiles"; either by defining rectangle
size or by creating a vector grid that is used to "cut" the larger image into
smaller ones.
Run:
g.region n=... s=... e=... w=...
r.resample in=map out=...
for each tile.
--
Glynn Clements <glynn@gclements.plus.com>
On Thursday 16 February 2006 02:47 pm, Lars Forseth wrote:
hi!
I'm trying to find out how to clip a large geotiff landsat image into
several smaller images; but I'm not finding any commands that seems to fit
the bill! Possibly because I don't know quite where or what to look for!
Theres two things I would like to do:
1. Clip the image into several smaller "tiles"; either by defining
rectangle size or by creating a vector grid that is used to "cut" the
larger image into smaller ones.
2. Clip the image according to a municipality; i.e I have the area of the
municipality as both a raster (binary); and a vector. The resulting image
should be a geotiff or raster datasett that follows the borders of the
municipality.
Sorry if this is a FAQ. I have looked at the GRASS GIS book
(Mitasova/Neteler), GDAL docs and various searches by Google (all return
too much information).
Regards
Lars F
Archaeologist
NTFK
Here is a quick script that I used to tile a landsat mosaic:
#zoom to the extent of the mosaic and make the grid
g.region vect=ca_bnd
v.mkgrid map=ca_100km_grid grid=10,5
#extract each grid location into a single file
for x in `seq 1 1 50`
do
v.extract -t in=ca_100km_grid out=ca_100km_grid_$x list=$x
d.vect ca_100km_grid_$x
done
#clip the mosaic at each grid location
for x in `seq 1 1 50`
do
g.region vect=ca_100km_grid_$x
r.mapcalc "ca_landsat_shade_$x = ca_landsat_shade"
done
cheers,
--
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341