[gdal-dev] gdalwarp makes landcover files blocky when shrinking pixel size

Chaitanya kumar CH chaitanya.ch at gmail.com
Fri Jan 27 14:27:41 EST 2012


John,

You are right. gdaladdo is not for creating higher resolution images. I
thought you needed the opposite.
I assume your landcover data is a classified raster. Classified data is
usually zoomed in with nearest neighbor interpolation. Unless you fiddle
with the interpolation window, the majority algorithm is pretty much the
nearest neighbor while zooming in.

If you want, you can convert the image into an RGB using pct2rgb.py and
work with the RGB image.

On Fri, Jan 27, 2012 at 11:30 PM, John Twilley <mathuin at gmail.com> wrote:

> I've never seen gdaladdo -- neat command!  Alas, the overviews are the
> wrong way 'round -- I don't need to zoom out, I need to zoom in.
> gdaladdo doesn't handle fractional scale values well, so I can't make
> something bigger out of something smaller like I can with gdalwarp.
>
> Jack.
> --
> mathuin at gmail dot com
>
>
>
> On Thu, Jan 26, 2012 at 20:01, Chaitanya kumar CH
> <chaitanya.ch at gmail.com> wrote:
> > John,
> >
> > Try gdaladdo [1] with the resampling algo set to 'mode'. If you use the
> -ro
> > option, it will create an external overview. Check your output with
> > different combinations of levels.
> >
> > [1]: http://www.gdal.org/gdaladdo.html
> >
> > On Fri, Jan 27, 2012 at 5:09 AM, John Twilley <mathuin at gmail.com> wrote:
> >>
> >> I am working with elevation and landcover data downloaded from the
> >> USGS.  I use gdalwarp to convert the data to a much smaller pixel. The
> >> elevation data works very nicely with cubic resampling, but the only
> >> resampling that works at all for the landcover data is
> >> nearest-neighbor and that's very blocky.  When I last worked with
> >> landcover data, I used a majority algorithm which produced smoother
> >> output -- but that algorithm is not implemented in gdalwarp.
> >> I am looking over the source to gdalwarp to see how hard it is to add
> >> a new algorithm.  Other than that, though, what options are available
> >> to me?  Thanks in advance!
> >> Jack.--
> >> mathuin at gmail dot com
> >> _______________________________________________
> >> gdal-dev mailing list
> >> gdal-dev at lists.osgeo.org
> >> http://lists.osgeo.org/mailman/listinfo/gdal-dev
> >
> >
> >
> >
> > --
> > Best regards,
> > Chaitanya kumar CH.
> >
> > +91-9494447584
> > 17.2416N 80.1426E
>



-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120128/67b31a23/attachment.html


More information about the gdal-dev mailing list