[Gdal-dev] Problems with gdal_grid

Andrey Kiselev dron at ak4719.spb.edu
Thu Apr 17 09:24:53 EDT 2008


Nicolas,

On Thu, Apr 17, 2008 at 05:32:54AM -0700, PikoBoZ wrote:
> I've got troubles experimenting gdal_grid interpolation algoritms
> I want to interpolate ponctual values contained in a point .shp (or csv),
> and to write the result as GTiff
> I use the following command yet:
> 
> [code]
> gdal_grid -a invdist:power=2.0smooting=1.0 -txe 679285 681415 -tye 1837728
> 1840022 -of GTiff -ot Float32 -l vectorial_plume vectorial_plume.shp
> testwrite.tiff
> [/code]
> 
> testwrite.tiff is created but corrupted:
> - It is mono band greyscaled, and i'd like to get a RGB, in the aim to
> apply style
> - It is all black (NoData). I think that gdal doesn't know on which
> field to work on (in the dbf) so it can't interpolate any values !
> 
> So, a few questions is persiting in my mind:
> Is it simpler to interpolate from .shp or to use a .vrt / .csv couple ?
> How can I specify to gdal_grid a data field to interpolate?  

gdal_grid does not support getting Z value from the field (though it can
be extended for that). It should be 2.5D geometry for gdal_grid to work.

> Is it possible to get a RGB GTiff from gdal_grid and to apply style
> (killing nodata, Min/Max colors...)

I am not getting your point about RGB image. You will get the
multichannel raster, one channel for each input layer (and you can
combine multiple layers in one chunk and render them in single channel
using -sql option). It is better to get the default double precision
floating point raster, because gdal_grid does not scale values very
well. And you can do with that raster anything you want: scale it for
your needs, apply some colour encoding, etc. If you are supplying single
input layer then you will get grayscale output raster.

Best regards,
Andrey

-- 
Andrey V. Kiselev
ICQ# 26871517


More information about the gdal-dev mailing list