Imported Upstream version 6.2.1

parent a274d9ca
......@@ -12,8 +12,8 @@ the top of the list.)
For a complete change history, please see the Git log comments.
Current Version (git master, 6.3-dev, future 6.4):
--------------------------------------------------
Version 6.2.1 (2013-04-19):
---------------------------
- Fix WFS GetFeature result bounds are not written in requested projection (#4494)
......
......@@ -33,6 +33,11 @@ CGI Changes
-----------
* Changing MIN/MAXSCALE or MIN/MAXSCALEDENOM via URL is no longer supported.
* The syntax for changing a LABEL with CGI commands has changed along with the
ability to support multiple labels
The previous syntax ...&map.layer[0].class[0]=label+color+255+0+0+end&... is
replaced with ...&map.layer[0].class[0].label[0]=color+255+0+0&...
Note that cgi label modifications are/were broken in 6.2.0 and fixed in 6.2.1
-----------------
Rendering changes
......
......@@ -159,7 +159,7 @@ int loadParams(cgiRequestObj *request,
/* if the content_type is application/x-www-form-urlencoded,
we have to parse it like the QUERY_STRING variable */
if(strcmp(request->contenttype, "application/x-www-form-urlencoded") == 0) {
if(strncmp(request->contenttype, "application/x-www-form-urlencoded", strlen("application/x-www-form-urlencoded")) == 0) {
while( data_len > 0 && isspace(post_data[data_len-1]) )
post_data[--data_len] = '\0';
......
......@@ -32,6 +32,9 @@
#ifndef CGIUTIL_H
#define CGIUTIL_H
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_WIN32) && !defined(__CYGWIN__)
# define MS_DLL_EXPORT __declspec(dllexport)
......@@ -93,4 +96,8 @@ MS_DLL_EXPORT cgiRequestObj *msAllocCgiObj(void);
MS_DLL_EXPORT void msFreeCgiObj(cgiRequestObj *request);
#endif /*SWIG*/
#ifdef __cplusplus
}
#endif
#endif /* CGIUTIL_H */
......@@ -17836,7 +17836,7 @@ else
int
main ()
{
int x;__sync_fetch_and_add(&x,1);
long x=0,y=0;for(x=0;x<5;x++){if(y>1) break; y=__sync_fetch_and_add(&x,1);}
;
return 0;
}
......
......@@ -851,7 +851,7 @@ dnl ---------------------------------------------------------------------
dnl Check for the __sync_fetch_and_add builtin
dnl ---------------------------------------------------------------------
AC_CACHE_CHECK([for __sync_fetch_and_add], ac_cv_func_sync_fetch_and_add,
[AC_TRY_LINK([],[int x;__sync_fetch_and_add(&x,1);],ac_cv_func_sync_fetch_and_add=yes,ac_cv_func_sync_fetch_and_add=no)])
[AC_TRY_LINK([],[long x=0,y=0;for(x=0;x<5;x++){if(y>1) break; y=__sync_fetch_and_add(&x,1);}],ac_cv_func_sync_fetch_and_add=yes,ac_cv_func_sync_fetch_and_add=no)])
if test "$ac_cv_func_sync_fetch_and_add" = yes; then
ALL_ENABLED="-DHAVE_SYNC_FETCH_AND_ADD $ALL_ENABLED"
AC_DEFINE(HAVE_SYNC_FETCH_AND_ADD,1,[Define if you have the __sync_fetch_and_add function])
......
......@@ -172,6 +172,13 @@ faceCacheObj *getFontFace(cairoCacheData *cache, const char *font)
free(newface);
return NULL;
}
/* Try to select charmap */
if (!newface->ftface->charmap) {
if( FT_Select_Charmap(newface->ftface, FT_ENCODING_MS_SYMBOL) )
FT_Select_Charmap(newface->ftface, FT_ENCODING_APPLE_ROMAN );
}
newface->next = cache->facecache;
cache->facecache = newface;
newface->face = cairo_ft_font_face_create_for_ft_face(newface->ftface, 0);
......@@ -403,6 +410,11 @@ int renderTruetypeSymbolCairo(imageObj *img, double x, double y, symbolObj *symb
msUTF8ToUniChar(symbol->character, &unicode);
if (face->ftface->charmap &&
face->ftface->charmap->encoding == FT_ENCODING_MS_SYMBOL)
unicode |= 0xf000;
glyph.index = FT_Get_Char_Index(face->ftface, unicode);
glyph.x=0;
glyph.y=0;
......@@ -497,6 +509,10 @@ int getTruetypeTextBBoxCairo(rendererVTableObj *renderer, char **fonts, int numf
curfontidx = 0;
}
if (face->ftface->charmap &&
face->ftface->charmap->encoding == FT_ENCODING_MS_SYMBOL)
unicode |= 0xf000;
glyph.index = FT_Get_Char_Index(face->ftface, unicode);
if (glyph.index == 0) {
......@@ -582,6 +598,11 @@ int renderGlyphsCairo(imageObj *img,double x, double y, labelStyleObj *style, ch
cairo_set_font_face(r->cr,face->face);
curfontidx = 0;
}
if (face->ftface->charmap &&
face->ftface->charmap->encoding == FT_ENCODING_MS_SYMBOL)
unicode |= 0xf000;
glyph.index = FT_Get_Char_Index(face->ftface, unicode);
if(glyph.index == 0) {
int j;
......
......@@ -346,6 +346,16 @@ int msCopyLabel(labelObj *dst, labelObj *src)
MS_COPYSTELEM(outlinewidth);
MS_COPYSTELEM(space_size_10);
if (msCopyExpression(&(dst->expression), &(src->expression)) != MS_SUCCESS) {
msSetError(MS_MEMERR, "Failed to copy expression.", "msCopyLabel()");
return MS_FAILURE;
}
if (msCopyExpression(&(dst->text), &(src->text)) != MS_SUCCESS) {
msSetError(MS_MEMERR, "Failed to copy text.", "msCopyLabel()");
return MS_FAILURE;
}
/*
** now the styles
*/
......@@ -420,6 +430,7 @@ int msCopyWeb(webObj *dst, webObj *src, mapObj *map)
if (msCopyHashTable(&(dst->metadata), &(src->metadata)) != MS_SUCCESS)
return MS_FAILURE;
}
msCopyHashTable(&dst->validation,&src->validation);
MS_COPYSTRING(dst->queryformat, src->queryformat);
MS_COPYSTRING(dst->legendformat, src->legendformat);
......@@ -567,6 +578,7 @@ int msCopyClass(classObj *dst, classObj *src, layerObj *layer)
/* dst->metadata = msCreateHashTable(); */
msCopyHashTable(&(dst->metadata), &(src->metadata));
}
msCopyHashTable(&dst->validation,&src->validation);
MS_COPYSTELEM(minscaledenom);
MS_COPYSTELEM(maxscaledenom);
......@@ -967,6 +979,7 @@ int msCopyLayer(layerObj *dst, layerObj *src)
if (&(src->metadata)) {
msCopyHashTable(&(dst->metadata), &(src->metadata));
}
msCopyHashTable(&dst->validation,&src->validation);
MS_COPYSTELEM(opacity);
MS_COPYSTELEM(dump);
......
......@@ -943,19 +943,19 @@ int msDrawVectorLayer(mapObj *map, layerObj *layer, imageObj *image)
}
/* identify target shapes */
if(layer->transform == MS_TRUE)
if(layer->transform == MS_TRUE) {
searchrect = map->extent;
#ifdef USE_PROJ
if((map->projection.numargs > 0) && (layer->projection.numargs > 0))
msProjectRect(&map->projection, &layer->projection, &searchrect); /* project the searchrect to source coords */
#endif
}
else {
searchrect.minx = searchrect.miny = 0;
searchrect.maxx = map->width-1;
searchrect.maxy = map->height-1;
}
#ifdef USE_PROJ
if((map->projection.numargs > 0) && (layer->projection.numargs > 0))
msProjectRect(&map->projection, &layer->projection, &searchrect); /* project the searchrect to source coords */
#endif
status = msLayerWhichShapes(layer, searchrect, MS_FALSE);
if(status == MS_DONE) { /* no overlap */
msLayerClose(layer);
......@@ -2243,7 +2243,7 @@ int msDrawPoint(mapObj *map, layerObj *layer, pointObj *point, imageObj *image,
if(msScaleInBounds(map->scaledenom, theclass->styles[s]->minscaledenom, theclass->styles[s]->maxscaledenom))
msDrawMarkerSymbol(&map->symbolset, image, point, theclass->styles[s], layer->scalefactor);
}
if(labeltext) {
if(labeltext && (strlen(labeltext)>0)) {
if(layer->labelcache) {
if(msAddLabel(map, label, layer->index, classindex, NULL, point, NULL, -1) != MS_SUCCESS) return(MS_FAILURE);
} else
......
......@@ -2051,13 +2051,17 @@ static int loadLabel(labelObj *label)
} /* next token */
}
int msUpdateLabelFromString(labelObj *label, char *string)
int msUpdateLabelFromString(labelObj *label, char *string, int url_string)
{
if(!label || !string) return MS_FAILURE;
msAcquireLock( TLOCK_PARSER );
if(url_string)
msyystate = MS_TOKENIZE_URL_STRING;
else
msyystate = MS_TOKENIZE_STRING;
msyystate = MS_TOKENIZE_STRING;
msyystring = string;
msyylex(); /* sets things up, but doesn't process any tokens */
......@@ -3638,6 +3642,7 @@ static void writeClass(FILE *stream, int indent, classObj *class)
writeString(stream, indent, "TEMPLATE", NULL, class->template);
writeExpression(stream, indent, "TEXT", &(class->text));
writeString(stream, indent, "TITLE", NULL, class->title);
writeHashTable(stream, indent, "VALIDATION", &(class->validation));
writeBlockEnd(stream, indent, "CLASS");
}
......@@ -4344,7 +4349,7 @@ static void writeLayer(FILE *stream, int indent, layerObj *layer)
writeString(stream, indent, "CLASSITEM", NULL, layer->classitem);
writeCluster(stream, indent, &(layer->cluster));
writeString(stream, indent, "CONNECTION", NULL, layer->connection);
writeKeyword(stream, indent, "CONNECTIONTYPE", layer->connectiontype, 10, MS_SDE, "SDE", MS_OGR, "OGR", MS_POSTGIS, "POSTGIS", MS_WMS, "WMS", MS_ORACLESPATIAL, "ORACLESPATIAL", MS_WFS, "WFS", MS_GRATICULE, "GRATICULE", MS_PLUGIN, "PLUGIN", MS_UNION, "UNION", MS_UVRASTER, "UVRASTER");
writeKeyword(stream, indent, "CONNECTIONTYPE", layer->connectiontype, 9, MS_SDE, "SDE", MS_OGR, "OGR", MS_POSTGIS, "POSTGIS", MS_WMS, "WMS", MS_ORACLESPATIAL, "ORACLESPATIAL", MS_WFS, "WFS", MS_PLUGIN, "PLUGIN", MS_UNION, "UNION", MS_UVRASTER, "UVRASTER");
writeString(stream, indent, "DATA", NULL, layer->data);
writeNumber(stream, indent, "DEBUG", 0, layer->debug); /* is this right? see loadLayer() */
writeExtent(stream, indent, "EXTENT", layer->extent);
......@@ -5428,6 +5433,7 @@ int initMap(mapObj *map)
msInitSymbolSet(&map->symbolset);
map->symbolset.fontset = &(map->fontset);
map->symbolset.map = map;
initLegend(&map->legend);
initScalebar(&map->scalebar);
......@@ -5939,6 +5945,10 @@ mapObj *msLoadMapFromString(char *buffer, char *new_mappath)
if(mappath != NULL) free(mappath);
return NULL;
}
if (mappath != NULL) free(mappath);
msyylex_destroy();
msReleaseLock( TLOCK_PARSER );
if (debuglevel >= MS_DEBUGLEVEL_TUNING) {
......@@ -5949,9 +5959,6 @@ mapObj *msLoadMapFromString(char *buffer, char *new_mappath)
(starttime.tv_sec+starttime.tv_usec/1.0e6) );
}
if (mappath != NULL) free(mappath);
msyylex_destroy();
if (resolveSymbolNames(map) == MS_FAILURE) return NULL;
return map;
......@@ -6186,17 +6193,25 @@ int msUpdateMapFromURL(mapObj *map, char *variable, char *string)
if(msLookupHashTable(&(GET_LAYER(map, i)->class[j]->validation), "immutable"))
return(MS_SUCCESS); /* fail silently */
if(msyylex() == STYLE) {
if(getInteger(&k) == -1) return MS_FAILURE;
if(k>=GET_LAYER(map, i)->class[j]->numstyles || k<0) {
msSetError(MS_MISCERR, "Style to be modified not valid.", "msUpdateMapFromURL()");
return MS_FAILURE;
}
if(msUpdateStyleFromString((GET_LAYER(map, i))->class[j]->styles[k], string, MS_TRUE) != MS_SUCCESS) return MS_FAILURE;
} else {
if(msUpdateClassFromString((GET_LAYER(map, i))->class[j], string, MS_TRUE) != MS_SUCCESS) return MS_FAILURE;
switch(msyylex()) {
case STYLE:
if(getInteger(&k) == -1) return MS_FAILURE;
if(k>=GET_LAYER(map, i)->class[j]->numstyles || k<0) {
msSetError(MS_MISCERR, "Style to be modified not valid.", "msUpdateMapFromURL()");
return MS_FAILURE;
}
if(msUpdateStyleFromString((GET_LAYER(map, i))->class[j]->styles[k], string, MS_TRUE) != MS_SUCCESS) return MS_FAILURE;
break;
case LABEL:
if(getInteger(&k) == -1) return MS_FAILURE;
if(k>=GET_LAYER(map, i)->class[j]->numlabels || k<0) {
msSetError(MS_MISCERR, "Label to be modified not valid.", "msUpdateMapFromURL()");
return MS_FAILURE;
}
if(msUpdateLabelFromString((GET_LAYER(map, i))->class[j]->labels[k], string, MS_TRUE) != MS_SUCCESS) return MS_FAILURE;
break;
default:
if(msUpdateClassFromString((GET_LAYER(map, i))->class[j], string, MS_TRUE) != MS_SUCCESS) return MS_FAILURE;
}
} else {
if(msUpdateLayerFromString((GET_LAYER(map, i)), string, MS_TRUE) != MS_SUCCESS) return MS_FAILURE;
......@@ -6398,8 +6413,10 @@ void msApplyDefaultSubstitutions(mapObj *map)
for(i=0; i<map->numlayers; i++) {
layerObj *layer = GET_LAYER(map, i);
applyLayerDefaultSubstitutions(layer, &(layer->validation));
applyLayerDefaultSubstitutions(layer, &(layer->validation)); /* layer settings take precedence */
applyLayerDefaultSubstitutions(layer, &(layer->metadata));
applyLayerDefaultSubstitutions(layer, &(map->web.validation));
applyLayerDefaultSubstitutions(layer, &(map->web.metadata));
}
}
......
......@@ -35,6 +35,11 @@ extern int yyparse(parseObj *p);
void msStyleSetGeomTransform(styleObj *s, char *transform)
{
msFree(s->_geomtransform.string);
if (!transform) {
s->_geomtransform.type = MS_GEOMTRANSFORM_NONE;
s->_geomtransform.string = NULL;
return;
}
s->_geomtransform.string = msStrdup(transform);
if(!strncasecmp("start",transform,5)) {
s->_geomtransform.type = MS_GEOMTRANSFORM_START;
......
......@@ -569,11 +569,38 @@ shapeObj *msGEOSGeometry2Shape(GEOSGeom g)
case GEOS_MULTIPOLYGON:
return msGEOSGeometry2Shape_multipolygon(g);
break;
default:
case GEOS_GEOMETRYCOLLECTION:
if (!GEOSisEmpty(g))
msSetError(MS_GEOSERR, "Unsupported GEOS geometry type (%d).", "msGEOSGeometry2Shape()", type);
return NULL;
{
int i, j, numGeoms;
shapeObj* shape;
numGeoms = GEOSGetNumGeometries(g);
shape = (shapeObj *) malloc(sizeof(shapeObj));
msInitShape(shape);
shape->type = MS_SHAPE_LINE;
shape->geometry = (GEOSGeom) g;
numGeoms = GEOSGetNumGeometries(g);
for(i = 0; i < numGeoms; i++) { /* for each geometry */
shapeObj* shape2 = msGEOSGeometry2Shape((GEOSGeom)GEOSGetGeometryN(g, i));
if (shape2) {
for (j = 0; j < shape2->numlines; j++)
msAddLineDirectly(shape, &shape2->line[j]);
shape2->numlines = 0;
shape2->geometry = NULL; /* not owned */
msFreeShape(shape2);
}
}
msComputeBounds(shape);
return shape;
}
break;
default:
msSetError(MS_GEOSERR, "Unsupported GEOS geometry type (%d).", "msGEOSGeometry2Shape()", type);
}
return NULL;
}
#endif
......
......@@ -702,11 +702,24 @@ int msLayerGetFeatureStyle(mapObj *map, layerObj *layer, classObj *c, shapeObj*
/* try to find out the current style format */
if (strncasecmp(stylestring,"style",5) == 0) {
resetClassStyle(c);
c->layer = layer;
if (msMaybeAllocateClassStyle(c, 0))
return(MS_FAILURE);
msUpdateStyleFromString(c->styles[0], stylestring, MS_FALSE);
if(c->styles[0]->symbolname) {
if((c->styles[0]->symbol = msGetSymbolIndex(&(map->symbolset), c->styles[0]->symbolname, MS_TRUE)) == -1) {
msSetError(MS_MISCERR, "Undefined symbol \"%s\" in class of layer %s.", "msLayerGetFeatureStyle()",
c->styles[0]->symbolname, layer->name);
return MS_FAILURE;
}
}
} else if (strncasecmp(stylestring,"class",5) == 0) {
if (strcasestr(stylestring, " style ") != NULL) {
/* reset style if stylestring contains style definitions */
resetClassStyle(c);
c->layer = layer;
}
msUpdateClassFromString(c, stylestring, MS_FALSE);
} else if (strncasecmp(stylestring,"pen",3) == 0 || strncasecmp(stylestring,"brush",5) == 0 ||
strncasecmp(stylestring,"symbol",6) == 0 || strncasecmp(stylestring,"label",5) == 0) {
......@@ -880,7 +893,7 @@ makeTimeFilter(layerObj *lp,
if (&lp->filter) {
/* if the filter is set and it's a sting type, concatenate it with
the time. If not just free it */
if (lp->filter.type == MS_EXPRESSION) {
if (lp->filter.string && lp->filter.type == MS_STRING) {
pszBuffer = msStringConcatenate(pszBuffer, "((");
pszBuffer = msStringConcatenate(pszBuffer, lp->filter.string);
pszBuffer = msStringConcatenate(pszBuffer, ") and ");
......@@ -917,7 +930,7 @@ makeTimeFilter(layerObj *lp,
pszBuffer = msStringConcatenate(pszBuffer, ")");
/* if there was a filter, It was concatenate with an And ans should be closed*/
if(&lp->filter && lp->filter.type == MS_EXPRESSION) {
if(&lp->filter && lp->filter.string && lp->filter.type == MS_STRING) {
pszBuffer = msStringConcatenate(pszBuffer, ")");
}
......@@ -934,7 +947,7 @@ makeTimeFilter(layerObj *lp,
return MS_FALSE;
if (numtimes >= 1) {
if (&lp->filter && lp->filter.type == MS_EXPRESSION) {
if (&lp->filter && lp->filter.string && lp->filter.type == MS_STRING) {
pszBuffer = msStringConcatenate(pszBuffer, "((");
pszBuffer = msStringConcatenate(pszBuffer, lp->filter.string);
pszBuffer = msStringConcatenate(pszBuffer, ") and ");
......@@ -1057,7 +1070,7 @@ makeTimeFilter(layerObj *lp,
/* load the string to the filter */
if (pszBuffer && strlen(pszBuffer) > 0) {
if(&lp->filter && lp->filter.type == MS_EXPRESSION)
if(&lp->filter && lp->filter.string && lp->filter.type == MS_STRING)
pszBuffer = msStringConcatenate(pszBuffer, ")");
/*
if(lp->filteritem)
......
......@@ -208,7 +208,11 @@ int msDrawLegendIcon(mapObj *map, layerObj *lp, classObj *theclass,
offset = 1;
/* To set the offset, we only check the size/width parameter of the first style */
if (theclass->numstyles > 0) {
offset = (theclass->styles[0]->size != -1) ? theclass->styles[0]->size/2 : theclass->styles[0]->width/2;
if (theclass->styles[0]->symbol > 0 && theclass->styles[0]->symbol < map->symbolset.numsymbols &&
map->symbolset.symbol[theclass->styles[0]->symbol]->type != MS_SYMBOL_SIMPLE)
offset = theclass->styles[0]->size/2;
else
offset = theclass->styles[0]->width/2;
}
zigzag.line = (lineObj *)msSmallMalloc(sizeof(lineObj));
zigzag.numlines = 1;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -266,7 +266,7 @@ char path[MS_MAXPATHLEN];
<INITIAL,URL_STRING>keyimage { MS_LEXER_RETURN_TOKEN(KEYIMAGE); }
<INITIAL,URL_STRING>keysize { MS_LEXER_RETURN_TOKEN(KEYSIZE); }
<INITIAL>keyspacing { MS_LEXER_RETURN_TOKEN(KEYSPACING); }
<INITIAL,URL_STRING>label { MS_LEXER_RETURN_TOKEN(LABEL); }
<INITIAL,URL_VARIABLE>label { MS_LEXER_RETURN_TOKEN(LABEL); }
<INITIAL>labelcache { MS_LEXER_RETURN_TOKEN(LABELCACHE); }
<INITIAL>labelformat { MS_LEXER_RETURN_TOKEN(LABELFORMAT); }
<INITIAL,URL_STRING>labelitem { MS_LEXER_RETURN_TOKEN(LABELITEM); }
......
......@@ -205,8 +205,10 @@ static int msOGRWriteShape( layerObj *map_layer, OGRLayerH hOGRLayer,
OGRErr eErr;
int i, out_field;
OGRwkbGeometryType eLayerGType, eFeatureGType = wkbUnknown;
OGRFeatureDefnH hLayerDefn;
eLayerGType = OGR_FD_GetGeomType(OGR_L_GetLayerDefn(hOGRLayer));
hLayerDefn = OGR_L_GetLayerDefn( hOGRLayer );
eLayerGType = OGR_FD_GetGeomType(hLayerDefn);
/* -------------------------------------------------------------------- */
/* Transform point geometry. */
......@@ -380,7 +382,7 @@ static int msOGRWriteShape( layerObj *map_layer, OGRLayerH hOGRLayer,
/* doesn't match the layer. */
/* -------------------------------------------------------------------- */
eLayerGType =
wkbFlatten(OGR_FD_GetGeomType(OGR_L_GetLayerDefn(hOGRLayer)));
wkbFlatten(OGR_FD_GetGeomType(hLayerDefn));
if( hGeom != NULL )
eFeatureGType = wkbFlatten(OGR_G_GetGeometryType( hGeom ));
......@@ -413,7 +415,7 @@ static int msOGRWriteShape( layerObj *map_layer, OGRLayerH hOGRLayer,
/* Consider flattening the geometry to 2D if we want 2D */
/* output. */
/* -------------------------------------------------------------------- */
eLayerGType = OGR_FD_GetGeomType(OGR_L_GetLayerDefn(hOGRLayer));
eLayerGType = OGR_FD_GetGeomType(hLayerDefn);
if( hGeom != NULL )
eFeatureGType = OGR_G_GetGeometryType( hGeom );
......@@ -426,7 +428,7 @@ static int msOGRWriteShape( layerObj *map_layer, OGRLayerH hOGRLayer,
/* -------------------------------------------------------------------- */
/* Create the feature, and attach the geometry. */
/* -------------------------------------------------------------------- */
hFeat = OGR_F_Create( OGR_L_GetLayerDefn( hOGRLayer ) );
hFeat = OGR_F_Create( hLayerDefn );
OGR_F_SetGeometryDirectly( hFeat, hGeom );
......@@ -440,6 +442,18 @@ static int msOGRWriteShape( layerObj *map_layer, OGRLayerH hOGRLayer,
if( !item->visible )
continue;
/* Avoid setting empty strings for numeric fields, so that OGR */
/* doesn't take them as 0. (#4633) */
if( shape->values[i][0] == '\0' ) {
OGRFieldDefnH hFieldDefn = OGR_FD_GetFieldDefn(hLayerDefn, out_field);
OGRFieldType eFieldType = OGR_Fld_GetType(hFieldDefn);
if( eFieldType == OFTInteger || eFieldType == OFTReal )
{
out_field++;
continue;
}
}
OGR_F_SetFieldString( hFeat, out_field++, shape->values[i] );
}
......
......@@ -2153,15 +2153,14 @@ int msOracleSpatialLayerNextShape( layerObj *layer, shapeObj *shape )
&& TRY( hand, OCIAttrGet( (dvoid *)sthand->stmthp, (ub4)OCI_HTYPE_STMT, (dvoid *)&sthand->rows_fetched, (ub4 *)0, (ub4)OCI_ATTR_ROWS_FETCHED, hand->errhp ) )
&& TRY( hand, OCIAttrGet( (dvoid *)sthand->stmthp, (ub4)OCI_HTYPE_STMT, (dvoid *)&sthand->rows_count, (ub4 *)0, (ub4)OCI_ATTR_ROW_COUNT, hand->errhp ) );
if (!success || sthand->rows_fetched == 0 || sthand->row_num >= sthand->rows_count) {
hand->last_oci_status=MS_SUCCESS;
return MS_DONE;
}
if(layer->debug >= 4 )
msDebug("msOracleSpatialLayerNextShape on layer %p, Fetched %d more rows (%d total)\n", layer, sthand->rows_fetched, sthand->rows_count);
if (sthand->row_num >= sthand->rows_count)
return MS_DONE;
if (!success || sthand->rows_fetched == 0)
return MS_DONE;
sthand->row = 0; /* reset buffer row index */
}
......@@ -3156,11 +3155,10 @@ int msOracleSpatialLayerGetExtent(layerObj *layer, rectObj *extent)
success = TRY( hand, OCIStmtFetch( sthand->stmthp, hand->errhp, (ub4)ARRAY_SIZE, (ub2)OCI_FETCH_NEXT, (ub4)OCI_DEFAULT ) )
&& TRY( hand, OCIAttrGet( (dvoid *)sthand->stmthp, (ub4)OCI_HTYPE_STMT, (dvoid *)&sthand->rows_fetched, (ub4 *)0, (ub4)OCI_ATTR_ROW_COUNT, hand->errhp ) );
if (!success || sthand->rows_fetched == 0)
break;
if (sthand->row_num >= sthand->rows_fetched)
if (!success || sthand->rows_fetched == 0 || sthand->row_num >= sthand->rows_fetched) {
hand->last_oci_status=MS_SUCCESS;
break;
}
sthand->row = 0; /* reset row index */
}
......
......@@ -95,7 +95,7 @@ static int msOWSPreParseRequest(cgiRequestObj *request,
owsRequestObj *ows_request)
{
/* decide if KVP or XML */
if (request->type == MS_GET_REQUEST) {
if (request->type == MS_GET_REQUEST || (request->type == MS_POST_REQUEST && strcmp(request->contenttype, "application/x-www-form-urlencoded")==0)) {
int i;
/* parse KVP parameters service, version and request */
for (i = 0; i < request->NumParams; ++i) {
......@@ -326,7 +326,7 @@ int msOWSRequestIsEnabled(mapObj *map, layerObj *layer,
if (disabled) return MS_FALSE;
}
if (map && (map->numlayers > 0) && check_all_layers == MS_TRUE) {
if (map && check_all_layers == MS_TRUE) {
int i, globally_enabled = MS_FALSE;
enable_request = msOWSLookupMetadata(&map->web.metadata, namespaces, "enable_request");
globally_enabled = msOWSParseRequestMetadata(enable_request, request, &disabled);
......@@ -357,6 +357,9 @@ int msOWSRequestIsEnabled(mapObj *map, layerObj *layer,
if (result || (!disabled && globally_enabled))
return MS_TRUE;
}
if (!disabled && globally_enabled)
return MS_TRUE;
}
return MS_FALSE;
......
......@@ -380,6 +380,32 @@ DllExport void SWIGSTDCALL SWIGRegisterByteArrayCallback_$module(SWIG_CSharpByte
#endif
%}
/* Typemaps for pattern array */
%typemap(imtype) (double pattern[ANY]) "IntPtr"
%typemap(cstype) (double pattern[ANY]) "double[]"
%typemap(in) (double pattern[ANY]) %{ $1 = ($1_ltype)$input; %}
%typemap(csin) (double pattern[ANY]) "$csinput"
%typemap(csvarout, excode=SWIGEXCODE2) (double pattern[ANY]) %{
get {
IntPtr cPtr = $imcall;
double[] ret = new double[patternlength];
if (patternlength > 0) {
System.Runtime.InteropServices.Marshal.Copy(cPtr, ret, 0, patternlength);
}
$excode
return ret;
}
set {
IntPtr cPtr = $imcall;
if (value.Length > 0) {
System.Runtime.InteropServices.Marshal.Copy(value, 0, cPtr, value.Length);
}
patternlength = value.Length;
$excode
}
%}
%typemap(csvarin, excode="") (double pattern[ANY]) %{$excode%}
/* Typemaps for device handle */
%typemap(imtype) (void* device) %{IntPtr%}
%typemap(cstype) (void* device) %{IntPtr%}
......
......@@ -48,7 +48,7 @@ public class mapscript {
public static mapObj msLoadMapFromString(string buffer, string new_mappath) {
IntPtr cPtr = mapscriptPINVOKE.msLoadMapFromString(buffer, new_mappath);
mapObj ret = (cPtr == IntPtr.Zero) ? null : new mapObj(cPtr, false, ThisOwn_false());
mapObj ret = (cPtr == IntPtr.Zero) ? null : new mapObj(cPtr, true, ThisOwn_true());
if (mapscriptPINVOKE.SWIGPendingException.Pending) throw mapscriptPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
......
......@@ -816,7 +816,7 @@ class mapscriptPINVOKE {
public static extern int styleObj_patternlength_get(HandleRef jarg1);
[DllImport("mapscript", EntryPoint="CSharp_styleObj_pattern_set")]
public static extern void styleObj_pattern_set(HandleRef jarg1, HandleRef jarg2);
public static extern void styleObj_pattern_set(HandleRef jarg1, IntPtr jarg2);
[DllImport("mapscript", EntryPoint="CSharp_styleObj_pattern_get")]
public static extern IntPtr styleObj_pattern_get(HandleRef jarg1);
......@@ -2805,7 +2805,7 @@ class mapscriptPINVOKE {
public static extern int strokeStyleObj_patternlength_get(HandleRef jarg1);
[DllImport("mapscript", EntryPoint="CSharp_strokeStyleObj_pattern_set")]
public static extern void strokeStyleObj_pattern_set(HandleRef jarg1, HandleRef jarg2);
public static extern void strokeStyleObj_pattern_set(HandleRef jarg1, IntPtr jarg2);
[DllImport("mapscript", EntryPoint="CSharp_strokeStyleObj_pattern_get")]
public static extern IntPtr strokeStyleObj_pattern_get(HandleRef jarg1);
......
......@@ -608,7 +608,7 @@ SWIGINTERN void delete_labelObj(labelObj *self){
freeLabel(self);
}
SWIGINTERN int labelObj_updateFromString(labelObj *self,char *snippet){
return msUpdateLabelFromString(self, snippet);
return msUpdateLabelFromString(self, snippet,0);
}
SWIGINTERN int labelObj_removeBinding(labelObj *self,int binding){
if(binding < 0 || binding >= 9) return MS_FAILURE;
......@@ -2394,8 +2394,11 @@ SWIGINTERN int rectObj_draw(rectObj *self,mapObj *map,layerObj *layer,imageObj *
msInitShape(&shape);
msRectToPolygon(*self, &shape);
shape.classindex = classindex;
shape.text = strdup(text);
if(text && layer->class[classindex]->numlabels > 0) {
shape.text = strdup(text);
msShapeGetAnnotation(layer,&shape);
}
msDrawShape(map, layer, &shape, image, -1, MS_DRAWMODE_FEATURES|MS_DRAWMODE_LABELS);
msFreeShape(&shape);
......@@ -3350,7 +3353,7 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_MS_VERSION_get() {
char * jresult ;
char *result = 0 ;
result = (char *) "6.2.0";
result = (char *) "6.2.1";
jresult = SWIG_csharp_string_callback((const char *)result);
return jresult;
}
......@@ -3380,7 +3383,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MS_VERSION_REV_get() {
int jresult ;
int result;
result = (int) 0;
result = (int) 1;
jresult = result;
return jresult;
}
......@@ -3390,7 +3393,7 @@ SWIGEXPORT int SWIGSTDCALL CSharp_MS_VERSION_NUM_get() {
int jresult ;
int result;
result = (int) (6*10000+2*100+0);
result = (int) (6*10000+2*100+1);
jresult = result;
return jresult;
}
......
......@@ -103,17 +103,27 @@ public class strokeStyleObj : IDisposable {
}
}
public SWIGTYPE_p_double pattern {
set {
mapscriptPINVOKE.strokeStyleObj_pattern_set(swigCPtr, SWIGTYPE_p_double.getCPtr(value));
if (mapscriptPINVOKE.SWIGPendingException.Pending) throw mapscriptPINVOKE.SWIGPendingException.Retrieve();
}
public double[] pattern {
get {
IntPtr cPtr = mapscriptPINVOKE.strokeStyleObj_pattern_get(swigCPtr);
SWIGTYPE_p_double ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_double(cPtr, false, ThisOwn_false());
double[] ret = new double[patternlength];
if (patternlength > 0) {
System.Runtime.InteropServices.Marshal.Copy(cPtr, ret, 0, patternlength);
}
if (mapscriptPINVOKE.SWIGPendingException.Pending) throw mapscriptPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
set {
IntPtr cPtr = mapscriptPINVOKE.strokeStyleObj_pattern_get(swigCPtr);
if (value.Length > 0) {
System.Runtime.InteropServices.Marshal.Copy(value, 0, cPtr, value.Length);
}