More

Gdal_grid - fails to find layer and field

Gdal_grid - fails to find layer and field


I'm using gdal_grid for the first time and get this issue:

gdal_grid -zfield field_3 -l layer0 OLEX-LAT-190952014.vrt OLEX-LAT-190952014.tiff ERROR 1: Failed to find layer 'layer0' on datasource 'OLEX-LAT-190952014.short.csv'. Failed to find field field_3 on layer layer0, skipping.

Here is what my vrt file looks like:

  OLEX-LAT-190952014.short.csv wkbPoint EPSG:25832 

And my data file:

field_1,field_2,field_3 6932193.2570,377160.7010,-33.1300 6932194.6430,377162.4380,-32.6600
  1. The first error mesage indicates that gdal_grid looks for a layer in the csv file - but how can a csv file contain a layer?
  2. The next error message indicates that gdal_grid has read the csv file and can't find field_3 although it is clearly there?

Any ideas what I'm doing wrong?

GDAL version 1.10.1


Useogrinfoas a handy debugging tool. I see:

$ ogrinfo OLEX-LAT-190952014.vrt INFO: Open of 'OLEX-LAT-190952014.vrt' using driver 'VRT' successful. 1: layer0ERROR 1: Failed to find layer 'layer0' on datasource 'OLEX-LAT-190952014.short.csv'. (Point)

According to the documentation,SrcLayeris optional, but should be defined (unless inSrcSQL). Add this afterSrcDataSource:

OLEX-LAT-190952014.short

Alternatively, useOLEX-LAT-190952014.shortfor the layer name (line 2) in place oflayer0.


Watch the video: Working with QGIS: Resampling Rasters.