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

ENH: add some logs to OGRIOHelper

parent 37881ae8
No related branches found
No related tags found
No related merge requests found
...@@ -631,12 +631,16 @@ unsigned int OGRIOHelper<TVectorData> ...@@ -631,12 +631,16 @@ unsigned int OGRIOHelper<TVectorData>
{ {
if ( std::string(kwl.GetNthField(fieldIdx).first->GetNameRef()) != "FID" ) if ( std::string(kwl.GetNthField(fieldIdx).first->GetNameRef()) != "FID" )
{ {
otbMsgDevMacro(<< " CreateField " << kwl.GetNthField(fieldIdx).first); otbMsgDevMacro(<< " CreateField '" << kwl.GetNthField(fieldIdx).first->GetNameRef() << "'");
if (ogrCurrentLayer->CreateField(kwl.GetNthField(fieldIdx).first) != OGRERR_NONE ) if (ogrCurrentLayer->CreateField(kwl.GetNthField(fieldIdx).first) != OGRERR_NONE )
{ {
itkExceptionMacro(<< "Failed to create Field "<<kwl.GetNthField(fieldIdx).first->GetNameRef()); itkExceptionMacro(<< "Failed to create Field "<<kwl.GetNthField(fieldIdx).first->GetNameRef());
} }
} }
else
{
otbMsgDevMacro(<< "WARNING: Skipping OGR field 'FID'");
}
} }
} }
...@@ -687,11 +691,10 @@ unsigned int OGRIOHelper<TVectorData> ...@@ -687,11 +691,10 @@ unsigned int OGRIOHelper<TVectorData>
const char * key = kwl.GetNthField(i).first->GetNameRef(); const char * key = kwl.GetNthField(i).first->GetNameRef();
if (std::string(key) != "FID") if (std::string(key) != "FID")
{ {
// Edit the value of the field and add it to the current feature // Edit the value of the field and add it to the current feature
ogrFeature->SetField(ogrFeature->GetFieldIndex(key) , kwl.GetFieldAsString(key).c_str()); ogrFeature->SetField(ogrFeature->GetFieldIndex(key) , kwl.GetFieldAsString(key).c_str());
otbMsgDevMacro( << "kwl.GetFieldAsString(key) " << ogrFeature->GetFieldIndex(key) << " " << kwl.GetFieldAsString(key) ) }
}
} }
// ogrFeature->SetField("Name", dataNode->GetNodeId()); // ogrFeature->SetField("Name", dataNode->GetNodeId());
......
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