I am trying to create contours using Delphi and GDAL18. For this, I use the following code:
layer:= OGRCreateLayer( ogr_ds, PAnsiChar(WideStringToString('contour')), nil, ogr.wkbLineString, nil);
err:= GDALContourGenerate(band, 1, 0, 0, aFixedLevel, 0, 0, layer, 0, 1, nil, nil);
The GDALContourGenerate command returns an "Unnsupported Geometry Type" error.
I included gdal18.dll as follows:
function GDALContourGenerate(srcBand: TGDALRasterBandH; contourInterval: double;
contourBase: double; fixedLevelCount: longint; fixedLevel: TDoubleArray2;
useNoData: longint; noDataValue: double;
layer: TOGRLayerH; idField: longint; elevField: longint;
pfnProgress: TGDALProgressFunc; pProgressArg : POINTER): TOGRErr; external External_Lib name 'GDALContourGenerate';
I also tried other types of geometry (e.g. wkbLineString25D), but that didn't help. I would be glad if you had any suggestions. Thnaks a lot, Mario
[edit] I found out that the same error occurs when I replay the “layer” (in GDALContourGenerate) with “nil”. Perhaps the problem is elsewhere. [/ Edit]
source
share