Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use bounding-box specific reprojection code (#4974)
  • Loading branch information
tbonfort committed Sep 13, 2014
1 parent 98908ed commit 2d312c5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion mapogcfiltercommon.c
Expand Up @@ -445,6 +445,19 @@ char *FLTGetSpatialComparisonCommonExpression(FilterEncodingNode *psNode, layerO
if(FLTIsBBoxFilter(psNode)) {
FLTGetBBOX(psNode, &sQueryRect);

if(lp->projection.numargs > 0) {
if (psNode->pszSRS)
msInitProjection(&sProjTmp);
if (psNode->pszSRS) {
/* Use the non EPSG variant since axis swapping is done in FLTDoAxisSwappingIfNecessary */
if (msLoadProjectionString(&sProjTmp, psNode->pszSRS) == 0) {
msProjectRect(&sProjTmp, &lp->projection, &sQueryRect);
}
} else if (lp->map->projection.numargs > 0)
msProjectRect(&lp->map->projection, &lp->projection, &sQueryRect);
if (psNode->pszSRS)
msFreeProjection(&sProjTmp);
}
psTmpShape = (shapeObj *)msSmallMalloc(sizeof(shapeObj));
msInitShape(psTmpShape);
msRectToPolygon(sQueryRect, psTmpShape);
Expand Down Expand Up @@ -475,7 +488,7 @@ char *FLTGetSpatialComparisonCommonExpression(FilterEncodingNode *psNode, layerO
/*
** target is layer projection
*/
if(lp->projection.numargs > 0) {
if(!bBBoxQuery && lp->projection.numargs > 0) {
if (psNode->pszSRS)
msInitProjection(&sProjTmp);
if (psNode->pszSRS) {
Expand Down

0 comments on commit 2d312c5

Please sign in to comment.