diff --git a/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx b/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx index 1f44798df571637dcb58515efe852993b164af33..bf65475b4a017123bd5e151299f873dc6642fa9d 100644 --- a/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx +++ b/Code/UtilitiesAdapters/OGRAdapters/otbOGRDataSourceWrapper.cxx @@ -179,7 +179,7 @@ otb::ogr::DataSource::New(std::string const& filename, Modes::type mode) if (! update) { itkGenericExceptionMacro(<< "No DataSource named <"<<filename<<"> exists," - " and the file opening mode does not permit updates. DataSource creation is thus avorted."); + " and the file opening mode does not permit updates. DataSource creation is thus aborted."); } // Hand made factory based on file extension. char const* driverName = DeduceDriverName(filename); @@ -194,7 +194,7 @@ otb::ogr::DataSource::New(std::string const& filename, Modes::type mode) OGRDataSource * source = d->CreateDataSource(filename.c_str()); if (!source) { itkGenericExceptionMacro(<< "Failed to create OGRDataSource <"<<filename - <<"> (driver name:" << driverName<<">: " << CPLGetLastErrorMsg()); + <<"> (driver name: " << driverName<<">: " << CPLGetLastErrorMsg()); } source->SetDriver(d); Pointer res = new DataSource(source); diff --git a/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx b/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx index b40527010103c526648adbabca2fa2e00c228e4c..824ad396fb8811fe0ae58a14089d9544b585ecb7 100644 --- a/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx +++ b/Code/UtilitiesAdapters/OGRAdapters/otbOGRLayerWrapper.cxx @@ -104,7 +104,7 @@ void otb::ogr::Layer::CreateFeature(Feature feature) if (res != OGRERR_NONE) { itkGenericExceptionMacro(<< "Cannot create a new feature in the layer <" - <<GetName()<<">:" << CPLGetLastErrorMsg()); + <<GetName()<<">: " << CPLGetLastErrorMsg()); } } @@ -115,7 +115,7 @@ void otb::ogr::Layer::DeleteFeature(long nFID) if (res != OGRERR_NONE) { itkGenericExceptionMacro(<< "Cannot delete the feature <"<<nFID<<"> in the layer <" - <<GetName()<<">:" << CPLGetLastErrorMsg()); + <<GetName()<<">: " << CPLGetLastErrorMsg()); } } @@ -137,7 +137,7 @@ void otb::ogr::Layer::SetFeature(Feature feature) if (res != OGRERR_NONE) { itkGenericExceptionMacro(<< "Cannot update a feature in the layer <" - <<GetName()<<">:" << CPLGetLastErrorMsg()); + <<GetName()<<">: " << CPLGetLastErrorMsg()); } } @@ -226,7 +226,7 @@ void otb::ogr::Layer::CreateField( if (res != OGRERR_NONE) { itkGenericExceptionMacro(<< "Cannot create a field in the layer <" - <<GetName()<<">:" << CPLGetLastErrorMsg()); + <<GetName()<<">: " << CPLGetLastErrorMsg()); } } @@ -241,7 +241,7 @@ void otb::ogr::Layer::DeleteField(size_t fieldIndex) if (res != OGRERR_NONE) { itkGenericExceptionMacro(<< "Cannot delete the "<<fieldIndex << "th field in the layer <" - <<GetName() <<">:" << CPLGetLastErrorMsg()); + <<GetName() <<">: " << CPLGetLastErrorMsg()); } #endif } @@ -261,7 +261,7 @@ void otb::ogr::Layer::AlterFieldDefn( if (res != OGRERR_NONE) { itkGenericExceptionMacro(<< "Cannot alter the "<<fieldIndex << "th field in the layer <" - <<GetName() <<">:" << CPLGetLastErrorMsg()); + <<GetName() <<">: " << CPLGetLastErrorMsg()); } #endif } @@ -277,7 +277,7 @@ void otb::ogr::Layer::ReorderField(size_t oldPos, size_t newPos) if (res != OGRERR_NONE) { itkGenericExceptionMacro(<< "Cannot move the "<<oldPos << "th field to the " - << newPos << "th position in the layer <" <<GetName() <<">:" << CPLGetLastErrorMsg()); + << newPos << "th position in the layer <" <<GetName() <<">: " << CPLGetLastErrorMsg()); } #endif } @@ -293,7 +293,7 @@ void otb::ogr::Layer::ReorderFields(int * map) if (res != OGRERR_NONE) { itkGenericExceptionMacro(<< "Cannot reorder the fields of the layer <" - <<GetName() <<">:" << CPLGetLastErrorMsg()); + <<GetName() <<">: " << CPLGetLastErrorMsg()); } #endif } @@ -306,7 +306,7 @@ void otb::ogr::Layer::SetIgnoredFields(char const** fieldNames) if (res != OGRERR_NONE) { itkGenericExceptionMacro(<< "Cannot set fields to ignore on the layer <" - <<GetName() <<">:" << CPLGetLastErrorMsg()); + <<GetName() <<">: " << CPLGetLastErrorMsg()); } #else itkGenericExceptionMacro("OGRLayer::SetIgnoredFields is not supported by OGR v" diff --git a/Examples/IO/CMakeLists.txt b/Examples/IO/CMakeLists.txt index a6f0e454ef1829675c7fb6b032668ed56148e283..57080f0df7dad42530bd5dfde52b9079939029f5 100644 --- a/Examples/IO/CMakeLists.txt +++ b/Examples/IO/CMakeLists.txt @@ -53,6 +53,9 @@ TARGET_LINK_LIBRARIES(MetadataExample OTBCommon OTBIO) ADD_EXECUTABLE(VectorDataIOExample VectorDataIOExample.cxx ) TARGET_LINK_LIBRARIES(VectorDataIOExample OTBCommon OTBIO) +ADD_EXECUTABLE(OGRWrappersExample OGRWrappersExample.cxx ) +TARGET_LINK_LIBRARIES(OGRWrappersExample OTBCommon OTBOGRAdapters) + ADD_EXECUTABLE(DEMToImageGenerator DEMToImageGenerator.cxx ) TARGET_LINK_LIBRARIES(DEMToImageGenerator OTBProjections OTBIO OTBCommon )