Skip to content

Compatibility with gdal 3

Cédric Traizet requested to merge compatibility_gdal3 into develop


This merge request includes change to make OTB compatible with gdal 3.0


Two main changes are introduced by this merge request:

  • A change on how ogr spatial references are compared during regression. Before this merge request the test spatial reference was compared with the baseline spatial reference by doing an ASCII comparison on a wkt representation of the SRS (using ogr's ExportToPrettyWkt method to generate the wkt). This is a very bad way to compare spatial references are different wkt string can represent the same SRS, and different version of gdal output different wkt representation (the "pretty wkt" of gdal 3.0 are a bit different of those of gdal 2, and in the future gdal will output wkt2 strings). Instead, with this MR, spatial references are compared with the ogr sptial reference IsSame method (i.e. we are delegating the comparison to gdal).

  • in gdal 3.0, we have to specify how spatial references should handle axis order. In OTB case we want to use the "traditional GIS" order (as it done extensively in ogr drivers), i.e. longitude/latitude for geographic CRS and east/north for projected CRS. More info here

  • Fix warning from importFromWkt() (const correctness)


There are three test failing with gdal 3.0:

  • prTvImageToEnvelopeVectorDataFilter
  • ioTvKMLVectorDataFileGeoReaderWriter
  • ioTvKMLVectorDataFileGeoReaderWriter2

These tests are using the kml format, the axis used by the ogr kml driver is not correct in gdal release 3.0. But this have been fixed since then, and the test are passing with the master of gdal (see this discussion for details)


The copyright owner is CNES and has signed the ORFEO ToolBox Contributor License Agreement.

Check before merging:

  • All discussions are resolved
  • At least 2 👍 votes from core developers, no 👎 vote.
  • The feature branch is (reasonably) up-to-date with the base branch
  • Dashboard is green
  • Copyright owner has signed the ORFEO ToolBox Contributor License Agreement
  • Optionally, run git diff develop... -U0 --no-color | -p1 -i on latest changes and commit
Edited by Cédric Traizet

Merge request reports