Commit bdbe4db7 authored by Bas Couwenberg's avatar Bas Couwenberg

New upstream version 7.2.2

parent 963a098e
......@@ -17,7 +17,7 @@ include(CheckCSourceCompiles)
set (MapServer_VERSION_MAJOR 7)
set (MapServer_VERSION_MINOR 2)
set (MapServer_VERSION_REVISION 1)
set (MapServer_VERSION_REVISION 2)
set (MapServer_VERSION_SUFFIX "")
set(TARGET_VERSION_MAJOR ${MapServer_VERSION_MAJOR})
......
......@@ -12,6 +12,11 @@ For a complete change history, please see the Git log comments. For more
details about recent point releases, please see the online changelog at:
http://mapserver.org/development/changelog/
7.2.2 release (2019-2-19)
--------------------------
- No major changes, see detailed changelog for bug fixes
7.2.1 release (2018-10-1)
--------------------------
......
......@@ -69,7 +69,7 @@ License
::
Copyright (c) 2008-2018 Open Source Geospatial Foundation.
Copyright (c) 2008-2019 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
......
......@@ -525,13 +525,13 @@ static void writeKeyword(FILE *stream, int indent, const char *name, int value,
va_end(argp);
}
static void writeDimension(FILE *stream, int indent, const char *name, int x, int y, char *bind_x, char *bind_y)
static void writeDimension(FILE *stream, int indent, const char *name, double x, double y, char *bind_x, char *bind_y)
{
writeIndent(stream, ++indent);
if(bind_x) msIO_fprintf(stream, "%s [%s] ", name, bind_x);
else msIO_fprintf(stream, "%s %d ", name, x);
else msIO_fprintf(stream, "%s %.15g ", name, x);
if(bind_y) msIO_fprintf(stream, "[%s]\n", bind_y);
else msIO_fprintf(stream, "%d\n", y);
else msIO_fprintf(stream, "%.15g\n", y);
}
static void writeDoubleRange(FILE *stream, int indent, const char *name, double x, double y)
......
......@@ -2754,7 +2754,7 @@ YY_RULE_SETUP
case 21:
YY_RULE_SETUP
#line 188 "maplexer.l"
{ MS_LEXER_RETURN_TOKEN(IN); }
{ MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_IN); /* was IN */ }
YY_BREAK
case 22:
YY_RULE_SETUP
......
......@@ -185,7 +185,7 @@ char path[MS_MAXPATHLEN];
<EXPRESSION_STRING>=\* { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_IEQ); }
<EXPRESSION_STRING>~\* { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_IRE); }
<EXPRESSION_STRING>in { MS_LEXER_RETURN_TOKEN(IN); }
<EXPRESSION_STRING>in { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_IN); /* was IN */ }
<EXPRESSION_STRING>area { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_AREA); }
<EXPRESSION_STRING>length { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_LENGTH); }
......
......@@ -89,6 +89,7 @@ xmlNodePtr _msMetadataGetOnline(xmlNsPtr namespace, layerObj *layer, char *servi
char *url = NULL;
char buffer[32];
char *epsg_str;
char *link_protocol;
xmlNodePtr psNode = NULL;
xmlNodePtr psORNode = NULL;
......@@ -108,6 +109,7 @@ xmlNodePtr _msMetadataGetOnline(xmlNsPtr namespace, layerObj *layer, char *servi
url = msStringConcatenate(url, msEncodeHTMLEntities("&crs="));
msOWSGetEPSGProj(&(layer->projection), &(layer->metadata), "MFCSGO", MS_TRUE, &epsg_str);
url = msStringConcatenate(url, msEncodeHTMLEntities(epsg_str));
link_protocol = "WWW:DOWNLOAD-1.0-http-get-map";
status = msLayerGetExtent(layer, &rect);
......@@ -127,12 +129,14 @@ xmlNodePtr _msMetadataGetOnline(xmlNsPtr namespace, layerObj *layer, char *servi
}
}
else if (strcasecmp(service, "F") == 0) {
link_protocol = "WWW:DOWNLOAD-1.0-http--download";
url = msStringConcatenate(url, msEncodeHTMLEntities("service=WFS&version=1.1.0&request=GetFeature&typename="));
url = msStringConcatenate(url, msEncodeHTMLEntities(layer->name));
url = msStringConcatenate(url, msEncodeHTMLEntities("&outputformat="));
url = msStringConcatenate(url, msEncodeHTMLEntities(format));
}
else if (strcasecmp(service, "C") == 0) {
link_protocol = "WWW:DOWNLOAD-1.0-http--download";
url = msStringConcatenate(url, msEncodeHTMLEntities("service=WCS&version=2.0.1&request=GetCoverage&coverageid="));
url = msStringConcatenate(url, msEncodeHTMLEntities(layer->name));
url = msStringConcatenate(url, msEncodeHTMLEntities("&format="));
......@@ -141,7 +145,7 @@ xmlNodePtr _msMetadataGetOnline(xmlNsPtr namespace, layerObj *layer, char *servi
xmlAddChild(psORNode, _msMetadataGetURL(namespace, "linkage", url));
xmlAddChild(psORNode, _msMetadataGetCharacterString(namespace, "protocol", "WWW:DOWNLOAD-1.0-http--download"));
xmlAddChild(psORNode, _msMetadataGetCharacterString(namespace, "protocol", link_protocol));
xmlAddChild(psORNode, _msMetadataGetCharacterString(namespace, "name", layer->name));
xmlAddChild(psORNode, _msMetadataGetCharacterString(namespace, "description", desc));
......@@ -450,12 +454,12 @@ xmlNodePtr _msMetadataGetContact(xmlNsPtr namespace, char *contact_element, mapO
if (value)
xmlAddChild(psCIAddressNode, _msMetadataGetCharacterString(namespace, "electronicMailAddress", value));
psORNode = xmlNewChild(psCINode2, namespace, BAD_CAST "onlineResource", NULL);
psORNode2 = xmlNewChild(psORNode, namespace, BAD_CAST "CI_OnlineResource", NULL);
value = (char *)msOWSLookupMetadata(&(map->web.metadata), "MCFO", "onlineresource");
if (value)
if (value) {
psORNode = xmlNewChild(psCINode2, namespace, BAD_CAST "onlineResource", NULL);
psORNode2 = xmlNewChild(psORNode, namespace, BAD_CAST "CI_OnlineResource", NULL);
xmlAddChild(psORNode2, _msMetadataGetURL(namespace, "linkage", value));
}
xmlAddChild(psCNode, _msMetadataGetCodeList(namespace, "role", "CI_RoleCode", "pointOfContact"));
......@@ -604,9 +608,7 @@ xmlNodePtr _msMetadataGetDistributionInfo(xmlNsPtr namespace, mapObj *map, layer
/* WMS */
xmlAddChild(psDTONode, _msMetadataGetOnline(namespace, layer, "M", "image/png", "PNG Format", url));
xmlAddChild(psDTONode, _msMetadataGetOnline(namespace, layer, "M", "image/jpeg", "JPEG Format", url));
xmlAddChild(psDTONode, _msMetadataGetOnline(namespace, layer, "M", "image/gif", "GIF Format", url));
/* WCS */
if (layer->type == MS_LAYER_RASTER) {
......@@ -892,10 +894,10 @@ void msMetadataSetGetMetadataURL(layerObj *lp, const char *url)
pszMetadataURL = msStringConcatenate(pszMetadataURL, lp->name);
msInsertHashTable(&(lp->metadata), "ows_metadataurl_href", pszMetadataURL);
msInsertHashTable(&(lp->metadata), "ows_metadataurl_type", "ISOTC211/19115");
msInsertHashTable(&(lp->metadata), "ows_metadataurl_type", "TC211");
msInsertHashTable(&(lp->metadata), "ows_metadataurl_format", "text/xml");
msInsertHashTable(&(lp->metadata), "ows_metadatalink_href", pszMetadataURL);
msInsertHashTable(&(lp->metadata), "ows_metadatalink_type", "ISOTC211/19115");
msInsertHashTable(&(lp->metadata), "ows_metadatalink_type", "TC211");
msInsertHashTable(&(lp->metadata), "ows_metadatalink_format", "text/xml");
msFree(pszMetadataURL);
}
......
This diff is collapsed.
......@@ -57,6 +57,21 @@ typedef struct {
#define COMMAND(id, count) (((id) & 0x7) | ((count) << 3))
#define PARAMETER(n) (((n) << 1) ^ ((n) >> 31))
static double getTriangleHeight(lineObj *ring)
{
int i;
double s=0, b=0;
if(ring->numpoints != 4) return -1; /* not a triangle */
for(i=0; i<ring->numpoints-1; i++) {
s += (ring->point[i].x*ring->point[i+1].y - ring->point[i+1].x*ring->point[i].y);
b = MS_MAX(b, msDistancePointToPoint(&ring->point[i], &ring->point[i+1]));
}
return (MS_ABS(s/b));
}
static enum MS_RING_DIRECTION mvtGetRingDirection(lineObj *ring) {
int i, sum=0;
......@@ -132,6 +147,11 @@ static int mvtTransformShape(shapeObj *shape, rectObj *extent, int layer_type, i
shape->line[i].numpoints = outj;
if(layer_type == MS_LAYER_POLYGON) {
if(shape->line[i].numpoints == 4 && getTriangleHeight(&shape->line[i]) < 1) {
shape->line[i].numpoints = 0; /* so it's not considered anymore */
continue; /* next ring */
}
ring_direction = mvtGetRingDirection(&shape->line[i]);
if(ring_direction == MS_DIRECTION_INVALID_RING)
shape->line[i].numpoints = 0; /* so it's not considered anymore */
......@@ -355,6 +375,10 @@ int msMVTWriteTile( mapObj *map, int sendheaders ) {
VectorTile__Tile mvt_tile = VECTOR_TILE__TILE__INIT;
mvt_tile.layers = msSmallCalloc(map->numlayers, sizeof(VectorTile__Tile__Layer*));
/* make sure we have a scale and cellsize computed */
map->cellsize = MS_CELLSIZE(map->extent.minx, map->extent.maxx, map->width);
msCalculateScale(map->extent, map->units, map->width, map->height, map->resolution, &map->scaledenom);
/* expand the map->extent so it goes from pixel center (MapServer) to pixel edge (OWS) */
map->extent.minx -= map->cellsize * 0.5;
map->extent.maxx += map->cellsize * 0.5;
......
......@@ -41,7 +41,7 @@ char *FLTGetIsLikeComparisonCommonExpression(FilterEncodingNode *psFilterNode)
{
const size_t bufferSize = 1024;
char szBuffer[1024];
char szTmp[256];
char szTmp[512];
char *pszValue = NULL;
const char *pszWild = NULL;
......@@ -52,9 +52,9 @@ char *FLTGetIsLikeComparisonCommonExpression(FilterEncodingNode *psFilterNode)
int nLength=0, i=0, iTmp=0;
/* From http://www.fon.hum.uva.nl/praat/manual/Regular_expressions_1__Special_characters.html */
/* From http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html#tag_09_04 */
/* also add double quote because we are within a string */
const char* pszRegexSpecialCharsAndDoubleQuote = "\\^${}[]().*+?|<>-&\"";
const char* pszRegexSpecialCharsAndDoubleQuote = "\\^${[().*+?|\"";
if (!psFilterNode || !psFilterNode->pOther || !psFilterNode->psLeftNode || !psFilterNode->psRightNode || !psFilterNode->psRightNode->pszValue)
return NULL;
......@@ -92,11 +92,12 @@ char *FLTGetIsLikeComparisonCommonExpression(FilterEncodingNode *psFilterNode)
pszValue = psFilterNode->psRightNode->pszValue;
nLength = strlen(pszValue);
if( 1 + 2 * nLength + 1 + 1 >= sizeof(szTmp) )
/* The 4 factor is in case of \. See below */
if( 1 + 4 * nLength + 1 + 1 >= sizeof(szTmp) )
return NULL;
iTmp =0;
if (nLength > 0 && pszValue[0] != pszWild[0] && pszValue[0] != pszSingle[0] && pszValue[0] != pszEscape[0]) {
if (nLength > 0) {
szTmp[iTmp]= '^';
iTmp++;
}
......@@ -106,21 +107,33 @@ char *FLTGetIsLikeComparisonCommonExpression(FilterEncodingNode *psFilterNode)
iTmp++;
szTmp[iTmp] = '\0';
/* The Filter escape character is supposed to only escape the single, wildcard and escape character */
/* As we replace single and wild by regular expression special characters, we indeed */
/* need to escape them */
} else if (pszValue[i] == pszEscape[0] && (pszValue[i+1] == pszSingle[0] || pszValue[i+1] == pszWild[0])) {
szTmp[iTmp] = '\\';
iTmp++;
szTmp[iTmp] = '\0';
/* If the Filter escape character is escaped, only regular-expression-escape-it */
/* if it is indeed a regular expression special character. Otherwise ignore it */
} else if (pszValue[i] == pszEscape[0] && pszValue[i+1] == pszEscape[0]) {
if( strchr(pszRegexSpecialCharsAndDoubleQuote, pszValue[i]) )
} else if (pszValue[i] == pszEscape[0] && (
pszValue[i+1] == pszSingle[0] ||
pszValue[i+1] == pszWild[0] ||
pszValue[i+1] == pszEscape[0])) {
if( pszValue[i+1] == '\\' )
{
/* Tricky case: \ must be escaped ncce in the regular expression context
so that the regexp matches it as an ordinary character.
But as \ is also the escape character for MapServer string, we
must escape it again. */
szTmp[iTmp++] = '\\';
szTmp[iTmp++] = '\\';
szTmp[iTmp++] = '\\';
szTmp[iTmp++] = '\\';
}
else
{
szTmp[iTmp] = '\\';
iTmp++;
szTmp[iTmp] = '\0';
/* If the escaped character is itself a regular expression special character */
/* we need to regular-expression-escape-it ! */
if( strchr(pszRegexSpecialCharsAndDoubleQuote, pszValue[i+1]) )
{
szTmp[iTmp++] = '\\';
}
szTmp[iTmp++] = pszValue[i+1];
}
i++;
szTmp[iTmp] = '\0';
} else if (pszValue[i] == pszWild[0]) {
szTmp[iTmp++] = '.';
szTmp[iTmp++] = '*';
......@@ -129,10 +142,19 @@ char *FLTGetIsLikeComparisonCommonExpression(FilterEncodingNode *psFilterNode)
/* Escape regular expressions special characters and double quote */
else if (strchr(pszRegexSpecialCharsAndDoubleQuote, pszValue[i]))
{
szTmp[iTmp] = '\\';
iTmp++;
szTmp[iTmp] = pszValue[i];
iTmp++;
if( pszValue[i] == '\\' )
{
/* See above explantation */
szTmp[iTmp++] = '\\';
szTmp[iTmp++] = '\\';
szTmp[iTmp++] = '\\';
szTmp[iTmp++] = '\\';
}
else
{
szTmp[iTmp++] = '\\';
szTmp[iTmp++] = pszValue[i];
}
szTmp[iTmp] = '\0';
}
else {
......@@ -143,7 +165,10 @@ char *FLTGetIsLikeComparisonCommonExpression(FilterEncodingNode *psFilterNode)
}
szTmp[iTmp] = '"';
szTmp[++iTmp] = '\0';
#if 0
msDebug("like: %s\n", pszValue);
msDebug("regexp (with \\ escaping for MapServer use): %s\n", szTmp);
#endif
strlcat(szBuffer, szTmp, bufferSize);
strlcat(szBuffer, ")", bufferSize);
return msStrdup(szBuffer);
......
This diff is collapsed.
/* A Bison parser, made by GNU Bison 2.5. */
/* A Bison parser, made by GNU Bison 2.3. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
......@@ -26,11 +29,10 @@
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
......@@ -136,27 +138,21 @@
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{
/* Line 2068 of yacc.c */
#line 30 "mapparser.y"
{
double dblval;
int intval;
char *strval;
struct tm tmval;
shapeObj *shpval;
/* Line 2068 of yacc.c */
#line 154 "mapparser.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
}
/* Line 1529 of yacc.c. */
#line 151 "/Users/sdlime/mapserver/sdlime/mapserver/mapparser.h"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
......@@ -834,6 +834,8 @@ int yylex(YYSTYPE *lvalp, parseObj *p)
case MS_TOKEN_COMPARISON_RE: token = RE; break;
case MS_TOKEN_COMPARISON_IRE: token = IRE; break;
case MS_TOKEN_COMPARISON_IN: token = IN; break;
case MS_TOKEN_COMPARISON_INTERSECTS: token = INTERSECTS; break;
case MS_TOKEN_COMPARISON_DISJOINT: token = DISJOINT; break;
case MS_TOKEN_COMPARISON_TOUCHES: token = TOUCHES; break;
......
......@@ -4032,7 +4032,7 @@ int msPostGISLayerTranslateFilter(layerObj *layer, expressionObj *filter, char *
if(layer->debug >= 2) msDebug("msPostGISLayerTranslateFilter. There are tokens to process... \n");
node = filter->tokens;
while (node != NULL) {
while (node != NULL) {
/*
** Do any token caching/tracking here, easier to have it in one place.
......@@ -4040,8 +4040,9 @@ int msPostGISLayerTranslateFilter(layerObj *layer, expressionObj *filter, char *
if(node->token == MS_TOKEN_BINDING_TIME) {
bindingToken = node->token;
} else if(node->token == MS_TOKEN_COMPARISON_EQ || node->token == MS_TOKEN_COMPARISON_NE ||
node->token == MS_TOKEN_COMPARISON_GT || node->token == MS_TOKEN_COMPARISON_GE ||
node->token == MS_TOKEN_COMPARISON_LT || node->token == MS_TOKEN_COMPARISON_LE) {
node->token == MS_TOKEN_COMPARISON_GT || node->token == MS_TOKEN_COMPARISON_GE ||
node->token == MS_TOKEN_COMPARISON_LT || node->token == MS_TOKEN_COMPARISON_LE ||
node->token == MS_TOKEN_COMPARISON_IN) {
comparisonToken = node->token;
}
......@@ -4066,13 +4067,38 @@ int msPostGISLayerTranslateFilter(layerObj *layer, expressionObj *filter, char *
msFree(snippet);
break;
case MS_TOKEN_LITERAL_STRING:
strtmpl = "'%s'";
stresc = msPostGISEscapeSQLParam(layer, node->tokenval.strval);
snippet = (char *) msSmallMalloc(strlen(strtmpl) + strlen(stresc));
sprintf(snippet, strtmpl, stresc);
native_string = msStringConcatenate(native_string, snippet);
msFree(snippet);
msFree(stresc);
if(comparisonToken == MS_TOKEN_COMPARISON_IN) { /* issue 5490 */
char **strings=NULL;
int i, nstrings=0;
strings = msStringSplit(node->tokenval.strval, ',', &nstrings);
if(nstrings > 0) {
native_string = msStringConcatenate(native_string, "(");
for(i=0; i<nstrings; i++) {
if(i != 0) native_string = msStringConcatenate(native_string, ",");
strtmpl = "'%s'";
stresc = msPostGISEscapeSQLParam(layer, strings[i]);
snippet = (char *) msSmallMalloc(strlen(strtmpl) + strlen(stresc));
sprintf(snippet, strtmpl, stresc);
native_string = msStringConcatenate(native_string, snippet);
msFree(snippet);
msFree(stresc);
}
native_string = msStringConcatenate(native_string, ")");
}
msFreeCharArray(strings, nstrings);
} else {
strtmpl = "'%s'";
stresc = msPostGISEscapeSQLParam(layer, node->tokenval.strval);
snippet = (char *) msSmallMalloc(strlen(strtmpl) + strlen(stresc));
sprintf(snippet, strtmpl, stresc);
native_string = msStringConcatenate(native_string, snippet);
msFree(snippet);
msFree(stresc);
}
break;
case MS_TOKEN_LITERAL_TIME: {
snippet = (char *) msSmallMalloc(512);
......
......@@ -62,6 +62,4 @@ ADD_CUSTOM_COMMAND(TARGET mapscript
COMMENT "Compiling c# source files"
)
#get_target_property(LOC_MAPSCRIPT_LIB ${SWIG_MODULE_csharpmapscript_REAL_NAME} LOCATION)
#install(FILES ${LOC_MAPSCRIPT_LIB} DESTINATION lib)
FIND_PACKAGE(SWIG REQUIRED)
INCLUDE(${SWIG_USE_FILE})
find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})
FIND_PACKAGE(JNI)
FIND_PACKAGE(Java)
find_package(JNI)
find_package(Java)
if(NOT JNI_INCLUDE_DIRS OR NOT Java_JAVAC_EXECUTABLE OR NOT Java_JAR_EXECUTABLE)
message(SEND_ERROR "Could not find required Java componenents. Try setting the JAVA_HOME environment variable (required on e.g. Ubuntu)")
endif(NOT JNI_INCLUDE_DIRS OR NOT Java_JAVAC_EXECUTABLE OR NOT Java_JAR_EXECUTABLE)
INCLUDE_DIRECTORIES(${JNI_INCLUDE_DIRS})
include_directories(${JNI_INCLUDE_DIRS})
include_directories(${PROJECT_SOURCE_DIR}/mapscript/swiginc)
include_directories(${PROJECT_SOURCE_DIR}/mapscript/)
include_directories(${PROJECT_SOURCE_DIR}/mapscript/java)
SET (CMAKE_SWIG_OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/edu/umn/gis/mapscript")
SET(CMAKE_SWIG_FLAGS -package edu.umn.gis.mapscript)
SWIG_ADD_MODULE(javamapscript java ../mapscript.i)
set (CMAKE_SWIG_OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/edu/umn/gis/mapscript")
set(CMAKE_SWIG_FLAGS -package edu.umn.gis.mapscript)
SWIG_LINK_LIBRARIES(javamapscript ${MAPSERVER_LIBMAPSERVER})
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 3.7)
swig_add_library(javamapscript TYPE MODULE LANGUAGE java SOURCES ../mapscript.i)
else ()
swig_add_module(javamapscript java ../mapscript.i)
endif ()
ADD_CUSTOM_COMMAND(TARGET javamapscript
swig_link_libraries(javamapscript ${MAPSERVER_LIBMAPSERVER})
add_custom_command(TARGET javamapscript
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
POST_BUILD
COMMAND ${Java_JAVAC_EXECUTABLE} edu/umn/gis/mapscript/*.java
......@@ -25,6 +30,5 @@ ADD_CUSTOM_COMMAND(TARGET javamapscript
COMMENT "Compiling java source files, creating mapscript.jar"
)
get_target_property(LOC_MAPSCRIPT_LIB ${SWIG_MODULE_javamapscript_REAL_NAME} LOCATION)
install(FILES ${LOC_MAPSCRIPT_LIB} DESTINATION ${CMAKE_INSTALL_LIBDIR})
set(mapscript_files $<TARGET_FILE:${SWIG_MODULE_javamapscript_REAL_NAME}>)
install(FILES ${mapscript_files} DESTINATION ${CMAKE_INSTALL_LIBDIR})
FIND_PACKAGE(SWIG REQUIRED)
INCLUDE(${SWIG_USE_FILE})
FIND_PACKAGE(Perl REQUIRED)
FIND_PACKAGE(PerlLibs REQUIRED)
find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})
find_package(Perl REQUIRED)
find_package(PerlLibs REQUIRED)
set(CUSTOM_PERL_SITE_ARCH_DIR ${PERL_SITEARCH} CACHE DIR "Custom installation directory for perl binary extension")
INCLUDE_DIRECTORIES(${PERL_INCLUDE_PATH})
include_directories(${PERL_INCLUDE_PATH})
include_directories(${PROJECT_SOURCE_DIR}/mapscript/swiginc)
include_directories(${PROJECT_SOURCE_DIR}/mapscript/)
add_definitions(${PERL_EXTRA_C_FLAGS})
SET(CMAKE_SWIG_FLAGS -shadow -w314)
set(CMAKE_SWIG_FLAGS -shadow -w314)
include_directories(${PROJECT_SOURCE_DIR}/mapscript/perl)
SWIG_ADD_MODULE(perlmapscript perl5 ../mapscript.i)
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 3.7)
swig_add_library(perlmapscript TYPE MODULE LANGUAGE perl5 SOURCES ../mapscript.i)
else ()
swig_add_module(perlmapscript perl5 ../mapscript.i)
endif ()
SWIG_LINK_LIBRARIES(perlmapscript ${PERL_LIBRARIES} ${MAPSERVER_LIBMAPSERVER})
set_target_properties(perlmapscript PROPERTIES OUTPUT_NAME mapscript)
......@@ -18,8 +23,5 @@ if(APPLE)
set_target_properties(perlmapscript PROPERTIES SUFFIX ".bundle")
endif(APPLE)
get_target_property(LOC_MAPSCRIPT_LIB ${SWIG_MODULE_perlmapscript_REAL_NAME} LOCATION)
set(mapscript_files ${LOC_MAPSCRIPT_LIB} ${CMAKE_CURRENT_BINARY_DIR}/mapscript.pm)
install(FILES ${LOC_MAPSCRIPT_LIB} DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/mapscript)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mapscript.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR})
install(FILES $<TARGET_FILE:${SWIG_MODULE_perlmapscript_REAL_NAME}> DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/mapscript)
install(FILES $<TARGET_FILE_DIR:${SWIG_MODULE_perlmapscript_REAL_NAME}>/mapscript.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR})
FIND_PACKAGE(SWIG REQUIRED)
INCLUDE(${SWIG_USE_FILE})
FIND_PACKAGE(Ruby REQUIRED)
INCLUDE_DIRECTORIES(${RUBY_INCLUDE_DIRS})
find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})
find_package(Ruby REQUIRED)
include_directories(${RUBY_INCLUDE_DIRS})
include_directories(${PROJECT_SOURCE_DIR}/mapscript/swiginc)
include_directories(${PROJECT_SOURCE_DIR}/mapscript/)
include_directories(${PROJECT_SOURCE_DIR}/mapscript/ruby)
SWIG_ADD_MODULE(rubymapscript ruby ../mapscript.i)
SWIG_LINK_LIBRARIES(rubymapscript ${RUBY_LIBRARY} ${MAPSERVER_LIBMAPSERVER})
if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 3.7)
swig_add_library(rubymapscript TYPE MODULE LANGUAGE ruby SOURCES ../mapscript.i)
else ()
swig_add_module(rubymapscript ruby ../mapscript.i)
endif ()
swig_link_libraries(rubymapscript ${RUBY_LIBRARY} ${MAPSERVER_LIBMAPSERVER})
set_target_properties(${SWIG_MODULE_rubymapscript_REAL_NAME} PROPERTIES PREFIX "")
set_target_properties(${SWIG_MODULE_rubymapscript_REAL_NAME} PROPERTIES OUTPUT_NAME mapscript)
if(APPLE)
set_target_properties(${SWIG_MODULE_rubymapscript_REAL_NAME} PROPERTIES SUFFIX ".bundle")
set_target_properties(${SWIG_MODULE_rubymapscript_REAL_NAME} PROPERTIES SUFFIX ".bundle")
endif(APPLE)
get_target_property(LOC_MAPSCRIPT_LIB ${SWIG_MODULE_rubymapscript_REAL_NAME} LOCATION)
set(mapscript_files $<TARGET_FILE:${SWIG_MODULE_rubymapscript_REAL_NAME}>)
execute_process(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "puts RbConfig::CONFIG['sitearchdir']" OUTPUT_VARIABLE RUBY_SITEARCHDIR OUTPUT_STRIP_TRAILING_WHITESPACE)
install(FILES ${LOC_MAPSCRIPT_LIB} DESTINATION ${RUBY_SITEARCHDIR})
install(FILES ${mapscript_files} DESTINATION ${RUBY_SITEARCHDIR})
......@@ -323,7 +323,11 @@ int msWMSApplyFilter(mapObj *map, int version, const char *filter,
char **paszFilters = NULL;
FilterEncodingNode *psNode = NULL;
if (!map || !filter || strlen(filter)==0)
// Empty filter should be ignored
if (!filter || strlen(filter) == 0)
return MS_SUCCESS;
if (!map)
return MS_FAILURE;
/* Count number of requested layers
......@@ -360,7 +364,7 @@ int msWMSApplyFilter(mapObj *map, int version, const char *filter,
}
if (numlayers != numfilters) {
msSetError(MS_WFSERR, "Wrong number of filter elements, one filter must be specified for each requested layer.",
msSetError(MS_WMSERR, "Wrong number of filter elements, one filter must be specified for each requested layer.",
"msWMSApplyFilter" );
return msWMSException(map, version, "InvalidParameterValue", wms_exception_format);
}
......@@ -454,7 +458,7 @@ int msWMSApplyFilter(mapObj *map, int version, const char *filter,
errorObj* ms_error = msGetErrorObj();
if(ms_error->code != MS_NOTFOUND) {
msSetError(MS_WFSERR, "FLTApplyFilterToLayer() failed", "msWFSGetFeature()");
msSetError(MS_WMSERR, "FLTApplyFilterToLayer() failed", "msWMSApplyFilter()");
FLTFreeFilterEncodingNode( psNode );
return msWMSException(map, version, "InvalidParameterValue", wms_exception_format);
}
......
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