diff --git a/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h b/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h index defe8c974ce8b09567df4272263faf8fd643d086..98bb35c399810e8d81ec5561b55c51e2acf7df89 100644 --- a/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h +++ b/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.h @@ -164,7 +164,7 @@ public: * \note No condition is assumed on the non-nullity of \c source. * \see \c DataSource(GDALDataset *) */ - static Pointer New(ogr::version_proxy::GDALDatasetType * sourcemode, Modes::type mode = Modes::Read , const std::vector< std::string > & layerOptions = std::vector< std::string >() ); + static Pointer New(GDALDataset * sourcemode, Modes::type mode = Modes::Read , const std::vector< std::string > & layerOptions = std::vector< std::string >() ); //@} /**\name Projection Reference property */ @@ -301,7 +301,7 @@ public: * \throw None * \post Assumes ownership of the \c source. */ - void Reset(ogr::version_proxy::GDALDatasetType * source); + void Reset(GDALDataset * source); /**\name Layers modification */ //@{ @@ -495,7 +495,7 @@ public: * \warning You must under no circumstance try to delete the \c GDALDataset * obtained this way. */ - ogr::version_proxy::GDALDatasetType & ogr(); + GDALDataset & ogr(); void SetLayerCreationOptions( const std::vector< std::string > & options ); void AddLayerCreationOptions( std::vector< std::string > options ); @@ -515,7 +515,7 @@ protected: /** Init constructor. * \post The newly constructed object owns the \c source parameter. */ - DataSource(ogr::version_proxy::GDALDatasetType * source, Modes::type mode , const std::vector< std::string > & layerOption = std::vector< std::string >() ); + DataSource(GDALDataset * source, Modes::type mode , const std::vector< std::string > & layerOption = std::vector< std::string >() ); /** Destructor. * \post The \c GDALDataset owned is released (if not null). */ @@ -552,7 +552,7 @@ private: std::string GetDatasetDescription() const; private: - ogr::version_proxy::GDALDatasetType *m_DataSource; + GDALDataset *m_DataSource; std::vector< std::string > m_LayerOptions; Modes::type m_OpenMode; int m_FirstModifiableLayerID; diff --git a/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.hxx b/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.hxx index e2990958c6d871df3e433ca66732cd5e77c0b760..acfea3a977c90c7c4738f1716e7a7c4be5cd37ef 100644 --- a/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.hxx +++ b/Modules/Adapters/GdalAdapters/include/otbOGRDataSourceWrapper.hxx @@ -43,7 +43,7 @@ // to the compilation mode of the client code. inline -otb::ogr::version_proxy::GDALDatasetType & otb::ogr::DataSource::ogr() +GDALDataset & otb::ogr::DataSource::ogr() { assert(m_DataSource && "GDALDataset not initialized"); return *m_DataSource; diff --git a/Modules/Adapters/GdalAdapters/include/otbOGRLayerWrapper.h b/Modules/Adapters/GdalAdapters/include/otbOGRLayerWrapper.h index 880832a3dace41a2eb827857479fa9c23517d1da..6b23090d10e371c5293a1b2c4688d944dba0b3af 100644 --- a/Modules/Adapters/GdalAdapters/include/otbOGRLayerWrapper.h +++ b/Modules/Adapters/GdalAdapters/include/otbOGRLayerWrapper.h @@ -119,7 +119,7 @@ public: * OGRDataSource::ExecuteSQL(). It's actually the constructor called by \c * DataSource::ExecuteSQL(). */ - Layer(OGRLayer* layer, otb::ogr::version_proxy::GDALDatasetType& sourceInChargeOfLifeTime, bool modifiable); + Layer(OGRLayer* layer, GDALDataset& sourceInChargeOfLifeTime, bool modifiable); //@} /**\name Features collection */ diff --git a/Modules/Adapters/GdalAdapters/include/otbOGRVersionProxy.h b/Modules/Adapters/GdalAdapters/include/otbOGRVersionProxy.h index 85e48a0dcbf2d15297579652af0abd3a47475eef..26b70b32bf70b83d54ec0f357831ec4dab10a694 100644 --- a/Modules/Adapters/GdalAdapters/include/otbOGRVersionProxy.h +++ b/Modules/Adapters/GdalAdapters/include/otbOGRVersionProxy.h @@ -58,13 +58,12 @@ namespace version_proxy * * Whenever GDALDataset and GDALDriver have to be used to open a * vector dataset (or OGRDataSource an OGRSFDriver for gdal 1.x), one - * should use ogr::version_proxy types GDALDatasetType and + * should use ogr::version_proxy types GDALDataset and * GDALDriverType. * * See function documentation for details. */ - typedef GDALDataset GDALDatasetType; typedef GDALDriver GDALDriverType; /** @@ -79,7 +78,7 @@ namespace version_proxy * \return NULL if file could not be open. */ OTBGdalAdapters_EXPORT - GDALDatasetType * Open(const char * filename, bool readOnly = true , std::vector< std::string > const & options = std::vector< std::string >() ); + GDALDataset * Open(const char * filename, bool readOnly = true , std::vector< std::string > const & options = std::vector< std::string >() ); /** * This function closes a dataset. @@ -91,7 +90,7 @@ namespace version_proxy * checked for null pointer. */ OTBGdalAdapters_EXPORT - void Close(GDALDatasetType * dataset); + void Close(GDALDataset * dataset); /** * This function creates a new dataset. @@ -108,7 +107,7 @@ namespace version_proxy * \return NULL if dataset could not be created. */ OTBGdalAdapters_EXPORT - GDALDatasetType * Create(GDALDriverType * driver, const char * name , std::vector< std::string > const & options = std::vector< std::string >() ); + GDALDataset * Create(GDALDriverType * driver, const char * name , std::vector< std::string > const & options = std::vector< std::string >() ); /** @@ -136,7 +135,7 @@ namespace version_proxy */ OTBGdalAdapters_EXPORT - std::vector<std::string> GetFileListAsStringVector(GDALDatasetType * dataset); + std::vector<std::string> GetFileListAsStringVector(GDALDataset * dataset); /** * Return the list of available drivers. diff --git a/Modules/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx b/Modules/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx index a57d56c9c1e1172438061d6f06e5620071b06c4d..841fc59e35c78453f202123bed9901f78f445738 100644 --- a/Modules/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx +++ b/Modules/Adapters/GdalAdapters/src/otbOGRDataSourceWrapper.cxx @@ -48,7 +48,7 @@ bool otb::ogr::DataSource::Clear() return true; } -void otb::ogr::DataSource::Reset(otb::ogr::version_proxy::GDALDatasetType * source) +void otb::ogr::DataSource::Reset(GDALDataset * source) { if (m_DataSource) { // OGR makes a pointless check for non-nullity in @@ -137,7 +137,7 @@ otb::ogr::DataSource::DataSource() } otb::ogr::DataSource::DataSource( - otb::ogr::version_proxy::GDALDatasetType * source , + GDALDataset * source , Modes::type mode , const std::vector< std::string > & options /*NULL*/ ) : m_DataSource(source) , @@ -155,7 +155,7 @@ otb::ogr::DataSource::Pointer otb::ogr::DataSource::OpenDataSource(std::string c std::string simpleFileName = fileNameHelper->GetSimpleFileName(); bool update = (mode != Modes::Read); - ogr::version_proxy::GDALDatasetType * source = + GDALDataset * source = ogr::version_proxy::Open( simpleFileName.c_str() , !update , fileNameHelper->GetGDALOpenOptions() ); @@ -228,7 +228,7 @@ otb::ogr::DataSource::New(std::string const& datasourceName, Modes::type mode) } Drivers::Init(); - ogr::version_proxy::GDALDatasetType * ds = + GDALDataset * ds = ogr::version_proxy::Open( simpleFileName.c_str() , true ); bool ds_exists = (ds!=nullptr); @@ -246,7 +246,7 @@ otb::ogr::DataSource::New(std::string const& datasourceName, Modes::type mode) /*static*/ otb::ogr::DataSource::Pointer -otb::ogr::DataSource::New(otb::ogr::version_proxy::GDALDatasetType * source , Modes::type mode , const std::vector< std::string > & layerOptions ) +otb::ogr::DataSource::New(GDALDataset * source , Modes::type mode , const std::vector< std::string > & layerOptions ) { Pointer res = new DataSource( source , mode , layerOptions ); res->UnRegister(); diff --git a/Modules/Adapters/GdalAdapters/src/otbOGRLayerWrapper.cxx b/Modules/Adapters/GdalAdapters/src/otbOGRLayerWrapper.cxx index 97656a436dfbcdbeb61cb484a7d77d7d3df050ef..97d5b7fe1356beb6b92143c5e6f73fdff52309c0 100644 --- a/Modules/Adapters/GdalAdapters/src/otbOGRLayerWrapper.cxx +++ b/Modules/Adapters/GdalAdapters/src/otbOGRLayerWrapper.cxx @@ -69,8 +69,8 @@ otb::ogr::Layer::Layer(OGRLayer* layer, bool modifiable) { } -otb::ogr::Layer::Layer(OGRLayer* layer, otb::ogr::version_proxy::GDALDatasetType& sourceInChargeOfLifeTime, bool modifiable) -: m_Layer(layer, boost::bind(&otb::ogr::version_proxy::GDALDatasetType::ReleaseResultSet, boost::ref(sourceInChargeOfLifeTime), _1)) +otb::ogr::Layer::Layer(OGRLayer* layer, GDALDataset& sourceInChargeOfLifeTime, bool modifiable) +: m_Layer(layer, boost::bind(&GDALDataset::ReleaseResultSet, boost::ref(sourceInChargeOfLifeTime), _1)) , m_Modifiable(modifiable) { assert(layer && "A null OGRlayer cannot belong to an OGRDataSource" ); diff --git a/Modules/Adapters/GdalAdapters/src/otbOGRVersionProxy.cxx b/Modules/Adapters/GdalAdapters/src/otbOGRVersionProxy.cxx index f2a8e90a7b57fd62267b99e2067e3095b1d07e40..4b3b17d9ed6e3c225605cd8892ee0d788dc0f502 100644 --- a/Modules/Adapters/GdalAdapters/src/otbOGRVersionProxy.cxx +++ b/Modules/Adapters/GdalAdapters/src/otbOGRVersionProxy.cxx @@ -49,13 +49,13 @@ namespace ogr namespace version_proxy { -GDALDatasetType * Open(const char * filename, bool readOnly , std::vector< std::string > const & options ) +GDALDataset * Open(const char * filename, bool readOnly , std::vector< std::string > const & options ) { #if GDAL_VERSION_NUM<2000000 (void)options; return OGRSFDriverRegistrar::Open(filename,!readOnly); #else - return (GDALDatasetType *)GDALOpenEx( + return (GDALDataset *)GDALOpenEx( filename, (readOnly? GDAL_OF_READONLY : GDAL_OF_UPDATE) | GDAL_OF_VECTOR, NULL, @@ -64,7 +64,7 @@ GDALDatasetType * Open(const char * filename, bool readOnly , std::vector< std:: #endif } -void Close(GDALDatasetType * dataset) +void Close(GDALDataset * dataset) { #if GDAL_VERSION_NUM<2000000 OGRDataSource::DestroyDataSource(dataset); @@ -73,11 +73,11 @@ void Close(GDALDatasetType * dataset) #endif } -GDALDatasetType * Create(GDALDriverType * driver, const char * name , std::vector< std::string > const & options ) +GDALDataset * Create(GDALDriverType * driver, const char * name , std::vector< std::string > const & options ) { #if GDAL_VERSION_NUM<2000000 (void)options; - GDALDatasetType * ds = driver->CreateDataSource(name); + GDALDataset * ds = driver->CreateDataSource(name); if(ds) ds->SetDriver(driver); @@ -96,7 +96,7 @@ GDALDatasetType * Create(GDALDriverType * driver, const char * name , std::vect bool Delete(const char * name) { // Open dataset - GDALDatasetType * poDS = otb::ogr::version_proxy::Open(name,false); + GDALDataset * poDS = otb::ogr::version_proxy::Open(name,false); GDALDriverType * poDriver = NULL; if(poDS) { @@ -148,7 +148,7 @@ private: } #endif -std::vector<std::string> GetFileListAsStringVector(GDALDatasetType * dataset) +std::vector<std::string> GetFileListAsStringVector(GDALDataset * dataset) { std::vector<std::string> ret; #if GDAL_VERSION_NUM<2000000 diff --git a/Modules/IO/IOGDAL/include/otbOGRIOHelper.h b/Modules/IO/IOGDAL/include/otbOGRIOHelper.h index 67b5e19778378afc4ed1a95e26a809f13c84358a..0f5ceae562f95683e1c828152120343d2ee51c2b 100644 --- a/Modules/IO/IOGDAL/include/otbOGRIOHelper.h +++ b/Modules/IO/IOGDAL/include/otbOGRIOHelper.h @@ -74,14 +74,14 @@ public: unsigned int ProcessNodeWrite(InternalTreeNodeType * source, - ogr::version_proxy::GDALDatasetType * m_DataSource, + GDALDataset * m_DataSource, OGRGeometryCollection * ogrCollection, OGRLayer * ogrCurrentLayer, OGRSpatialReference * oSRS); /** Return a list of OGRLayer * */ std::vector<OGRLayer*> ConvertDataTreeNodeToOGRLayers(InternalTreeNodeType * source, - ogr::version_proxy::GDALDatasetType * dummyDatasource, + GDALDataset * dummyDatasource, OGRLayer* ogrCurrentLayer, OGRSpatialReference * oSRS); diff --git a/Modules/IO/IOGDAL/include/otbOGRVectorDataIO.h b/Modules/IO/IOGDAL/include/otbOGRVectorDataIO.h index dbff89e1b3dd6448dd2d7ad57950c2e9e2f190ca..ef1ca7bd509c014b5a83ab27725816fe5e56bd20 100644 --- a/Modules/IO/IOGDAL/include/otbOGRVectorDataIO.h +++ b/Modules/IO/IOGDAL/include/otbOGRVectorDataIO.h @@ -123,7 +123,7 @@ private: void CloseInternalDataSource(); - ogr::version_proxy::GDALDatasetType * m_DataSource; + GDALDataset * m_DataSource; }; diff --git a/Modules/IO/IOGDAL/src/otbOGRIOHelper.cxx b/Modules/IO/IOGDAL/src/otbOGRIOHelper.cxx index 13985f4ac3a88466f413c705211b136e7b09ba3f..6cb7c07de7575182a42c311a7ab07d78d764c261 100644 --- a/Modules/IO/IOGDAL/src/otbOGRIOHelper.cxx +++ b/Modules/IO/IOGDAL/src/otbOGRIOHelper.cxx @@ -651,7 +651,7 @@ void OGRIOHelper unsigned int OGRIOHelper ::ProcessNodeWrite(InternalTreeNodeType * source, - ogr::version_proxy::GDALDatasetType * m_DataSource, + GDALDataset * m_DataSource, OGRGeometryCollection * ogrCollection, OGRLayer * ogrCurrentLayer, OGRSpatialReference * oSRS) @@ -1027,7 +1027,7 @@ unsigned int OGRIOHelper **/ std::vector<OGRLayer*> OGRIOHelper ::ConvertDataTreeNodeToOGRLayers(InternalTreeNodeType * source, - ogr::version_proxy::GDALDatasetType * inMemoryDataSource, + GDALDataset * inMemoryDataSource, OGRLayer* ogrCurrentLayer, OGRSpatialReference * oSRS) { diff --git a/Modules/IO/IOGDAL/src/otbOGRVectorDataIO.cxx b/Modules/IO/IOGDAL/src/otbOGRVectorDataIO.cxx index 8f1205d0aec410e892db1901cb3d3f6795df1f49..3b5bdbc4e93bc80f719ec6640486012ab20822e7 100644 --- a/Modules/IO/IOGDAL/src/otbOGRVectorDataIO.cxx +++ b/Modules/IO/IOGDAL/src/otbOGRVectorDataIO.cxx @@ -54,7 +54,7 @@ OGRVectorDataIO::~OGRVectorDataIO() bool OGRVectorDataIO::CanReadFile(const char* filename) const { - otb::ogr::version_proxy::GDALDatasetType * poDS = ogr::version_proxy::Open(filename, true); + GDALDataset * poDS = ogr::version_proxy::Open(filename, true); if (poDS == nullptr) { diff --git a/Modules/IO/TestKernel/src/otbTestHelper.cxx b/Modules/IO/TestKernel/src/otbTestHelper.cxx index fae2a40dfe64a70447af91c8ade41eb539f20fb5..0ce02a82d9cb37eef692fe7624df564579a9285f 100644 --- a/Modules/IO/TestKernel/src/otbTestHelper.cxx +++ b/Modules/IO/TestKernel/src/otbTestHelper.cxx @@ -1727,10 +1727,10 @@ int TestHelper::RegressionTestOgrFile(const char *testOgrFilename, const char *b /* -------------------------------------------------------------------- */ /* Open data source. */ /* -------------------------------------------------------------------- */ - otb::ogr::version_proxy::GDALDatasetType *ref_poDS = nullptr; + GDALDataset *ref_poDS = nullptr; otb::ogr::version_proxy::GDALDriverType * ref_poDriver = nullptr; //OGRGeometry * ref_poSpatialFilter = NULL; - otb::ogr::version_proxy::GDALDatasetType *test_poDS = nullptr; + GDALDataset *test_poDS = nullptr; otb::ogr::version_proxy::GDALDriverType * test_poDriver = nullptr; //OGRGeometry * test_poSpatialFilter = NULL; diff --git a/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.h b/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.h index d719606ae3492d9589f49fa15429bbb00b32d640..7f386c5aafd0a27833fd1ef5fa547d913895ff77 100644 --- a/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.h +++ b/Modules/Segmentation/Conversion/include/otbRasterizeVectorDataFilter.h @@ -160,7 +160,7 @@ private: RasterizeVectorDataFilter(const Self&) = delete; void operator=(const Self&) = delete; - ogr::version_proxy::GDALDatasetType * m_OGRDataSourcePointer; + GDALDataset * m_OGRDataSourcePointer; // Vector Of LayersH std::vector< OGRLayerH > m_SrcDataSetLayers; diff --git a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.h b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.h index 6cdbabc3974e38da1993b092a130ea042879fffc..f80aeebd59bb852cba0d7d42adb0897237364dd0 100644 --- a/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.h +++ b/Modules/Segmentation/Conversion/include/otbVectorDataToLabelImageFilter.h @@ -163,7 +163,7 @@ private: VectorDataToLabelImageFilter(const Self&) = delete; void operator=(const Self&) = delete; - ogr::version_proxy::GDALDatasetType * m_OGRDataSourcePointer; + GDALDataset * m_OGRDataSourcePointer; // Vector Of OGRGeometyH std::vector< OGRGeometryH > m_SrcDataSetGeometries;