Hardcoded driver list in otbOGRVectorDataIO
Maybe I am missing something, but why is there a (short) hardcoded list of OGR drivers in VectorDataIO? It blocks usage of other drivers which work just fine. For example GPKG:
diff --git a/Modules/IO/IOGDAL/src/otbOGRVectorDataIO.cxx b/Modules/IO/IOGDAL/src/otbOGRVectorDataIO.cxx
index f47b192d7e..b3b7ef31c2 100644
--- a/Modules/IO/IOGDAL/src/otbOGRVectorDataIO.cxx
+++ b/Modules/IO/IOGDAL/src/otbOGRVectorDataIO.cxx
@@ -329,6 +329,7 @@ OGRVectorDataIO::GetOGRDriverName(std::string name) const
else if (extension == ".SQLITE") driverOGR = "SQLite";
else if (extension==".KML") driverOGR="KML";
else if (extension == ".GMT") driverOGR = "OGR_GMT";
+ else if (extension == ".GPKG") driverOGR = "GPKG";
else driverOGR = "NOT-FOUND";
}
To test if a file can be read it would be better to ask the OGR api, no? Compiling with the above diff makes OTB able to write .gpkg
files.
Edited by Victor Poughon