[GRASS-user] How to split raster map by specified rows

Hi.

I am trying to split raster map into chunks to do calculations (with r.mapcalc) on each chunk separately.
I browsed the net and found only the script called r.split.line, which needs vector file to split raster, but this is not that I want.

Is there a way to split raster by rows? For example if I have a GeoTiff file with 8000 rows I want to split it into 8 files 1000 row per each.

Or may by r.mapcalc can do the calculation I want only on specified number of rows?

Can anyone help me please?

Thanks in advance!

hi

Is there a way to split raster by rows? For example if I have a GeoTiff

file with 8000 rows I want to >split it into 8 files 1000 row per each.

r.info (http://grass.osgeo.org/grass64/manuals/html64_user/r.info.html) to
get the raster extent
g.region (http://grass.osgeo.org/grass64/manuals/html64_user/g.region.html)
to set region accordingly to the tiles:

e.g.
g.region rast=yourraster
g.region n=s+1000 e=w+1000, etc.

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/How-to-split-raster-map-by-specified-rows-tp5015096p5015106.html
Sent from the Grass - Users mailing list archive at Nabble.com.

The function r.tileset (http://grass.osgeo.org/grass64/manuals/html64_user/r.tileset.html) allows you to split your raster layer in user-defined tiles (which could be a tile of one row). The description states that it “produces tilings of the source projection for use in the destination region and projection”. If you use the same projection for source and destination it will just split your layer in tiles.

···

On Fri, Nov 9, 2012 at 11:13 AM, Andranik Hayrapetyan <andranik.h89@gmail.com> wrote:

Hi.

I am trying to split raster map into chunks to do calculations (with r.mapcalc) on each chunk separately.
I browsed the net and found only the script called r.split.line, which needs vector file to split raster, but this is not that I want.

Is there a way to split raster by rows? For example if I have a GeoTiff file with 8000 rows I want to split it into 8 files 1000 row per each.

Or may by r.mapcalc can do the calculation I want only on specified number of rows?

Can anyone help me please?

Thanks in advance!


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

The gdal_translate utility has a -srcwin option where you can speciify row/col values to “clip” a raster. If your data is Geotiff to begin with, this would be an easy solution.


Micha Silver
052-366-5918

-----Original message-----

From: Andranik Hayrapetyan andranik.h89@gmail.com
To: grass-user@lists.osgeo.org
Sent: Fri, 09 Nov 2012, 12:13:26 GMT+02:00
Subject: [GRASS-user] How to split raster map by specified rows