Permalink
Browse files

OGRGeometryFactory::transformWithOptions(): if WRAPDATELINE=YES, test…

… that the geometry SRS is geographic
  • Loading branch information...
rouault committed Feb 9, 2019
1 parent a0e1932 commit 9be0590a0a4b2af7d12eb4a3eedd9ca7300090f7
Showing with 16 additions and 0 deletions.
  1. +16 −0 gdal/ogr/ogrgeometryfactory.cpp
@@ -3778,6 +3778,22 @@ OGRGeometry* OGRGeometryFactory::transformWithOptions(

if( CPLTestBool(CSLFetchNameValueDef(papszOptions, "WRAPDATELINE", "NO")) )
{
if( poDstGeom->getSpatialReference() &&
!poDstGeom->getSpatialReference()->IsGeographic() )
{
static bool bHasWarned = false;
if( !bHasWarned )
{
CPLError(CE_Warning, CPLE_AppDefined,
"WRAPDATELINE is without effect when reprojecting to a "
"non-geographic CRS");
bHasWarned = true;
}
return poDstGeom;
}
// TODO and we should probably also test that the axis order + data axis mapping
// is long-lat...

const OGRwkbGeometryType eType =
wkbFlatten(poDstGeom->getGeometryType());
if( eType == wkbPoint )

0 comments on commit 9be0590

Please sign in to comment.