Commit 303ae6f0 authored by Guillaume Pasero's avatar Guillaume Pasero

Merge branch 'SRS_comparison' into 'release-6.6'

Use OGRSpatialReference class to compare projref

See merge request !65
parents 21bf11ac 4495e922
......@@ -203,11 +203,15 @@ private:
GeometriesType::Pointer inputGeomSet;
ProjectionFilterType::Pointer geometriesProjFilter;
GeometriesType::Pointer outputGeomSet;
const OGRSpatialReference imgOGRSref =
OGRSpatialReference( imageProjectionRef.c_str() );
const OGRSpatialReference vectorOGRSref =
OGRSpatialReference( vectorProjectionRef.c_str() );
bool doReproj = true;
// don't reproject for these cases
if (vectorProjectionRef.empty() ||
(imageProjectionRef == vectorProjectionRef) ||
(imageProjectionRef.empty() && imageKwl.GetSize() == 0))
if ( vectorProjectionRef.empty()
|| ( imgOGRSref.IsSame( &vectorOGRSref ) )
|| ( imageProjectionRef.empty() && imageKwl.GetSize() == 0) )
doReproj = false;
if (doReproj)
......
......@@ -376,10 +376,14 @@ private:
ProjectionFilterType::Pointer geometriesProjFilter;
GeometriesType::Pointer outputGeomSet;
bool doReproj = true;
const OGRSpatialReference imgOGRSref =
OGRSpatialReference( imageProjectionRef.c_str() );
const OGRSpatialReference vectorOGRSref =
OGRSpatialReference( vectorProjectionRef.c_str() );
// don't reproject for these cases
if (vectorProjectionRef.empty() ||
(imageProjectionRef == vectorProjectionRef) ||
(imageProjectionRef.empty() && imageKwl.GetSize() == 0))
if ( vectorProjectionRef.empty()
|| ( imgOGRSref.IsSame( &vectorOGRSref ) )
|| ( imageProjectionRef.empty() && imageKwl.GetSize() == 0) )
doReproj = false;
if (doReproj)
......
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