[gdal-dev] gdal_grid, what am I doing wrong?

Gregor Mosheh gregor at hostgis.com
Mon Feb 18 15:57:38 EST 2008


Hi, all. I'm a long-time fan of GDAL/OGR but have hit upon a problem and 
finally need to ask for help on something that has me stuck.

I have bathymetric data in GRB98 format, but can also export it in CSV 
format (simple lat, lon, depth) and stick a VRT on it. It's slow but 
effective. I can also use ogr2ogr to convert the VRT+CSV to a shapefile, 
which is less slow. This part seems flawless, and if I want the points 
rendered, Mapserver does that A-OK.

What we want is to rasterize it to a TIFF, containing actual data values 
in the pixels, filling in the gaps between these discrete sample points 
with a nearest-neighbor algorithm, and then using a VRT for colorization 
later. gdal_grid seemed the natural tool for this purpose, but all I 
ever get is a TIFF with all 0s across the board. What am I doing 
incorrectly?

This is an example of a 1-square-degree test swatch.

gdal_grid \
   -a nearest:radius1=0.0:radius2=0.0:angle=0.0:nodata=0.0 -l depth \
   -outsize 1201 1201 \
   -a_srs EPSG:4326 -tye 31.000000 32.000000 -txe -80.000000 -79.005833 \
   depth.shp depth.tif

Am I missing the detail of how to tell it which field/column we want to 
use for the pixel value? I didn't see that in gdal_grid's docs, and 
though the shapefile only has one field (field3, the depth) I have a 
feeling that it doesn't know to use that one.

-- 
Gregor Mosheh / Greg Allensworth, BS, A+
System Administrator
HostGIS cartographic development & hosting services
http://www.HostGIS.com/

"Remember that no one cares if you can back up,
  only if you can restore." - AMANDA


More information about the gdal-dev mailing list