Commit 516f7b98 authored by Julien Malik's avatar Julien Malik

BUG: wrong condition for field creation

parent a2d6cf59
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment