Commit 0ab9234f authored by Luc Hermitte's avatar Luc Hermitte

COMP: Support of old GDAL 1.6.x version

parent 16a15c11
......@@ -66,7 +66,12 @@ void otb::ogr::Feature::SetFrom(Feature const& rhs, bool mustForgive)
void otb::ogr::Feature::SetFrom(Feature const& rhs, int * map, bool mustForgive)
{
CheckInvariants();
#if GDAL_VERSION_NUM >= 1900
m_Feature->SetFrom(&rhs.ogr(), map, mustForgive);
#else
itkGenericExceptionMacro("OGRLayer::SetFrom(feature, fieldmap, forgive) is not supported by OGR v"
<< GDAL_VERSION_NUM << ". Upgrade to a version >= 1.9.0, and recompile OTB.")
#endif
}
/*===========================================================================*/
......
......@@ -96,7 +96,12 @@ otb::ogr::UniqueGeometryPtr otb::ogr::Union(OGRGeometry const& lhs, OGRGeometry
otb::ogr::UniqueGeometryPtr otb::ogr::UnionCascaded(OGRGeometry const& this_)
{
#if GDAL_VERSION_NUM >= 1800
return UniqueGeometryPtr(this_.UnionCascaded());
#else
itkGenericExceptionMacro("OGRLayer::UnionCascaded is not supported by OGR v"
<< GDAL_VERSION_NUM << ". Upgrade to a version >= 1.8.0, and recompile OTB.")
#endif
}
otb::ogr::UniqueGeometryPtr otb::ogr::Difference(OGRGeometry const& lhs, OGRGeometry const& rhs)
......
......@@ -301,12 +301,17 @@ void otb::ogr::Layer::ReorderFields(int * map)
void otb::ogr::Layer::SetIgnoredFields(char const** fieldNames)
{
assert(m_Layer && "OGRLayer not initialized");
#if GDAL_VERSION_NUM >= 1900
const OGRErr res = m_Layer->SetIgnoredFields(fieldNames);
if (res != OGRERR_NONE)
{
itkGenericExceptionMacro(<< "Cannot set fields to ignore on the layer <"
<<GetName() <<">:" << CPLGetLastErrorMsg());
}
#else
itkGenericExceptionMacro("OGRLayer::SetIgnoredFields is not supported by OGR v"
<< GDAL_VERSION_NUM << ". Upgrade to a version >= 1.9.0, and recompile OTB.")
#endif
}
OGRwkbGeometryType otb::ogr::Layer::GetGeomType() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment