Commit 7bf4afe5 authored by Bas Couwenberg's avatar Bas Couwenberg

Imported Upstream version 7.0.3

parent 6ff28f09
......@@ -17,7 +17,7 @@ include(CheckCSourceCompiles)
set (MapServer_VERSION_MAJOR 7)
set (MapServer_VERSION_MINOR 0)
set (MapServer_VERSION_REVISION 2)
set (MapServer_VERSION_REVISION 3)
set (MapServer_VERSION_SUFFIX "")
set(TARGET_VERSION_MAJOR ${MapServer_VERSION_MAJOR})
......@@ -857,7 +857,7 @@ ms_link_libraries( ${CMAKE_DL_LIBS} m )
endif(UNIX)
if (WIN32)
ms_link_libraries( ${MS_EXTERNAL_LIBS})
ms_link_libraries( ${MS_EXTERNAL_LIBS} ws2_32.lib)
endif (WIN32)
configure_file (
......
......@@ -67,7 +67,8 @@ License
::
Copyright (c) 1996-2007 Regents of the University of Minnesota.
Copyright (c) 2008-2016 Open Source Geospatial Foundation.
Copyright (c) 1996-2008 Regents of the University of Minnesota.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -9,7 +9,7 @@ IMPORTANT - READ THIS FIRST:
So it is strongly recommended that you use one of the precompiled
binaries available on the MapServer site:
http://mapserver.gis.umn.edu/download/current/windows
http://www.mapserver.org/download.html#windows
There are precompiled Win32 binaries available for the last stable
release and the latest nightly build and they include the most common
......
......@@ -48,7 +48,7 @@ if(WIN32)
find_file(ICONV_DLL
NAMES ${ICONV_DLL_NAMES}
PATHS ENV PATH
NO_DEFAULT_PATH)
${ICONV_INCLUDE_DIR}/../bin)
find_file(ICONV_DLL_HELP
NAMES ${ICONV_DLL_NAMES}
PATHS ENV PATH
......
......@@ -17,22 +17,31 @@ SET(PHP5_POSSIBLE_INCLUDE_PATHS
/usr/include/php
/usr/local/include/php
/usr/local/apache/php
${PHP5_INCLUDES}
)
SET(PHP5_POSSIBLE_LIB_PATHS
/usr/lib
if(WIN32)
${PHP5_INCLUDES}/Release_TS
endif(WIN32)
)
#FIND_PATH(PHP5_FOUND_INCLUDE_PATH main/php.h
# ${PHP5_POSSIBLE_INCLUDE_PATHS})
#
#IF(PHP5_FOUND_INCLUDE_PATH)
# SET(php5_paths "${PHP5_POSSIBLE_INCLUDE_PATHS}")
# FOREACH(php5_path Zend main TSRM)
# SET(php5_paths ${php5_paths} "${PHP5_FOUND_INCLUDE_PATH}/${php5_path}")
# ENDFOREACH(php5_path Zend main TSRM)
# SET(PHP5_INCLUDE_PATH "${php5_paths}" INTERNAL "PHP5 include paths")
#ENDIF(PHP5_FOUND_INCLUDE_PATH)
find_library(PHP5_LIBRARY
NAMES php5ts.lib
PATHS /sw /opt/local ${PHP5_INCLUDES}/Release_TS
)
FIND_PATH(PHP5_FOUND_INCLUDE_PATH main/php.h
${PHP5_POSSIBLE_INCLUDE_PATHS})
IF(PHP5_FOUND_INCLUDE_PATH)
SET(php5_paths "${PHP5_POSSIBLE_INCLUDE_PATHS}")
FOREACH(php5_path Zend main TSRM)
SET(php5_paths ${php5_paths} "${PHP5_FOUND_INCLUDE_PATH}/${php5_path}")
ENDFOREACH(php5_path Zend main TSRM)
SET(PHP5_INCLUDE_PATH "${php5_paths}" INTERNAL "PHP5 include paths")
ENDIF(PHP5_FOUND_INCLUDE_PATH)
FIND_PROGRAM(PHP5_EXECUTABLE
NAMES php5 php
......
......@@ -273,11 +273,17 @@ outline_element* msGetGlyphOutline(face_element *face, glyph_element *glyph) {
key.glyph = glyph;
UT_HASH_FIND(hh,face->outline_cache,&key, sizeof(outline_element_key),oc);
if(!oc) {
FT_Matrix matrix;
FT_Vector pen;
FT_Error error;
oc = msSmallMalloc(sizeof(outline_element));
if(MS_NINT(glyph->key.size * 96.0/72.0) != face->face->size->metrics.x_ppem) {
FT_Set_Pixel_Sizes(face->face,0,MS_NINT(glyph->key.size * 96/72.0));
}
matrix.xx = matrix.yy = 0x10000L;
matrix.xy = matrix.yx = 0x00000L;
pen.x = pen.y = 0;
FT_Set_Transform(face->face, &matrix, &pen);
error = FT_Load_Glyph(face->face,glyph->key.codepoint,FT_LOAD_DEFAULT/*|FT_LOAD_IGNORE_TRANSFORM*/|FT_LOAD_NO_HINTING|FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
if(error) {
msSetError(MS_MISCERR, "unable to load glyph %ud for font \"%s\"", "msGetGlyphByIndex()",glyph->key.codepoint, face->font);
......
......@@ -65,6 +65,13 @@ void msLayerFreeItemInfo(layerObj *layer)
return;
}
layer->vtable->LayerFreeItemInfo(layer);
/*
* Layer expressions with attribute binding hold a numeric index pointing
* to an iteminfo (node->tokenval.bindval.index). If iteminfo changes,
* an expression may be no longer valid. (#5161)
*/
msLayerFreeExpressions(layer);
}
int msLayerRestoreFromScaletokens(layerObj *layer)
......@@ -415,8 +422,6 @@ int msLayerGetShape(layerObj *layer, shapeObj *shape, resultObj *record)
*/
void msLayerClose(layerObj *layer)
{
int i,j,k;
/* no need for items once the layer is closed */
msLayerFreeItemInfo(layer);
if(layer->items) {
......@@ -426,6 +431,21 @@ void msLayerClose(layerObj *layer)
}
/* clear out items used as part of expressions (bug #2702) -- what about the layer filter? */
msLayerFreeExpressions(layer);
if (layer->vtable) {
layer->vtable->LayerClose(layer);
}
msLayerRestoreFromScaletokens(layer);
}
/*
** Clear out items used as part of expressions.
*/
void msLayerFreeExpressions(layerObj *layer)
{
int i,j,k;
msFreeExpressionTokens(&(layer->filter));
msFreeExpressionTokens(&(layer->cluster.group));
msFreeExpressionTokens(&(layer->cluster.filter));
......@@ -439,11 +459,6 @@ void msLayerClose(layerObj *layer)
msFreeExpressionTokens(&(layer->class[i]->labels[k]->text));
}
}
if (layer->vtable) {
layer->vtable->LayerClose(layer);
}
msLayerRestoreFromScaletokens(layer);
}
/*
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -354,7 +354,7 @@ char path[MS_MAXPATHLEN];
<INITIAL>partials { MS_LEXER_RETURN_TOKEN(PARTIALS); }
<INITIAL,URL_STRING>pattern { MS_LEXER_RETURN_TOKEN(PATTERN); }
<INITIAL,URL_STRING>points { MS_LEXER_RETURN_TOKEN(POINTS); }
<INITIAL>items { MS_LEXER_RETURN_TOKEN(ITEMS); }
<INITIAL,URL_STRING>items { MS_LEXER_RETURN_TOKEN(ITEMS); }
<INITIAL,URL_STRING>position { MS_LEXER_RETURN_TOKEN(POSITION); }
<INITIAL>postlabelcache { MS_LEXER_RETURN_TOKEN(POSTLABELCACHE); }
<INITIAL>priority { MS_LEXER_RETURN_TOKEN(PRIORITY); }
......
This diff is collapsed.
......@@ -667,9 +667,19 @@ int FLTLayerApplyPlainFilterToLayer(FilterEncodingNode *psNode, mapObj *map,
pszExpression = FLTGetCommonExpression(psNode, lp);
if (pszExpression) {
const char* pszUseDefaultExtent;
FilterEncodingNode* psTopBBOX;
rectObj rect = map->extent;
pszUseDefaultExtent = msOWSLookupMetadata(&(lp->metadata), "F",
"use_default_extent_for_getfeature");
if( pszUseDefaultExtent && CSLTestBoolean(pszUseDefaultExtent) &&
lp->connectiontype == MS_OGR )
{
const rectObj rectInvalid = MS_INIT_INVALID_RECT;
rect = rectInvalid;
}
psTopBBOX = FLTGetTopBBOX(psNode);
if( psTopBBOX )
{
......@@ -706,9 +716,9 @@ int FLTLayerApplyPlainFilterToLayer(FilterEncodingNode *psNode, mapObj *map,
if(map->debug == MS_DEBUGLEVEL_VVV)
{
if( pszExpression )
msDebug("FLTLayerApplyPlainFilterToLayer(): %s, rect=%f,%f,%f,%f\n", pszExpression, rect.minx, rect.miny, rect.maxx, rect.maxy);
msDebug("FLTLayerApplyPlainFilterToLayer(): %s, rect=%.15g,%.15g,%.15g,%.15g\n", pszExpression, rect.minx, rect.miny, rect.maxx, rect.maxy);
else
msDebug("FLTLayerApplyPlainFilterToLayer(): rect=%f,%f,%f,%f\n", rect.minx, rect.miny, rect.maxx, rect.maxy);
msDebug("FLTLayerApplyPlainFilterToLayer(): rect=%.15g,%.15g,%.15g,%.15g\n", rect.minx, rect.miny, rect.maxx, rect.maxy);
}
status = FLTApplyFilterToLayerCommonExpressionWithRect(map, iLayerIndex,
......@@ -3667,6 +3677,57 @@ int FLTCheckInvalidOperand(FilterEncodingNode *psFilterNode)
return status;
}
/************************************************************************/
/* FLTProcessPropertyIsNull */
/* */
/* HACK for PropertyIsNull processing. PostGIS & Spatialite only */
/* for now. */
/************************************************************************/
int FLTProcessPropertyIsNull(FilterEncodingNode *psFilterNode,
mapObj *map, int i)
{
int status = MS_SUCCESS;
if (psFilterNode->eType == FILTER_NODE_TYPE_COMPARISON &&
psFilterNode->psLeftNode != NULL &&
psFilterNode->psLeftNode->eType == FILTER_NODE_TYPE_PROPERTYNAME &&
strcmp(psFilterNode->pszValue, "PropertyIsNull") == 0 &&
!FLTIsGMLDefaultProperty(psFilterNode->psLeftNode->pszValue) )
{
layerObj* lp;
int layerWasOpened;
lp = GET_LAYER(map, i);
layerWasOpened = msLayerIsOpen(lp);
/* Horrible HACK to compensate for the lack of null testing in MapServer */
if( (lp->connectiontype == MS_POSTGIS ||
(lp->connectiontype == MS_OGR && msOGRIsSpatialite(lp))) &&
strcmp(psFilterNode->pszValue, "PropertyIsNull") == 0 )
{
msFree(psFilterNode->pszValue);
psFilterNode->pszValue = msStrdup("PropertyIsEqualTo");
psFilterNode->psRightNode = FLTCreateBinaryCompFilterEncodingNode();
psFilterNode->psRightNode->eType = FILTER_NODE_TYPE_LITERAL;
psFilterNode->psRightNode->pszValue = msStrdup("_MAPSERVER_NULL_");
}
if (!layerWasOpened) /* do not close the layer if it has been opened somewhere else (paging?) */
msLayerClose(lp);
}
if (psFilterNode->psLeftNode)
{
status = FLTProcessPropertyIsNull(psFilterNode->psLeftNode, map, i);
if( status == MS_SUCCESS )
{
if (psFilterNode->psRightNode)
status = FLTProcessPropertyIsNull(psFilterNode->psRightNode, map, i);
}
}
return status;
}
/************************************************************************/
/* FLTCheckInvalidProperty */
/* */
......
......@@ -149,6 +149,8 @@ int FLTCheckInvalidProperty(FilterEncodingNode *psFilterNode,
FilterEncodingNode* FLTSimplify(FilterEncodingNode *psFilterNode,
int* pnEvaluation);
int FLTApplyFilterToLayerCommonExpressionWithRect(mapObj *map, int iLayerIndex, const char *pszExpression, rectObj rect);
int FLTProcessPropertyIsNull(FilterEncodingNode *psFilterNode,
mapObj *map, int i);
#endif
......
......@@ -68,7 +68,7 @@ char *FLTGetIsLikeComparisonCommonExpression(FilterEncodingNode *psFilterNode)
/* Use operand with regular expressions. */
/* -------------------------------------------------------------------- */
szBuffer[0] = '\0';
sprintf(szTmp, "%s", " (\"[");
sprintf(szTmp, "%s", "(\"[");
szTmp[4] = '\0';
strlcat(szBuffer, szTmp, bufferSize);
......@@ -174,9 +174,9 @@ char *FLTGetIsBetweenComparisonCommonExpresssion(FilterEncodingNode *psFilterNod
/* -------------------------------------------------------------------- */
/* attribute */
if (bString)
sprintf(szBuffer, "%s", " (\"[");
sprintf(szBuffer, "%s", "(\"[");
else
sprintf(szBuffer, "%s", " ([");
sprintf(szBuffer, "%s", "([");
pszExpression = msStringConcatenate(pszExpression, szBuffer);
pszExpression = msStringConcatenate(pszExpression, psFilterNode->psLeftNode->pszValue);
......@@ -288,9 +288,9 @@ char *FLTGetBinaryComparisonCommonExpression(FilterEncodingNode *psFilterNode, l
/* attribute */
if (bString)
sprintf(szTmp, "%s", " (\"[");
sprintf(szTmp, "%s", "(\"[");
else
sprintf(szTmp, "%s"," ([");
sprintf(szTmp, "%s","([");
pszExpression = msStringConcatenate(pszExpression, szTmp);
pszExpression = msStringConcatenate(pszExpression, psFilterNode->psLeftNode->pszValue);
......@@ -307,19 +307,20 @@ char *FLTGetBinaryComparisonCommonExpression(FilterEncodingNode *psFilterNode, l
else
sprintf(szTmp, "%s", "=");
} else if (strcasecmp(psFilterNode->pszValue, "PropertyIsNotEqualTo") == 0)
sprintf(szTmp, "%s", " != ");
sprintf(szTmp, "%s", "!=");
else if (strcasecmp(psFilterNode->pszValue, "PropertyIsLessThan") == 0)
sprintf(szTmp, "%s", " < ");
sprintf(szTmp, "%s", "<");
else if (strcasecmp(psFilterNode->pszValue, "PropertyIsGreaterThan") == 0)
sprintf(szTmp, "%s", " > ");
sprintf(szTmp, "%s", ">");
else if (strcasecmp(psFilterNode->pszValue, "PropertyIsLessThanOrEqualTo") == 0)
sprintf(szTmp, "%s", " <= ");
sprintf(szTmp, "%s", "<=");
else if (strcasecmp(psFilterNode->pszValue, "PropertyIsGreaterThanOrEqualTo") == 0)
sprintf(szTmp, "%s", " >= ");
sprintf(szTmp, "%s", ">=");
else if (strcasecmp(psFilterNode->pszValue, "PropertyIsLike") == 0)
sprintf(szTmp, "%s", " ~ ");
sprintf(szTmp, "%s", "~");
pszExpression = msStringConcatenate(pszExpression, szTmp);
pszExpression = msStringConcatenate(pszExpression, " ");
/* value */
if (bString) {
......@@ -356,7 +357,6 @@ char *FLTGetLogicalComparisonCommonExpression(FilterEncodingNode *psFilterNode,
{
char *pszExpression = NULL;
char *pszTmp = NULL;
char szBuffer[256];
if (!psFilterNode || !FLTIsLogicalFilterType(psFilterNode->pszValue))
return NULL;
......@@ -369,17 +369,16 @@ char *FLTGetLogicalComparisonCommonExpression(FilterEncodingNode *psFilterNode,
if (!pszTmp)
return NULL;
sprintf(szBuffer, "%s", " (");
pszExpression = msStringConcatenate(pszExpression, szBuffer);
pszExpression = msStringConcatenate(pszExpression, "(");
pszExpression = msStringConcatenate(pszExpression, pszTmp);
msFree(pszTmp);
sprintf(szBuffer, "%s", " ");
pszExpression = msStringConcatenate(pszExpression, szBuffer);
pszExpression = msStringConcatenate(pszExpression, " ");
pszExpression = msStringConcatenate(pszExpression, psFilterNode->pszValue);
sprintf(szBuffer, "%s", " ");
pszExpression = msStringConcatenate(pszExpression, " ");
pszTmp = FLTGetCommonExpression(psFilterNode->psRightNode, lp);
if (!pszTmp) {
......@@ -390,8 +389,7 @@ char *FLTGetLogicalComparisonCommonExpression(FilterEncodingNode *psFilterNode,
pszExpression = msStringConcatenate(pszExpression, pszTmp);
msFree(pszTmp);
sprintf(szBuffer, "%s", ") ");
pszExpression = msStringConcatenate(pszExpression, szBuffer);
pszExpression = msStringConcatenate(pszExpression, ")");
}
/* -------------------------------------------------------------------- */
/* NOT */
......@@ -401,14 +399,12 @@ char *FLTGetLogicalComparisonCommonExpression(FilterEncodingNode *psFilterNode,
if (!pszTmp)
return NULL;
sprintf(szBuffer, "%s", " (NOT ");
pszExpression = msStringConcatenate(pszExpression, szBuffer);
pszExpression = msStringConcatenate(pszExpression, "(NOT ");
pszExpression = msStringConcatenate(pszExpression, pszTmp);
msFree(pszTmp);
sprintf(szBuffer, "%s", ") ");
pszExpression = msStringConcatenate(pszExpression, szBuffer);
pszExpression = msStringConcatenate(pszExpression, ")");
}
return pszExpression;
......
This diff is collapsed.
......@@ -2452,7 +2452,6 @@ int msPostGISLayerOpen(layerObj *layer)
* times there will be a leak... */
return MS_FAILURE;
}
}
}
......@@ -3454,7 +3453,7 @@ char *msPostGISEscapeSQLParam(layerObj *layer, const char *pszString)
size_t nSrcLen;
char* pszEscapedStr =NULL;
if (layer && pszString && strlen(pszString) > 0) {
if (layer && pszString) {
if(!msPostGISLayerIsOpen(layer))
msPostGISLayerOpen(layer);
......@@ -3752,6 +3751,13 @@ int msPostGISLayerTranslateFilter(layerObj *layer, expressionObj *filter, char *
if(node->token == MS_TOKEN_COMPARISON_EQ && node->next != NULL && node->next->token == MS_TOKEN_LITERAL_TIME) break; /* skip, handled with the next token */
if(bindingToken == MS_TOKEN_BINDING_TIME && (node->token == MS_TOKEN_COMPARISON_EQ || node->token == MS_TOKEN_COMPARISON_NE)) break; /* skip, handled elsewhere */
if(node->token == MS_TOKEN_COMPARISON_EQ && node->next != NULL && node->next->token == MS_TOKEN_LITERAL_STRING &&
strcmp(node->next->tokenval.strval, "_MAPSERVER_NULL_") == 0 )
{
native_string = msStringConcatenate(native_string, " IS NULL");
node = node->next;
break;
}
native_string = msStringConcatenate(native_string, msExpressionTokenToString(node->token));
break;
......
......@@ -670,6 +670,7 @@ int msQueryByFilter(mapObj *map)
expressionObj old_filter;
rectObj search_rect;
const rectObj invalid_rect = MS_INIT_INVALID_RECT;
shapeObj shape;
......@@ -761,9 +762,10 @@ int msQueryByFilter(mapObj *map)
if(status != MS_SUCCESS) goto query_error;
search_rect = map->query.rect;
#ifdef USE_PROJ
lp->project = msProjectionsDiffer(&(lp->projection), &(map->projection));
if(lp->project)
if(lp->project && memcmp( &search_rect, &invalid_rect, sizeof(search_rect) ) != 0 )
msProjectRect(&(map->projection), &(lp->projection), &search_rect); /* project the searchrect to source coords */
#endif
......
......@@ -430,6 +430,12 @@ DllExport void SWIGSTDCALL SWIGRegisterByteArrayCallback_$module(SWIG_CSharpByte
%}
%typemap(csvarin, excode="") (double pattern[ANY]) %{$excode%}
/* Typemaps for int array */
%typemap(imtype, out="IntPtr") int *panIndexes "int[]"
%typemap(cstype) int *panIndexes %{int[]%}
%typemap(in) int *panIndexes %{ $1 = ($1_ltype)$input; %}
%typemap(csin) (int *panIndexes) "$csinput"
/* Typemaps for device handle */
%typemap(imtype) (void* device) %{IntPtr%}
%typemap(cstype) (void* device) %{IntPtr%}
......
FIND_PACKAGE(PHP5 REQUIRED)
INCLUDE_DIRECTORIES(${PHP5_INCLUDES})
INCLUDE_DIRECTORIES(${PHP5_INCLUDE_PATH})
if(WIN32)
add_definitions(/DZEND_WIN32 /DPHP_WIN32 /DPHP5 /DZTS /DZEND_DEBUG=0 -DWIN32 -D_WIN32 -D_USE_32BIT_TIME_T -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
ENDIF(WIN32)
IF(APPLE)
if(XCODE)
......@@ -25,7 +29,11 @@ add_library(php_mapscript MODULE
)
if(WIN32)
target_link_libraries(php_mapscript ${MAPSERVER_LIBMAPSERVER} ${PHP5_LIBRARY})
ELSE(WIN32)
target_link_libraries(php_mapscript ${MAPSERVER_LIBMAPSERVER})
ENDIF(WIN32)
set_target_properties(php_mapscript PROPERTIES PREFIX "")
install(TARGETS php_mapscript DESTINATION ${PHP5_EXTENSION_DIR})
......
......@@ -31,6 +31,17 @@
#include "php_mapscript.h"
#if PHP_VERSION_ID >= 50625
#undef ZVAL_STRING
#define ZVAL_STRING(z, s, duplicate) do { \
const char *__s=(s); \
zval *__z = (z); \
Z_STRLEN_P(__z) = strlen(__s); \
Z_STRVAL_P(__z) = (duplicate?estrndup(__s, Z_STRLEN_P(__z)):(char*)__s);\
Z_TYPE_P(__z) = IS_STRING; \
} while (0)
#endif
zend_class_entry *mapscript_ce_error;
ZEND_BEGIN_ARG_INFO_EX(error___get_args, 0, 0, 1)
......
......@@ -195,6 +195,8 @@ PHP_METHOD(OWSRequestObj, loadParams)
#if PHP_VERSION_ID >= 50600
php_stream *s = php_stream_temp_new();
php_stream *input = php_stream_open_wrapper("php://input", "r", 0, NULL);
char *raw_post_data = NULL;
long raw_post_data_length = 0;
/* php://input does not support stat */
php_stream_copy_to_stream_ex(input, s, -1, NULL);
......@@ -202,9 +204,6 @@ PHP_METHOD(OWSRequestObj, loadParams)
php_stream_rewind(s);
char *raw_post_data = NULL;
long raw_post_data_length = 0;
raw_post_data_length = php_stream_copy_to_mem(s, raw_post_data, -1, 0);
cgirequestObj_loadParams(php_owsrequest->cgirequest, owsrequest_getenv,
......
......@@ -52,7 +52,9 @@ void msCleanupOnSignal( int nInData )
/* from within the signal handler on Unix. So we force output through */
/* normal stdio functions. */
msIO_installHandlers( NULL, NULL, NULL );
#ifndef NDEBUG
msIO_fprintf( stderr, "In msCleanupOnSignal.\n" );
#endif
msCleanup();
exit(0);
}
......
......@@ -259,7 +259,7 @@ extern "C" {
#define MS_URL_LENGTH 1024
#define MS_MAXPATHLEN 1024
#define MS_MAXIMAGESIZE_DEFAULT 2048
#define MS_MAXIMAGESIZE_DEFAULT 4096
#define MS_MAXPROJARGS 20
#define MS_MAXJOINS 20
......@@ -474,7 +474,9 @@ extern "C" {
#define MS_IS_VALID_ARRAY_INDEX(index, size) ((index<0 || index>=size)?MS_FALSE:MS_TRUE)
#define MS_CONVERT_UNIT(src_unit, dst_unit, value) (value * msInchesPerUnit(src_unit,0) / msInchesPerUnit(dst_unit,0))
#define MS_INIT_INVALID_RECT { -1e300, -1e300, 1e300, 1e300 }
#endif
/* General enumerated types - needed by scripts */
......@@ -2410,6 +2412,7 @@ void msPopulateTextSymbolForLabelAndString(textSymbolObj *ts, labelObj *l, char
MS_DLL_EXPORT int msClusterLayerOpen(layerObj *layer); /* in mapcluster.c */
MS_DLL_EXPORT int msLayerIsOpen(layerObj *layer);
MS_DLL_EXPORT void msLayerClose(layerObj *layer);
MS_DLL_EXPORT void msLayerFreeExpressions(layerObj *layer);
MS_DLL_EXPORT int msLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery);
MS_DLL_EXPORT int msLayerGetItemIndex(layerObj *layer, char *item);
MS_DLL_EXPORT int msLayerWhichItems(layerObj *layer, int get_all, const char *metadata);
......@@ -3130,6 +3133,8 @@ shapeObj *msOffsetCurve(shapeObj *p, double offset);
shapeObj *msGEOSOffsetCurve(shapeObj *p, double offset);
#endif
int msOGRIsSpatialite(layerObj* layer);
#endif /* SWIG */
#ifdef __cplusplus
......
......@@ -504,7 +504,13 @@ int utfgridSaveImage(imageObj *img, mapObj *map, FILE *fp, outputFormatObj *form
/* Conversion to UTF-8 encoding */
*stringptr = '\0';
char * utf8;
utf8 = msConvertWideStringToUTF8 (string, "UCS-4LE");
#if defined(_WIN32) && !defined(__CYGWIN__)
const char* encoding = "UCS-2LE";
#else
const char* encoding = "UCS-4LE";
#endif
utf8 = msConvertWideStringToUTF8(string, encoding);
msIO_fprintf(fp,"%s", utf8);
msFree(utf8);
msFree(string);
......
......@@ -37,6 +37,7 @@
/* There is a dependency to GDAL/OGR for the GML driver and MiniXML parser */
#include "cpl_minixml.h"
#include "cpl_conv.h"
#include "cpl_string.h"
#include "mapogcfilter.h"
#include "mapowscommon.h"
......@@ -2065,6 +2066,8 @@ static int msWFSRunFilter(mapObj* map,
return msWFSException(map, "mapserv", MS_OWS_ERROR_NO_APPLICABLE_CODE, paramsObj->pszVersion);
}
FLTProcessPropertyIsNull(psNode, map, lp->index);
/*preparse the filter for gml aliases*/
FLTPreParseFilterForAliasAndGroup(psNode, map, lp->index, "G");
......@@ -2136,6 +2139,7 @@ static int msWFSRunBasicGetFeature(mapObj* map,
const char *pszMapSRS=NULL, *pszLayerSRS=NULL;
rectObj ext;
int status;
const char* pszUseDefaultExtent;
map->query.type = MS_QUERY_BY_RECT; /* setup the query */
map->query.mode = MS_QUERY_MULTIPLE;
......@@ -2147,7 +2151,15 @@ static int msWFSRunBasicGetFeature(mapObj* map,
if(!paramsObj->pszSrs)
pszMapSRS = msOWSGetEPSGProj(&(map->projection), &(map->web.metadata), "FO", MS_TRUE);
if (msOWSGetLayerExtent(map, lp, "FO", &ext) == MS_SUCCESS) {
pszUseDefaultExtent = msOWSLookupMetadata(&(lp->metadata), "F",
"use_default_extent_for_getfeature");
if( pszUseDefaultExtent && CSLTestBoolean(pszUseDefaultExtent) &&
lp->connectiontype == MS_OGR )
{
const rectObj rectInvalid = MS_INIT_INVALID_RECT;
map->query.rect = rectInvalid;
}
else if (msOWSGetLayerExtent(map, lp, "FO", &ext) == MS_SUCCESS) {
/* For a single point layer, to avoid numerical precision issues */
/* when reprojection is involved */
......
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