Commit b22943a2 authored by Bas Couwenberg's avatar Bas Couwenberg

Imported Upstream version 7.0.0~beta2

parent 081b030e
......@@ -16,9 +16,9 @@ include(CheckCSourceCompiles)
set (MapServer_VERSION_MAJOR 7)
set (MapServer_VERSION_MINOR 1)
set (MapServer_VERSION_MINOR 0)
set (MapServer_VERSION_REVISION 0)
set (MapServer_VERSION_SUFFIX "")
set (MapServer_VERSION_SUFFIX "-beta2")
set(TARGET_VERSION_MAJOR ${MapServer_VERSION_MAJOR})
set(TARGET_VERSION_MINOR ${MapServer_VERSION_MINOR})
......
Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
2002 by Cold Spring Harbor Laboratory. Funded under Grant
P41-RR02188 by the National Institutes of Health.
Portions copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 by
Boutell.Com, Inc.
Portions relating to GD2 format copyright 1999, 2000, 2001, 2002
Philip Warner.
Portions relating to PNG copyright 1999, 2000, 2001, 2002 Greg
Roelofs.
Portions relating to gdttf.c copyright 1999, 2000, 2001, 2002 John
Ellson (ellson@lucent.com).
Portions relating to gdft.c copyright 2001, 2002 John Ellson
(ellson@lucent.com).
Portions relating to JPEG and to color quantization copyright 2000,
2001, 2002, Doug Becker and copyright (C) 1994, 1995, 1996, 1997,
1998, 1999, 2000, 2001, 2002, Thomas G. Lane. This software is
based in part on the work of the Independent JPEG Group. See the
file README-JPEG.TXT for more information.
Portions relating to WBMP copyright 2000, 2001, 2002 Maurice
Szmurlo and Johan Van den Brande.
Permission has been granted to copy, distribute and modify gd in
any context without fee, including a commercial application,
provided that this notice is present in user-accessible supporting
documentation.
This does not affect your ownership of the derived work itself, and
the intent is to assure proper credit for the authors of gd, not to
interfere with your productive use of gd. If you have questions,
ask. "Derived works" includes all programs that utilize the
library. Credit must be given in user-accessible documentation.
This software is provided "AS IS." The copyright holders disclaim
all warranties, either express or implied, including but not
limited to implied warranties of merchantability and fitness for a
particular purpose, with respect to this code and accompanying
documentation.
Although their code does not appear in gd, the authors wish to thank
David Koblas, David Rowley, and Hutchison Avenue Software Corporation
for their prior contributions.
......@@ -86,6 +86,7 @@ void msFreeFontCache(ft_cache *c) {
}
#endif
FT_Done_Face(cur_face->face);
free(cur_face->font);
UT_HASH_DEL(c->face_cache,cur_face);
free(cur_face);
}
......@@ -227,9 +228,10 @@ face_element* msGetFontFace(char *key, fontSetObj *fontset) {
FT_Select_Charmap(fc->face, FT_ENCODING_APPLE_ROMAN);
/* the previous calls may have failed, we ignore as there's nothing much left to do */
}
fc->font = key;
fc->font = msStrdup(key);
UT_HASH_ADD_KEYPTR(hh,cache->face_cache,fc->font, strlen(key), fc);
}
return fc;
}
......
......@@ -328,6 +328,8 @@ imageObj *msDrawMap(mapObj *map, int querymap)
for(i=0; i<map->numlayers; i++) {
if(map->layerorder[i] != -1) {
char *force_draw_label_cache = NULL;
lp = (GET_LAYER(map, map->layerorder[i]));
if(lp->postlabelcache) /* wait to draw */
......@@ -389,6 +391,27 @@ imageObj *msDrawMap(mapObj *map, int querymap)
(endtime.tv_sec+endtime.tv_usec/1.0e6)-
(starttime.tv_sec+starttime.tv_usec/1.0e6) );
}
/* Flush layer cache in-between layers if requested by PROCESSING directive*/
force_draw_label_cache = msLayerGetProcessingKey(lp, "FORCE_DRAW_LABEL_CACHE");
if (force_draw_label_cache &&
strncasecmp(force_draw_label_cache,"FLUSH",5)==0) {
if(map->debug >= MS_DEBUGLEVEL_V)
msDebug("msDrawMap(): PROCESSING FORCE_DRAW_LABEL_CACHE=FLUSH found.\n");
if(msDrawLabelCache(map, image) != MS_SUCCESS) {
msFreeImage(image);
#if defined(USE_WMS_LYR) || defined(USE_WFS_LYR)
if (pasOWSReqInfo) {
msHTTPFreeRequestObj(pasOWSReqInfo, numOWSRequests);
msFree(pasOWSReqInfo);
}
#endif /* USE_WMS_LYR || USE_WFS_LYR */
return(NULL);
}
msFreeLabelCache(&(map->labelcache));
msInitLabelCache(&(map->labelcache));
} /* PROCESSING FORCE_DRAW_LABEL_CACHE */
}
}
......@@ -431,8 +454,6 @@ imageObj *msDrawMap(mapObj *map, int querymap)
}
}
if(map->debug >= MS_DEBUGLEVEL_TUNING) msGettimeofday(&starttime, NULL);
if(msDrawLabelCache(map, image) != MS_SUCCESS) {
msFreeImage(image);
#if defined(USE_WMS_LYR) || defined(USE_WFS_LYR)
......@@ -444,12 +465,6 @@ imageObj *msDrawMap(mapObj *map, int querymap)
return(NULL);
}
if(map->debug >= MS_DEBUGLEVEL_TUNING) {
msGettimeofday(&endtime, NULL);
msDebug("msDrawMap(): Drawing Label Cache, %.3fs\n",
(endtime.tv_sec+endtime.tv_usec/1.0e6)-
(starttime.tv_sec+starttime.tv_usec/1.0e6) );
}
for(i=0; i<map->numlayers; i++) { /* for each layer, check for postlabelcache layers */
......@@ -1007,7 +1022,6 @@ int msDrawVectorLayer(mapObj *map, layerObj *layer, imageObj *image)
if (cache) {
styleObj *pStyle = layer->class[shape.classindex]->styles[0];
colorObj tmp;
if (pStyle->outlinewidth > 0) {
/*
* RFC 49 implementation
......@@ -1017,17 +1031,7 @@ int msDrawVectorLayer(mapObj *map, layerObj *layer, imageObj *image)
* - draw the shape (the outline) in the first pass of the
* caching mechanism
*/
/* adapt width (must take scalefactor into account) */
pStyle->width += (pStyle->outlinewidth / (layer->scalefactor/image->resolutionfactor)) * 2;
pStyle->minwidth += pStyle->outlinewidth * 2;
pStyle->maxwidth += pStyle->outlinewidth * 2;
pStyle->size += (pStyle->outlinewidth/layer->scalefactor*(map->resolution/map->defresolution));
/*swap color and outlinecolor*/
tmp = pStyle->color;
pStyle->color = pStyle->outlinecolor;
pStyle->outlinecolor = tmp;
msOutlineRenderingPrepareStyle(pStyle, map, layer, image);
}
status = msDrawShape(map, layer, &shape, image, 0, drawmode|MS_DRAWMODE_SINGLESTYLE); /* draw a single style */
if (pStyle->outlinewidth > 0) {
......@@ -1036,17 +1040,7 @@ int msDrawVectorLayer(mapObj *map, layerObj *layer, imageObj *image)
* original state, so the line fill will be drawn in the
* second pass of the caching mechanism
*/
/* reset widths to original state */
pStyle->width -= (pStyle->outlinewidth / (layer->scalefactor/image->resolutionfactor)) * 2;
pStyle->minwidth -= pStyle->outlinewidth * 2;
pStyle->maxwidth -= pStyle->outlinewidth * 2;
pStyle->size -= (pStyle->outlinewidth/layer->scalefactor*(map->resolution/map->defresolution));
/*reswap colors to original state*/
tmp = pStyle->color;
pStyle->color = pStyle->outlinecolor;
pStyle->outlinecolor = tmp;
msOutlineRenderingRestoreStyle(pStyle, map, layer, image);
}
}
......@@ -1107,7 +1101,6 @@ int msDrawVectorLayer(mapObj *map, layerObj *layer, imageObj *image)
}
} else if(s>0) {
if (pStyle->outlinewidth > 0 && MS_VALID_COLOR(pStyle->outlinecolor)) {
colorObj tmp;
/*
* RFC 49 implementation
* if an outlinewidth is used:
......@@ -1116,17 +1109,7 @@ int msDrawVectorLayer(mapObj *map, layerObj *layer, imageObj *image)
* - draw the shape (the outline) in the first pass of the
* caching mechanism
*/
/* adapt width (must take scalefactor into account) */
pStyle->width += (pStyle->outlinewidth / (layer->scalefactor/image->resolutionfactor)) * 2;
pStyle->minwidth += pStyle->outlinewidth * 2;
pStyle->maxwidth += pStyle->outlinewidth * 2;
pStyle->size += (pStyle->outlinewidth/layer->scalefactor*(map->resolution/map->defresolution));
/*swap color and outlinecolor*/
tmp = pStyle->color;
pStyle->color = pStyle->outlinecolor;
pStyle->outlinecolor = tmp;
msOutlineRenderingPrepareStyle(pStyle, map, layer, image);
if(UNLIKELY(MS_FAILURE == msDrawLineSymbol(map, image, &current->shape, pStyle, layer->scalefactor))) {
return MS_FAILURE;
}
......@@ -1135,17 +1118,7 @@ int msDrawVectorLayer(mapObj *map, layerObj *layer, imageObj *image)
* original state, so the line fill will be drawn in the
* second pass of the caching mechanism
*/
/* reset widths to original state */
pStyle->width -= (pStyle->outlinewidth / (layer->scalefactor/image->resolutionfactor)) * 2;
pStyle->minwidth -= pStyle->outlinewidth * 2;
pStyle->maxwidth -= pStyle->outlinewidth * 2;
pStyle->size -= (pStyle->outlinewidth/layer->scalefactor*(map->resolution/map->defresolution));
/*reswap colors to original state*/
tmp = pStyle->color;
pStyle->color = pStyle->outlinecolor;
pStyle->outlinecolor = tmp;
msOutlineRenderingRestoreStyle(pStyle, map, layer, image);
}
/* draw a valid line, i.e. one with a color defined or of type pixmap*/
if(MS_VALID_COLOR(pStyle->color) ||
......@@ -2680,6 +2653,9 @@ void copyLabelBounds(label_bounds *dst, label_bounds *src) {
int msDrawLabelCache(mapObj *map, imageObj *image)
{
int nReturnVal = MS_SUCCESS;
struct mstimeval starttime, endtime;
if(map->debug >= MS_DEBUGLEVEL_TUNING) msGettimeofday(&starttime, NULL);
if(image) {
if(MS_RENDERER_PLUGIN(image->format)) {
......@@ -3139,10 +3115,17 @@ int msDrawLabelCache(mapObj *map, imageObj *image)
}
#endif
return MS_SUCCESS; /* necessary? */
nReturnVal = MS_SUCCESS; /* necessary? */
}
}
if(map->debug >= MS_DEBUGLEVEL_TUNING) {
msGettimeofday(&endtime, NULL);
msDebug("msDrawMap(): Drawing Label Cache, %.3fs\n",
(endtime.tv_sec+endtime.tv_usec/1.0e6)-
(starttime.tv_sec+starttime.tv_usec/1.0e6) );
}
return nReturnVal;
}
......
......@@ -720,6 +720,7 @@ void msGEOSFreeGeometry(shapeObj *shape)
g = (GEOSGeom) shape->geometry;
GEOSGeom_destroy_r(handle,g);
shape->geometry = NULL;
#else
msSetError(MS_GEOSERR, "GEOS support is not available.", "msGEOSFreeGEOSGeom()");
return;
......
......@@ -218,10 +218,28 @@ int msDrawLegendIcon(mapObj *map, layerObj *lp, classObj *theclass,
if (theclass->styles[i]->_geomtransform.type == MS_GEOMTRANSFORM_NONE ||
theclass->styles[i]->_geomtransform.type == MS_GEOMTRANSFORM_LABELPOINT ||
theclass->styles[i]->_geomtransform.type == MS_GEOMTRANSFORM_LABELPOLY) {
if (theclass->styles[i]->outlinewidth > 0) {
/* Swap the style contents to render the outline first,
* and then restore the style to render the interior of the line
*/
msOutlineRenderingPrepareStyle(theclass->styles[i], map, lp, image);
ret = msDrawLineSymbol(map, image_draw, &zigzag, theclass->styles[i], lp->scalefactor * image_draw->resolutionfactor);
msOutlineRenderingRestoreStyle(theclass->styles[i], map, lp, image);
if(UNLIKELY(ret == MS_FAILURE)) goto legend_icon_cleanup;
}
ret = msDrawLineSymbol(map, image_draw, &zigzag, theclass->styles[i], lp->scalefactor * image_draw->resolutionfactor);
if(UNLIKELY(ret == MS_FAILURE)) goto legend_icon_cleanup;
}
else {
if (theclass->styles[i]->outlinewidth > 0) {
/* Swap the style contents to render the outline first,
* and then restore the style to render the interior of the line
*/
msOutlineRenderingPrepareStyle(theclass->styles[i], map, lp, image);
ret = msDrawTransformedShape(map, image_draw, &zigzag, theclass->styles[i], lp->scalefactor * image_draw->resolutionfactor);
msOutlineRenderingRestoreStyle(theclass->styles[i], map, lp, image);
if(UNLIKELY(ret == MS_FAILURE)) goto legend_icon_cleanup;
}
ret = msDrawTransformedShape(map, image_draw, &zigzag, theclass->styles[i], lp->scalefactor * image_draw->resolutionfactor);
if(UNLIKELY(ret == MS_FAILURE)) goto legend_icon_cleanup;
}
......
This diff is collapsed.
......@@ -66,7 +66,8 @@ int FLTIsNumeric(const char *pszValue)
return MS_TRUE;
#else
char * p;
if (strtod(pszValue, &p) != 0 || *p == '\0') return MS_TRUE;
strtod(pszValue, &p);
if ( p != pszValue && *p == '\0') return MS_TRUE;
#endif
}
......
This diff is collapsed.
......@@ -80,6 +80,17 @@ static void msOWSClearRequestObj(owsRequestObj *ows_request)
}
}
#if defined(USE_LIBXML2) && LIBXML_VERSION < 20900
static int bExternalEntityAsked = FALSE;
static xmlParserInputPtr dummyEntityLoader(const char * URL,
const char * ID,
xmlParserCtxtPtr context )
{
bExternalEntityAsked = TRUE;
return NULL;
}
#endif
/*
** msOWSPreParseRequest() parses a cgiRequestObj either with GET/KVP
** or with POST/XML. Only SERVICE, VERSION (or WMTVER) and REQUEST are
......@@ -121,6 +132,9 @@ static int msOWSPreParseRequest(cgiRequestObj *request,
} else if (request->type == MS_POST_REQUEST) {
#if defined(USE_LIBXML2)
xmlNodePtr root = NULL;
#if LIBXML_VERSION < 20900
xmlExternalEntityLoader oldExternalEntityLoader;
#endif
#elif defined(USE_GDAL)
CPLXMLNode *temp;
#endif
......@@ -130,9 +144,24 @@ static int msOWSPreParseRequest(cgiRequestObj *request,
return MS_FAILURE;
}
#if defined(USE_LIBXML2)
#if LIBXML_VERSION < 20900
oldExternalEntityLoader = xmlGetExternalEntityLoader();
/* to avoid XML External Entity vulnerability with libxml2 < 2.9 */
xmlSetExternalEntityLoader (dummyEntityLoader);
bExternalEntityAsked = FALSE;
#endif
/* parse to DOM-Structure with libxml2 and get the root element */
ows_request->document = xmlParseMemory(request->postrequest,
strlen(request->postrequest));
#if LIBXML_VERSION < 20900
xmlSetExternalEntityLoader (oldExternalEntityLoader);
if( bExternalEntityAsked )
{
msSetError(MS_OWSERR, "XML parsing error: %s",
"msOWSPreParseRequest()", "External entity fetch");
return MS_FAILURE;
}
#endif
if (ows_request->document == NULL
|| (root = xmlDocGetRootElement(ows_request->document)) == NULL) {
xmlErrorPtr error = xmlGetLastError();
......
......@@ -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;
......@@ -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
......
......@@ -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 )
......@@ -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 */
}
......
......@@ -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);
}
......@@ -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);
......@@ -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;
......@@ -561,7 +561,7 @@ int msDrawLineSymbol(mapObj *map, imageObj *image, shapeObj *p,
rendererVTableObj *renderer = image->format->vtable;
symbolObj *symbol;
shapeObj *offsetLine = p;
int i,ret=MS_SUCCESS;
int i;
double width;
double finalscalefactor;
......@@ -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);
}
......@@ -1023,7 +1023,7 @@ int msDrawTextSymbol(mapObj *map, imageObj *image, pointObj labelPnt, textSymbol
c = &ts->label->color;
if(MS_VALID_COLOR(ts->label->outlinecolor))
oc = &ts->label->outlinecolor;
ow = ts->label->outlinewidth * ts->scalefactor;
ow = ts->label->outlinewidth * (ts->textpath->glyph_size / ts->label->size);
if(!renderer->renderGlyphs) return MS_FAILURE;
return renderer->renderGlyphs(image,ts->textpath,c,oc,ow);
......@@ -1077,3 +1077,54 @@ int msDrawPieSlice(mapObj *map, imageObj *image, pointObj *p, styleObj *style, d
msFree(circle);
return status;
}
/*
* RFC 49 implementation
* if an outlinewidth is used:
* - augment the style's width to account for the outline width
* - swap the style color and outlinecolor
* - draw the shape (the outline) in the first pass of the
* caching mechanism
*/
void msOutlineRenderingPrepareStyle(styleObj *pStyle, mapObj *map, layerObj *layer, imageObj *image)
{
colorObj tmp;
if (pStyle->outlinewidth > 0) {
/* adapt width (must take scalefactor into account) */
pStyle->width += (pStyle->outlinewidth / (layer->scalefactor/image->resolutionfactor)) * 2;
pStyle->minwidth += pStyle->outlinewidth * 2;
pStyle->maxwidth += pStyle->outlinewidth * 2;
pStyle->size += (pStyle->outlinewidth/layer->scalefactor*(map->resolution/map->defresolution));
/*swap color and outlinecolor*/
tmp = pStyle->color;
pStyle->color = pStyle->outlinecolor;
pStyle->outlinecolor = tmp;
}
}
/*
* RFC 49 implementation: switch back the styleobj to its
* original state, so the line fill will be drawn in the
* second pass of the caching mechanism
*/
void msOutlineRenderingRestoreStyle(styleObj *pStyle, mapObj *map, layerObj *layer, imageObj *image)
{
colorObj tmp;
if (pStyle->outlinewidth > 0) {
/* reset widths to original state */
pStyle->width -= (pStyle->outlinewidth / (layer->scalefactor/image->resolutionfactor)) * 2;
pStyle->minwidth -= pStyle->outlinewidth * 2;
pStyle->maxwidth -= pStyle->outlinewidth * 2;
pStyle->size -= (pStyle->outlinewidth/layer->scalefactor*(map->resolution/map->defresolution));
/*reswap colors to original state*/
tmp = pStyle->color;
pStyle->color = pStyle->outlinecolor;
pStyle->outlinecolor = tmp;
}
}
......@@ -1951,7 +1951,7 @@ PHP_METHOD(mapObj, saveQuery)
zval *zobj = getThis();
char *filename;
long filename_len = 0;
int results = MS_FALSE;
long results = MS_FALSE;
int status = MS_FAILURE;
php_map_object *php_map;
......
......@@ -2535,7 +2535,8 @@ void msPopulateTextSymbolForLabelAndString(textSymbolObj *ts, labelObj *l, char
MS_DLL_EXPORT int WARN_UNUSED msDrawPieSlice(mapObj *map, imageObj *image, pointObj *p, styleObj *style, double radius, double start, double end);
MS_DLL_EXPORT int WARN_UNUSED msDrawLabelBounds(mapObj *map, imageObj *image, label_bounds *bnds, styleObj *style, double scalefactor);
MS_DLL_EXPORT void msOutlineRenderingPrepareStyle(styleObj *pStyle, mapObj *map, layerObj *layer, imageObj *image);
MS_DLL_EXPORT void msOutlineRenderingRestoreStyle(styleObj *pStyle, mapObj *map, layerObj *layer, imageObj *image);
MS_DLL_EXPORT int WARN_UNUSED msDrawLabel(mapObj *map, imageObj *image, pointObj labelPnt, char *string, labelObj *label, double scalefactor);
MS_DLL_EXPORT int WARN_UNUSED msDrawTextSymbol(mapObj *map, imageObj *image, pointObj labelPnt, textSymbolObj *ts);
......
......@@ -2688,7 +2688,7 @@ int msSHPLayerNextShape(layerObj *layer, shapeObj *shape)
msSHPReadShape(shpfile->hSHP, i, shape);
if(shape->type == MS_SHAPE_NULL) {
msFreeShape(shape);
msSHPLayerNextShape(layer, shape); /* skip NULL shapes */
return msSHPLayerNextShape(layer, shape); /* skip NULL shapes */
}
shape->numvalues = layer->numitems;
shape->values = msDBFGetValueList(shpfile->hDBF, i, layer->iteminfo, layer->numitems);
......
......@@ -318,6 +318,9 @@ void writeSymbol(symbolObj *s, FILE *stream)
if(s->filled == MS_TRUE) msIO_fprintf(stream, " FILLED TRUE\n");
if(s->imagepath != NULL) msIO_fprintf(stream, " IMAGE \"%s\"\n", s->imagepath);
if(s->anchorpoint_y!=0.5 || s->anchorpoint_x!=0.5) {
msIO_fprintf(stream, " ANCHORPOINT %g %g\n", s->anchorpoint_x, s->anchorpoint_y);
}
/* POINTS */
if(s->numpoints != 0) {
......
......@@ -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;
......@@ -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);
}
......@@ -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;
......
......@@ -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;
}
......@@ -690,7 +689,6 @@ int msPrepareWFSLayerRequest(int nLayerId, mapObj *map, layerObj *lp,
if (psParams) {
msWFSFreeParamsObj(psParams);
free(psParams);
}
return nStatus;
......
......@@ -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 */
......@@ -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
*/
......
......@@ -14,6 +14,6 @@ apt-get -y upgrade
apt-get install -q -y git build-essential pkg-config cmake libgeos-dev rake \
libpq-dev python-all-dev libproj-dev libxml2-dev postgis php5-dev \
postgresql-server-dev-9.1 postgresql-9.1-postgis-2.1 vim bison flex swig \
librsvg2-dev libpng12-dev libjpeg-dev libgif-dev libgd2-xpm-dev \
librsvg2-dev libpng12-dev libjpeg-dev libgif-dev \
libfreetype6-dev libfcgi-dev libcurl4-gnutls-dev libcairo2-dev \
libgdal1-dev libfribidi-dev libexempi-dev
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