Skip to content
Permalink
Browse files
Better detect situations where no reprojection is needed (apply to bo…
…th PROJ 4 and PROJ 6)
  • Loading branch information
rouault committed Oct 1, 2019
1 parent 75860fd commit aed72231f9e9412873eb4d37eb91b60d606d09c4
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
@@ -428,13 +428,22 @@ reprojectionObj* msProjectCreateReprojector(projectionObj* in, projectionObj* ou
obj->out = out;

/* -------------------------------------------------------------------- */
/* If the source and destination are simple and equal, then do */
/* nothing. */
/* If the source and destination are equal, then do nothing. */
/* -------------------------------------------------------------------- */
if( in && in->numargs == 1 && out && out->numargs == 1
&& strcmp(in->args[0],out->args[0]) == 0 ) {
if( in && out && in->numargs == out->numargs && in->numargs > 0
&& strcmp(in->args[0],out->args[0]) == 0 )
{
int i;
obj->no_op = MS_TRUE;
for( i = 1; i < in->numargs; i++ )
{
if( strcmp(in->args[i],out->args[i]) != 0 ) {
obj->no_op = MS_FALSE;
break;
}
}
}

/* -------------------------------------------------------------------- */
/* If we have a fully defined input coordinate system and */
/* output coordinate system, then we will use pj_transform */
@@ -691,6 +691,8 @@ void *msInitProjTransformer( projectionObj *psSrc,
double *padfDstGeoTransform )

{
int backup_src_need_gt;
int backup_dst_need_gt;
msProjTransformInfo *psPTInfo;

psPTInfo = (msProjTransformInfo *) msSmallCalloc(1,sizeof(msProjTransformInfo));
@@ -699,9 +701,15 @@ void *msInitProjTransformer( projectionObj *psSrc,
/* We won't even use PROJ.4 if either coordinate system is */
/* NULL. */
/* -------------------------------------------------------------------- */
backup_src_need_gt = psSrc->gt.need_geotransform;
psSrc->gt.need_geotransform = 0;
backup_dst_need_gt = psDst->gt.need_geotransform;
psDst->gt.need_geotransform = 0;
psPTInfo->bUseProj =
(psSrc->proj != NULL && psDst->proj != NULL
&& msProjectionsDiffer( psSrc, psDst ) );
psSrc->gt.need_geotransform = backup_src_need_gt;
psDst->gt.need_geotransform = backup_dst_need_gt;

/* -------------------------------------------------------------------- */
/* Record source image information. We invert the source */
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding="UTF-8" ?>
<ServiceExceptionReport version="1.2.0"
xmlns="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wcs/1.0.0/OGC-exception.xsd">
<ServiceException code="NoApplicableCode" locator="bbox">msWCSGetCoverage(): WCS server error. Requested BBOX (500.000111169182,499.999999995423,1000.00011052692,999.999999990907) is outside requested coverage BBOX (0,0,400,300)
<ServiceException code="NoApplicableCode" locator="bbox">msWCSGetCoverage(): WCS server error. Requested BBOX (500,500,1000,1000) is outside requested coverage BBOX (0,0,400,300)
</ServiceException>
</ServiceExceptionReport>

0 comments on commit aed7223

Please sign in to comment.