Commit 85b8750c authored by Bas Couwenberg's avatar Bas Couwenberg

New upstream version 7.0.6

parent e8d57973
......@@ -17,7 +17,7 @@ include(CheckCSourceCompiles)
set (MapServer_VERSION_MAJOR 7)
set (MapServer_VERSION_MINOR 0)
set (MapServer_VERSION_REVISION 5)
set (MapServer_VERSION_REVISION 6)
set (MapServer_VERSION_SUFFIX "")
set(TARGET_VERSION_MAJOR ${MapServer_VERSION_MAJOR})
......
......@@ -217,6 +217,7 @@ void msCopyTextPath(textPathObj *dst, textPathObj *src) {
if(src->bounds.poly) {
dst->bounds.poly = msSmallMalloc(sizeof(lineObj));
dst->bounds.poly->numpoints = src->bounds.poly->numpoints;
dst->bounds.poly->point = msSmallMalloc(src->bounds.poly->numpoints * sizeof(pointObj));
for(i=0; i<src->bounds.poly->numpoints; i++) {
dst->bounds.poly->point[i] = src->bounds.poly->point[i];
}
......
......@@ -2463,7 +2463,11 @@ int process_node(layerObj* layer, expressionObj *filter)
case MS_TOKEN_BINDING_DOUBLE:
case MS_TOKEN_BINDING_INTEGER:
case MS_TOKEN_BINDING_STRING:
strtmpl = "%s";
if(layerinfo->current_node->next->token == MS_TOKEN_COMPARISON_IRE)
strtmpl = "LOWER(%s)";
else
strtmpl = "%s";
stresc = msMSSQL2008LayerEscapePropertyName(layer, layerinfo->current_node->tokenval.bindval.item);
snippet = (char *) msSmallMalloc(strlen(strtmpl) + strlen(stresc));
sprintf(snippet, strtmpl, stresc);
......@@ -2486,9 +2490,85 @@ int process_node(layerObj* layer, expressionObj *filter)
case MS_TOKEN_COMPARISON_IN:
filter->native_string = msStringConcatenate(filter->native_string, " IN ");
break;
case MS_TOKEN_COMPARISON_LIKE:
filter->native_string = msStringConcatenate(filter->native_string, " LIKE ");
break;
case MS_TOKEN_COMPARISON_RE:
case MS_TOKEN_COMPARISON_IRE:
case MS_TOKEN_COMPARISON_LIKE: {
/* process regexp */
size_t i = 0, j = 0;
char c;
char c_next;
int bCaseInsensitive = (layerinfo->current_node->token == MS_TOKEN_COMPARISON_IRE);
int nEscapeLen = 0;
if (bCaseInsensitive)
filter->native_string = msStringConcatenate(filter->native_string, " LIKE LOWER(");
else
filter->native_string = msStringConcatenate(filter->native_string, " LIKE ");
layerinfo->current_node = layerinfo->current_node->next;
if (layerinfo->current_node->token != MS_TOKEN_LITERAL_STRING) return 0;
strtmpl = msStrdup(layerinfo->current_node->tokenval.strval);
if (strtmpl[0] == '/') {
stresc = strtmpl + 1;
strtmpl[strlen(strtmpl) - 1] = '\0';
}
else if (strtmpl[0] == '^')
stresc = strtmpl + 1;
else
stresc = strtmpl;
while (*stresc) {
c = stresc[i];
if (c == '%' || c == '_' || c == '[' || c == ']' || c == '^') {
nEscapeLen++;
}
stresc++;
}
snippet = (char *)msSmallMalloc(strlen(strtmpl) + nEscapeLen + 3);
snippet[j++] = '\'';
while (i < strlen(strtmpl)) {
c = strtmpl[i];
c_next = strtmpl[i+1];
if (i == 0 && c == '^') {
i++;
continue;
}
if (c == '\\') {
i++;
c = c_next;
}
if (c == '%' || c == '_' || c == '[' || c == ']' || c == '^') {
snippet[j++] = '\\';
}
if (c == '.' && c_next == '*') {
i++;
c = '%';
}
else if (c == '.')
c = '_';
snippet[j++] = c;
i++;
}
snippet[j++] = '\'';
snippet[j] = '\0';
filter->native_string = msStringConcatenate(filter->native_string, snippet);
msFree(strtmpl);
msFree(snippet);
if (bCaseInsensitive)
filter->native_string = msStringConcatenate(filter->native_string, ")");
if (nEscapeLen > 0)
filter->native_string = msStringConcatenate(filter->native_string, " ESCAPE '\\'");
}
break;
case MS_TOKEN_COMPARISON_EQ:
filter->native_string = msStringConcatenate(filter->native_string, " = ");
break;
......
......@@ -2585,7 +2585,12 @@ static int msOGRFileWhichShapes(layerObj *layer, rectObj rect, msOGRFileInfo *ps
CPLErrorReset();
if( OGR_L_SetAttributeFilter( psInfo->hLayer, pszOGRFilter ) != OGRERR_NONE ) {
msSetError(MS_OGRERR, "SetAttributeFilter() failed on layer %s. Check logs.", "msOGRFileWhichShapes()", layer->name?layer->name:"(null)");
msDebug("SetAttributeFilter(%s) failed on layer %s.\n%s\n", pszOGRFilter, layer->name?layer->name:"(null)", CPLGetLastErrorMsg() );
RELEASE_OGR_LOCK;
msFree(pszOGRFilter);
msFree(select);
return MS_FAILURE;
}
msFree(pszOGRFilter);
} else
......@@ -3263,6 +3268,7 @@ static msExprNode* BuildExprTree(tokenListNodeObjPtr node,
{
if( node->next && node->next->token == '(' )
{
int node_token = node->token;
msExprNode* subExpr = BuildExprTree(node->next->next, &node,
nParenthesisLevel + 1);
if( subExpr == NULL )
......@@ -3270,7 +3276,7 @@ static msExprNode* BuildExprTree(tokenListNodeObjPtr node,
goto fail;
}
msExprNode* newNode = new msExprNode;
newNode->m_nToken = node->token;
newNode->m_nToken = node_token;
if( subExpr->m_nToken == 0 )
{
newNode->m_aoChildren = subExpr->m_aoChildren;
......@@ -3388,6 +3394,8 @@ fail:
/**********************************************************************
* msOGRExtractTopSpatialFilter()
*
* Recognize expressions like "Intersects([shape], wkt) == TRUE [AND ....]"
**********************************************************************/
static int msOGRExtractTopSpatialFilter( msOGRFileInfo *info,
const msExprNode* expr,
......@@ -3396,6 +3404,15 @@ static int msOGRExtractTopSpatialFilter( msOGRFileInfo *info,
if( expr == NULL )
return MS_FALSE;
if( expr->m_nToken == MS_TOKEN_COMPARISON_EQ &&
expr->m_aoChildren.size() == 2 &&
expr->m_aoChildren[1]->m_nToken == MS_TOKEN_LITERAL_BOOLEAN &&
expr->m_aoChildren[1]->m_dfVal == 1.0 )
{
return msOGRExtractTopSpatialFilter(info, expr->m_aoChildren[0],
pSpatialFilterNode);
}
if( expr->m_nToken == MS_TOKEN_COMPARISON_INTERSECTS &&
expr->m_aoChildren.size() == 2 &&
expr->m_aoChildren[1]->m_nToken == MS_TOKEN_LITERAL_SHAPE )
......
......@@ -881,6 +881,7 @@ int msQueryByRect(mapObj *map)
char status;
shapeObj shape, searchshape;
rectObj searchrect, searchrectInMapProj;
const rectObj invalid_rect = MS_INIT_INVALID_RECT;
double layer_tolerance = 0, tolerance = 0;
int paging;
......@@ -982,7 +983,8 @@ int msQueryByRect(mapObj *map)
#ifdef USE_PROJ
lp->project = msProjectionsDiffer(&(lp->projection), &(map->projection));
if(lp->project)
if(lp->project &&
memcmp( &searchrect, &invalid_rect, sizeof(searchrect) ) != 0 )
msProjectRect(&(map->projection), &(lp->projection), &searchrect); /* project the searchrect to source coords */
#endif
......
......@@ -996,6 +996,7 @@ int msDrawTextSymbol(mapObj *map, imageObj *image, pointObj labelPnt, textSymbol
colorObj *c = NULL, *oc = NULL;
int ow;
assert(ts->textpath);
if(!renderer->renderGlyphs) return MS_FAILURE;
if(!ts->textpath->absolute) {
int g;
......@@ -1019,12 +1020,44 @@ int msDrawTextSymbol(mapObj *map, imageObj *image, pointObj labelPnt, textSymbol
}
}
}
if(MS_VALID_COLOR(ts->label->shadowcolor)) {
textSymbolObj *ts_shadow;
int g;
double ox, oy;
double cosa,sina;
if(ts->rotation != 0) {
cosa = cos(ts->rotation);
sina = sin(ts->rotation);
ox = ts->scalefactor * (cosa * ts->label->shadowsizex +
sina * ts->label->shadowsizey);
oy = ts->scalefactor * (-sina * ts->label->shadowsizex +
cosa * ts->label->shadowsizey);
}
else {
ox = ts->scalefactor * ts->label->shadowsizex;
oy = ts->scalefactor * ts->label->shadowsizey;
}
ts_shadow = msSmallMalloc(sizeof(textSymbolObj));
initTextSymbol(ts_shadow);
msCopyTextSymbol(ts_shadow,ts);
for(g=0;g<ts_shadow->textpath->numglyphs;g++) {
ts_shadow->textpath->glyphs[g].pnt.x += ox;
ts_shadow->textpath->glyphs[g].pnt.y += oy;
}
renderer->renderGlyphs(image,ts_shadow->textpath,&ts->label->shadowcolor,NULL,0);
freeTextSymbol(ts_shadow);
msFree(ts_shadow);
}
if(MS_VALID_COLOR(ts->label->color))
c = &ts->label->color;
if(MS_VALID_COLOR(ts->label->outlinecolor))
oc = &ts->label->outlinecolor;
ow = MS_NINT((double)ts->label->outlinewidth * ((double)ts->textpath->glyph_size / (double)ts->label->size));
if(!renderer->renderGlyphs) return MS_FAILURE;
return renderer->renderGlyphs(image,ts->textpath,c,oc,ow);
}
......
......@@ -1547,7 +1547,12 @@ int msResampleGDALToMap( mapObj *map, layerObj *layer, imageObj *image,
/* matches the sSrcExtent, even if that generates non-square pixels (#1715) */
/* The rotated case should ideally be dealt with, but not for now... */
if( adfSrcGeoTransform[2] == 0 && adfSrcGeoTransform[4] == 0 &&
adfSrcGeoTransform[5] < 0 )
adfSrcGeoTransform[5] < 0 &&
/* But do that only if the pixels were square before, otherwise */
/* this is going to mess with source rasters whose pixels aren't at */
/* all square (#5445) */
fabs(fabs(adfSrcGeoTransform[1]) - fabs(adfSrcGeoTransform[5])) <
0.01 * fabs(adfSrcGeoTransform[1]) )
{
adfSrcGeoTransform[1] = (sSrcExtent.maxx - sSrcExtent.minx) *
dfNominalCellSize / nLoadImgXSize;
......
......@@ -1759,6 +1759,8 @@ shapeObj *msOffsetCurve(shapeObj *p, double offset)
if that is the case.*/
if(ret)
return ret;
/* clear error raised by geos in this case */
msResetErrorList();
#endif
/*
** For offset corner point calculation 1/sin() is used
......
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