OGRFeature set Multiple fields

المشرف العام

Administrator
طاقم الإدارة
Hi all to start off with:

Using Gdal compiled with Xerces

Coding in C++ with the QT Creator version 5.4.1

So my problem is im trying to use Gdal to create my own Esri shapefile, I get a strange runtime error when trying to add multiple fields

Example:

// Create a ogr feeature OGRFeature* ogr_feature; // Set a bunch of fields ogr_feature->SetField("Blah","Blah"); ogr_feature->SetField("Foo","Foo"); ogr_feature->SetField("Bar","Bar"); ogr_feature->SetField("Test","Test"); When I run the program once it hits this part it gives out this error message:

Error :1 Invalid Index -1

I'm not too sure what's causing this. I've tried taking out all but 1 and thats fine doesnt give me any errors. But more than 1 it throws that error.

Anyone know how to fix this/ why its doing it?



أكثر...
 
أعلى