Etienne, You can find a lot of sample code in the gdal test scripts[1]. There is a test script for regenerating overviews in gcore/tiff_ovr.py [2].
You can apply a filter using a VRT file[3]. It supports filters of various sizes. [1]: http://trac.osgeo.org/gdal/browser/trunk/autotest/ [2]: http://trac.osgeo.org/gdal/browser/trunk/autotest/gcore/tiff_ovr.py#L1046 [3]: http://www.gdal.org/gdal_vrttut.html On Sat, Aug 6, 2011 at 5:15 AM, Etienne <[email protected]> wrote: > Thanks Anton > > This might seem obvious to many of you, but how could I go about applying a > filter using the gdal utilities/functions/python code? > > Etienne > > > ----- Original Message ----- > From: Anton Korosov <[email protected]> > To: [email protected] > Cc: > Sent: Friday, August 5, 2011 3:27:41 AM > Subject: Re: [gdal-dev] help resampling raster to coarser scale > > Hi Etienne! > > What if you first process the original fine resolution image with a > filter (low-pass, median, or manually created pixel function). Then the > result, which is a fine resolution image but smoothed, could be > resampled with the nearest neighbor. > > Anton > > On 08/05/2011 03:57 AM, Etienne wrote: > > Hi all, > > > > > > I am trying to resample a raster with categorical data (land surface > vegetation/cover) from a high resolution (500m) to a coarser resolution. > > > > I would like to do something similar to what the GRASS operator > r.resamp.stats does, using the modal category present in the higher > resolution dataset to pick the value in the lower-resolution map. > > It seems that my only option using gdal_warp is nearest neighbor, which > will pick the value nearest to the coarser pixel center (regardless of the > most present category within the region). > > > > I would also like have a low-resolution map with the proportions of all > land types (from the high resolution map). > > > > Any idea on how to accomplish what I want using gdal? I am not familiar > with GRASS, and would prefer to stick with GDAL if I can. However, I am > open to any suggestions. > > > > Many Thanks > > Etienne > > _______________________________________________ > > gdal-dev mailing list > > [email protected] > > http://lists.osgeo.org/mailman/listinfo/gdal-dev > _______________________________________________ > gdal-dev mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/gdal-dev > > _______________________________________________ > gdal-dev mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/gdal-dev > -- Best regards, Chaitanya kumar CH. +91-9494447584 17.2416N 80.1426E
_______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
