Skip to content
Snippets Groups Projects
Commit 516f7b98 authored by Julien Malik's avatar Julien Malik
Browse files

BUG: wrong condition for field creation

parent a2d6cf59
No related branches found
No related tags found
No related merge requests found
......@@ -495,7 +495,8 @@ private:
// And create the field if necessary
std::string fieldName = this->GetParameterString("mode.vector.fieldname");
OGRFeatureDefn & ogrFeatureDfn = layer.GetLayerDefn();
if (-1 != ogrFeatureDfn.GetFieldIndex(fieldName.c_str()))
if (-1 == ogrFeatureDfn.GetFieldIndex(fieldName.c_str()))
{
OGRFieldDefn field(fieldName.c_str(),OFTInteger);
layer.CreateField(field,true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment