[GRASS-dev] Re: r.external

Markus Neteler neteler at osgeo.org
Fri Sep 12 16:24:35 EDT 2008


On Fri, Sep 12, 2008 at 2:44 PM, Markus Neteler <neteler at osgeo.org> wrote:
...
> r.info -r pat_dtm_5m
> WARNING: category support for [pat_dtm_5m] in mapset [PERMANENT] missing
> min=nan
> max=nan

I observe that 'f_range' remains empty:

GRASS 6.4.svn (patUTM):~ > l
/home/neteler/grassdata/patUTM/PERMANENT/cell_misc/pat_dtm_5m
total 52
-rw-rw-r-- 1 neteler neteler   132 2008-09-12 14:07 gdal
-rw-rw-r-- 1 neteler neteler     0 2008-09-12 14:07 f_range
-rw-rw-r-- 1 neteler neteler     5 2008-09-12 14:07 f_quant
-rw-rw-r-- 1 neteler neteler    28 2008-09-12 14:07 f_format
-rw-rw-r-- 1 neteler neteler 39928 2008-09-12 22:16 histogram

Could the file be populated using GDAL functions?
http://www.gdal.org/gdal_tutorial.html

        GDALRasterBandH hBand;
        int             bGotMin, bGotMax;
        double          adfMinMax[2];

        adfMinMax[0] = GDALGetRasterMinimum( hBand, &bGotMin );
        adfMinMax[1] = GDALGetRasterMaximum( hBand, &bGotMax );
        if( ! (bGotMin && bGotMax) )
            GDALComputeRasterMinMax( hBand, TRUE, adfMinMax );
        printf( "Min=%.3fd, Max=%.3f\n", adfMinMax[0], adfMinMax[1] );

?
Markus


More information about the grass-dev mailing list