How to crop away NODATA margins

4 messages Options
Embed this post
Permalink
Hermann Peifer

How to crop away NODATA margins

Reply Threaded More More options
Print post
Permalink
Hi,

I see that d.out.file has a switch: -m  (Do NOT crop away margins). So I assume that by default, white margins are auto-cropped.

What I am  looking for is some sort of auto-crop feature which I could use with r.out.gdal, in order to get rid of abundant NODATA margins in raster layers.

What I am currently doing: I identify a raster layer's data extent visually before changing the region and then running r.out.gdal. However, I might miss some islands at the edges...

Thanks in advance, Hermann

_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Markus Metz-2

Re: How to crop away NODATA margins

Reply Threaded More More options
Print post
Permalink

Hermann Peifer wrote:
> Hi,
>
> I see that d.out.file has a switch: -m  (Do NOT crop away margins). So
> I assume that by default, white margins are auto-cropped.
>
> What I am  looking for is some sort of auto-crop feature which I could
> use with r.out.gdal, in order to get rid of abundant NODATA margins in
> raster layers.
g.region zoom=<myrast> align=<myrast> ?

Markus M
_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
hamish-2

Re: How to crop away NODATA margins

Reply Threaded More More options
Print post
Permalink
In reply to this post by Hermann Peifer
Hermann wrote:
> I see that d.out.file has a switch: -m  (Do NOT crop
> away margins). So I assume that by default, white margins
> are auto-cropped.

IIRC it depends on the output type.
I can't remember how many methods I exteneded that to.


> What I am  looking for is some sort of auto-crop
> feature which I could use with r.out.gdal, in order to get
> rid of abundant NODATA margins in raster layers.

g.region rast=your_map
g.region zoom=your_map
r.out.gdal ...


d.out.file is just a shell script, you can look in it for
the commands used to figure out the cropping. (I expect d.info
and g.region)


> What I am currently doing: I identify a raster layer's data
> extent visually before changing the region and then running
> r.out.gdal. However, I might miss some islands at the
> edges...

try 'g.region zoom='


Hamish




_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user
Hermann Peifer

Re: How to crop away NODATA margins

Reply Threaded More More options
Print post
Permalink
In reply to this post by Markus Metz-2

> g.region zoom=<myrast> align=<myrast>

I overlooked this in the documentation, I have to admit :-(

Sorry for the noise and thanks to both of you. Hermann

_______________________________________________
grass-user mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-user