[Gdal-dev] Problems with gdal_grid
Tamas Szekeres
szekerest at gmail.com
Thu Apr 17 09:57:49 EDT 2008
2008/4/17, PikoBoZ <piklas at gmail.com>:
> 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?
You'll have to use a vrt something like:
<OGRVRTDataSource>
<OGRVRTLayer name="sample">
<SrcDataSource>sample.csv</SrcDataSource>
<GeometryType>wkbPoint25D</GeometryType>
<GeometryField encoding="PointFromColumns" x="xfield" y="yfield"
z="myzvaluetointerpolate"/>
</OGRVRTLayer>
</OGRVRTDataSource>
> Is it possible to get a RGB GTiff from gdal_grid and to apply style (killing
> nodata, Min/Max colors...)
>
If you can use the latest SVN trunk, you could possibly define a .vrt
and include a lookup table to map between grid values to the color
values. Here's an example:
<VRTDataset rasterXSize="500" rasterYSize="500">
<VRTRasterBand dataType="Byte" band="1">
<ColorInterp>Red</ColorInterp>
<ComplexSource>
<LUT>4567.12:0,123434.23:128,1234567.34:255</LUT>
<SourceFilename>mygrid.tif</SourceFilename>
<SourceBand>1</SourceBand>
</ComplexSource>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="2">
<ColorInterp>Green</ColorInterp>
<ComplexSource>
<LUT>4567.12:0,123434.23:128,1234567.34:255</LUT>
<SourceFilename>mygrid.tif</SourceFilename>
<SourceBand>1</SourceBand>
</ComplexSource>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3">
<ColorInterp>Blue</ColorInterp>
<ComplexSource>
<LUT>4567.12:0,123434.23:128,1234567.34:255</LUT>
<SourceFilename>mygrid.tif</SourceFilename>
<SourceBand>1</SourceBand>
</ComplexSource>
</VRTRasterBand>
<VRTRasterBand dataType="Byte" band="3">
<ColorInterp>Alpha</ColorInterp>
<ComplexSource>
<LUT>4567.12:0,123434.23:128,1234567.34:255</LUT>
<SourceFilename>mygrid.tif</SourceFilename>
<SourceBand>1</SourceBand>
</ComplexSource>
</VRTRasterBand>
</VRTDataset>
for more information see: http://www.gdal.org/gdal_vrttut.html
Best regards,
Tamas
More information about the gdal-dev
mailing list