Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mapserver/mapserver
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jun 24, 2015
2 parents 6d69109 + d039bf6 commit 3de634e
Show file tree
Hide file tree
Showing 8 changed files with 514 additions and 51 deletions.
478 changes: 451 additions & 27 deletions mapmssql2008.c

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions mappluginlayer.c
Expand Up @@ -154,6 +154,8 @@ static void
copyVirtualTable(layerVTableObj *dest,
const layerVTableObj *src)
{
dest->LayerTranslateFilter = src->LayerTranslateFilter ? src->LayerTranslateFilter : dest->LayerTranslateFilter;
dest->LayerSupportsCommonFilters = src->LayerSupportsCommonFilters ? src->LayerSupportsCommonFilters : dest->LayerSupportsCommonFilters;
dest->LayerInitItemInfo = src->LayerInitItemInfo ? src->LayerInitItemInfo : dest->LayerInitItemInfo;
dest->LayerFreeItemInfo = src->LayerFreeItemInfo ? src->LayerFreeItemInfo : dest->LayerFreeItemInfo;
dest->LayerOpen = src->LayerOpen ? src->LayerOpen : dest->LayerOpen;
Expand All @@ -172,6 +174,11 @@ copyVirtualTable(layerVTableObj *dest,
dest->LayerCreateItems = src->LayerCreateItems ? src->LayerCreateItems : dest->LayerCreateItems;
dest->LayerGetNumFeatures = src->LayerGetNumFeatures ? src->LayerGetNumFeatures : dest->LayerGetNumFeatures;
dest->LayerGetAutoProjection = src->LayerGetAutoProjection ? src->LayerGetAutoProjection: dest->LayerGetAutoProjection;
dest->LayerEscapeSQLParam = src->LayerEscapeSQLParam ? src->LayerEscapeSQLParam: dest->LayerEscapeSQLParam;
dest->LayerEscapePropertyName = src->LayerEscapePropertyName ? src->LayerEscapePropertyName: dest->LayerEscapePropertyName;
dest->LayerEscapeSQLParam = src->LayerEscapeSQLParam ? src->LayerEscapeSQLParam: dest->LayerEscapeSQLParam;
dest->LayerEnablePaging = src->LayerEnablePaging ? src->LayerEnablePaging: dest->LayerEnablePaging;
dest->LayerGetPaging = src->LayerGetPaging ? src->LayerGetPaging: dest->LayerGetPaging;
}

int
Expand Down
6 changes: 5 additions & 1 deletion maprasterquery.c
Expand Up @@ -1286,12 +1286,14 @@ int msRASTERLayerGetItems(layerObj *layer)
#ifndef USE_GDAL
return MS_FAILURE;
#else
int maxnumitems = 0;
rasterLayerInfo *rlinfo = (rasterLayerInfo *) layer->layerinfo;

if( rlinfo == NULL )
return MS_FAILURE;

layer->items = (char **) msSmallCalloc(sizeof(char *),10);
maxnumitems = 8 + (rlinfo->qc_values?rlinfo->band_count:0);
layer->items = (char **) msSmallCalloc(sizeof(char *),maxnumitems);

layer->numitems = 0;
if( rlinfo->qc_x_reproj )
Expand All @@ -1318,6 +1320,8 @@ int msRASTERLayerGetItems(layerObj *layer)
if( rlinfo->qc_count )
layer->items[layer->numitems++] = msStrdup("count");

assert(layer->numitems <= maxnumitems);

return msRASTERLayerInitItemInfo(layer);
#endif /* def USE_GDAL */
}
Expand Down
10 changes: 5 additions & 5 deletions maprendering.c
Expand Up @@ -247,8 +247,8 @@ imageObj *getTile(imageObj *img, symbolObj *symbol, symbolStyleObj *s, int widt
if(UNLIKELY(!face)) { status = MS_FAILURE; break; }
msUTF8ToUniChar(symbol->character, &unicode);
unicode = msGetGlyphIndex(face,unicode);
glyphc = msGetGlyphByIndex(face, s->scale, unicode);
if(UNLIKELY(!face)) { status = MS_FAILURE; break; }
glyphc = msGetGlyphByIndex(face, MS_MAX(MS_NINT(s->scale),1), unicode);
if(UNLIKELY(!glyphc)) { status = MS_FAILURE; break; }
status = drawGlyphMarker(tileimg, face, glyphc, p_x, p_y, s->scale, s->rotation,
s->color, s->outlinecolor, s->outlinewidth);
}
Expand Down Expand Up @@ -311,7 +311,7 @@ imageObj *getTile(imageObj *img, symbolObj *symbol, symbolStyleObj *s, int widt
if(UNLIKELY(!face)) { status = MS_FAILURE; break; }
msUTF8ToUniChar(symbol->character, &unicode);
unicode = msGetGlyphIndex(face,unicode);
glyphc = msGetGlyphByIndex(face, s->scale, unicode);
glyphc = msGetGlyphByIndex(face, MS_MAX(MS_NINT(s->scale),1), unicode);
if(UNLIKELY(!glyphc)) { status = MS_FAILURE; break; }
status = drawGlyphMarker(tileimg, face, glyphc, p_x, p_y, s->scale, s->rotation,
s->color, s->outlinecolor, s->outlinewidth);
Expand Down Expand Up @@ -384,7 +384,7 @@ int msImagePolylineMarkers(imageObj *image, shapeObj *p, symbolObj *symbol,
face = msGetFontFace(symbol->font, &image->map->fontset);
if(UNLIKELY(!face)) return MS_FAILURE;
unicode = msGetGlyphIndex(face,unicode);
glyphc = msGetGlyphByIndex(face, style->scale, unicode);
glyphc = msGetGlyphByIndex(face, MS_MAX(MS_NINT(style->scale),1), unicode);
if(UNLIKELY(!glyphc)) return MS_FAILURE;
symbol_width = glyphc->metrics.maxx - glyphc->metrics.minx;
symbol_height = glyphc->metrics.maxy - glyphc->metrics.miny;
Expand Down Expand Up @@ -922,7 +922,7 @@ int msDrawMarkerSymbol(mapObj *map, imageObj *image, pointObj *p, styleObj *styl
if(UNLIKELY(!face)) return MS_FAILURE;
msUTF8ToUniChar(symbol->character,&unicode);
unicode = msGetGlyphIndex(face,unicode);
glyphc = msGetGlyphByIndex(face,s.scale,unicode);
glyphc = msGetGlyphByIndex(face, MS_MAX(MS_NINT(s.scale),1), unicode);
if(UNLIKELY(!glyphc)) return MS_FAILURE;
ret = drawGlyphMarker(image, face, glyphc, p_x, p_y, s.scale, s.rotation, s.color, s.outlinecolor, s.outlinewidth);
}
Expand Down
12 changes: 9 additions & 3 deletions mapwcs20.c
Expand Up @@ -3707,8 +3707,8 @@ static int msWCSGetCoverage20_FinalizeParamsObj(wcs20ParamsObjPtr params, wcs20A
params->subsetcrs = msStrdup(crs);
}
} else if (!params->subsetcrs) {
/* default to imageCRS */
params->subsetcrs = msStrdup("imageCRS");
/* default to CRS of image */
/* leave params->subsetcrs to null */
}

return MS_SUCCESS;
Expand Down Expand Up @@ -4126,7 +4126,7 @@ this request. Check wcs/ows_enable_request settings.", "msWCSGetCoverage20()", p
msWCSClearCoverageMetadata20(&cm);
msSetError(MS_WCSERR,
"Error loading CRS %s.",
"msWCSGetCoverage20()", params->subsetcrs);
"msWCSGetCoverage20()", cm.srs);
return msWCSException(map, "InvalidParameterValue",
"projection", params->version);
}
Expand Down Expand Up @@ -4165,6 +4165,12 @@ this request. Check wcs/ows_enable_request settings.", "msWCSGetCoverage20()", p

subsets = params->bbox;

/* if no subsetCRS was specified use the coverages CRS
(Requirement 27 of the WCS 2.0 specification) */
if (!params->subsetcrs) {
params->subsetcrs = msStrdup(cm.srs);
}

if(EQUAL(params->subsetcrs, "imageCRS")) {
/* subsets are in imageCRS; reproject them to real coordinates */
rectObj orig_bbox = subsets;
Expand Down
2 changes: 0 additions & 2 deletions mapwfslayer.c
Expand Up @@ -658,7 +658,6 @@ int msPrepareWFSLayerRequest(int nLayerId, mapObj *map, layerObj *lp,
pasReqInfo, *numRequests, map, "FO") != MS_SUCCESS) {
if (psParams) {
msWFSFreeParamsObj(psParams);
free(psParams);
}
return MS_FAILURE;
}
Expand Down Expand Up @@ -690,7 +689,6 @@ int msPrepareWFSLayerRequest(int nLayerId, mapObj *map, layerObj *lp,

if (psParams) {
msWFSFreeParamsObj(psParams);
free(psParams);
}
return nStatus;

Expand Down
48 changes: 36 additions & 12 deletions mapwms.c
Expand Up @@ -326,9 +326,15 @@ int msWMSApplyTime(mapObj *map, int version, char *time, char *wms_exception_for
*/
void msWMSPrepareNestedGroups(mapObj* map, int nVersion, char*** nestedGroups, int* numNestedGroups, int* isUsedInNestedGroup)
{
int i, j, k;
int i, k;
const char* groups;
char* errorMsg;
//Create array to hold unique groups
int maxgroups = 2000;
int maxgroupiter = 1;
char** uniqgroups = malloc(maxgroups * sizeof(char*));
int uniqgroupcount = 0;


for (i = 0; i < map->numlayers; i++) {
nestedGroups[i] = NULL; /* default */
Expand All @@ -351,24 +357,42 @@ void msWMSPrepareNestedGroups(mapObj* map, int nVersion, char*** nestedGroups, i
} else {
/* split into subgroups. Start at address + 1 because the first '/' would cause an extra empty group */
nestedGroups[i] = msStringSplit(groups + 1, '/', &numNestedGroups[i]);
/* */
for (j = 0; j < map->numlayers; j++) {
if (isUsedInNestedGroup[j])
continue;

for (k=0; k<numNestedGroups[i]; k++) {
if ( GET_LAYER(map, j)->name && strcasecmp(GET_LAYER(map, j)->name, nestedGroups[i][k]) == 0 ) {
isUsedInNestedGroup[j] = 1;
/* Iterate through the groups and add them to the unique groups array */
for (k=0; k<numNestedGroups[i]; k++) {
int found ,l = 0;
found = 0;
for (l=0; l<uniqgroupcount; l++) {
if ( strcasecmp(uniqgroups[l], nestedGroups[i][k]) == 0 ){
found = 1;
break;
}
}
}
if(found == 0){
uniqgroups[uniqgroupcount] = nestedGroups[i][k];
uniqgroupcount++;
// Does need only when maximum unique groups exceed 2000
if ( uniqgroupcount == (maxgroups*maxgroupiter)){
uniqgroups = realloc(uniqgroups, (uniqgroupcount + maxgroups) * sizeof(char*));
maxgroupiter++;
}
}
}
}
}
}
}
/* Iterate through layers to find out whether they are in any of the nested groups */
for (i = 0; i < map->numlayers; i++) {
for (k=0; k<uniqgroupcount; k++) {
if ( strcasecmp(GET_LAYER(map, i)->name ,uniqgroups[k]) == 0 ){
isUsedInNestedGroup[i] = 1;
break;
}
}
}
}
}
}


/*
** Validate that a given dimension is inside the extents defined
*/
Expand Down
2 changes: 1 addition & 1 deletion msautotest
Submodule msautotest updated from d7a53c to 289dc1

0 comments on commit 3de634e

Please sign in to comment.