[GRASS-dev] [bug #5043] (grass) r.out.gdal does not export
"g.region -p"
Markus Neteler
neteler at itc.it
Thu Aug 24 08:57:22 EDT 2006
On Thu, Aug 24, 2006 at 02:11:12PM +0200, Request Tracker wrote:
> this bug's URL: http://intevation.de/rt/webrt?serial_num=5043
> -------------------------------------------------------------------------
>
> Subject: r.out.gdal does not export "g.region -p"
>
> Platform: GNU/Linux/x86
> grass obtained from: Other (CDROM etc)
> grass binary for platform: Downloaded precompiled Binaries
> GRASS Version: GRASS 6.0.2 (2006)
>
>
> r.out.gdal does export the region as defined in "g.region -p", but the full input raster file.
I just found that it is pretty easy to support at least
the current region extent:
diff -u -r1.24 r.out.gdal
--- r.out.gdal 19 Aug 2006 12:52:24 -0000 1.24
+++ r.out.gdal 24 Aug 2006 12:54:58 -0000
@@ -129,9 +129,11 @@
unset METAKEY
fi
+eval `g.region -g`
+
#do it
CELLHD=`echo $file | sed 's+/cell/+/cellhd/+g'`
echo "Writing format: $FORMAT"
echo "Writing type: $TYPE"
-gdal_translate -of $FORMAT -ot $TYPE $CREATEKEY $METAKEY $CELLHD $OUTPUT
+gdal_translate -of $FORMAT -ot $TYPE $CREATEKEY $METAKEY -projwin $w $n $e $s $CELLHD $OUTPUT
For current resolution support, I have no idea.
Opinions about above change?
Markus
More information about the grass-dev
mailing list