Skip to content
Commits on Source (5)
......@@ -18,7 +18,7 @@ include(CheckCSourceCompiles)
set (MapServer_VERSION_MAJOR 7)
set (MapServer_VERSION_MINOR 4)
set (MapServer_VERSION_REVISION 0)
set (MapServer_VERSION_SUFFIX "-beta1")
set (MapServer_VERSION_SUFFIX "-beta2")
set(TARGET_VERSION_MAJOR ${MapServer_VERSION_MAJOR})
set(TARGET_VERSION_MINOR ${MapServer_VERSION_MINOR})
......
......@@ -12,6 +12,15 @@ 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.4.0-beta2 release (2019-4-17)
-------------------------------
- Addresses XSS issue with [layers] template tag (fix available in 6.4, 7.0 and 7.2 branches as well)
- Added Perl/Mapscript to Travis CI
- No other major changes, see detailed changelog for bug fixes
7.4.0-beta1 release (2019-3-29)
-------------------------------
......
......@@ -3,12 +3,13 @@ PHP_MAPSCRIPT=build/mapscript/php/php_mapscript.so
PYTHON_MAPSCRIPT_PATH=build/mapscript/python
JAVA_MAPSCRIPT_PATH=build/mapscript/java
CSHARP_MAPSCRIPT_PATH=build/mapscript/csharp
PERL_MAPSCRIPT_PATH=build/mapscript/perl
BUILDPATH=../../build
FLEX=flex
YACC=yacc
CMAKEFLAGS=-DCMAKE_C_FLAGS="--coverage" -DCMAKE_CXX_FLAGS="--coverage" \
-DCMAKE_SHARED_LINKER_FLAGS="-lgcov" -DWITH_CLIENT_WMS=1 \
-DWITH_CLIENT_WFS=1 -DWITH_KML=1 -DWITH_SOS=1 -DWITH_CSHARP=1 -DWITH_PHP=1 \
-DWITH_CLIENT_WFS=1 -DWITH_KML=1 -DWITH_SOS=1 -DWITH_CSHARP=1 -DWITH_PHP=1 -DWITH_PERL=1 \
-DWITH_PYTHON=1 -DWITH_JAVA=1 -DWITH_THREAD_SAFETY=1 -DWITH_FRIBIDI=1 -DWITH_FCGI=0 -DWITH_EXEMPI=1 \
-DCMAKE_BUILD_TYPE=Release -DWITH_RSVG=1 -DWITH_CURL=1 -DWITH_HARFBUZZ=1 -DWITH_POINT_Z_M=1
all: cmakebuild
......@@ -50,11 +51,23 @@ java-testcase:
csharp-testcase:
test -d "$(CSHARP_MAPSCRIPT_PATH)" && (export CSHARP_MAPSCRIPT_SO="../../$(CSHARP_MAPSCRIPT_PATH)" && cd mapscript/csharp && ./run_test.sh)
perl-testcase:
cd "$(PERL_MAPSCRIPT_PATH)" \
&& PERL5LIB=`pwd` \
&& prove tests \
&& perl examples/RFC24.pl ../../../tests/test.map \
&& perl examples/shp_in_shp.pl --infile1 ../../../tests/line.shp --infile1_shpid 0 --infile2 ../../../tests/polygon.shp --infile2_shpid 0 \
&& perl examples/dump.pl --file ../../../tests/line.shp \
&& perl examples/thin.pl --input ../../../tests/polygon --output examples/junk --tolerance=5
test: cmakebuild
@$(MAKE) $(MFLAGS) wxs-testcase renderers-testcase misc-testcase gdal-testcase query-testcase mspython-testcase
@./print-test-results.sh
@$(MAKE) $(MFLAGS) php-testcase
@$(MAKE) $(MFLAGS) csharp-testcase
@$(MAKE) $(MFLAGS) perl-testcase
lexer: maplexer.c
......
mapserver (7.4.0~beta1-1~exp2) UNRELEASED; urgency=medium
mapserver (7.4.0~beta2-1~exp1) experimental; urgency=medium
* New upstream beta release.
* Update symbols for other architectures.
* Drop patches applied upstream. Refresh remaining patches.
-- Bas Couwenberg <sebastic@debian.org> Mon, 15 Apr 2019 19:54:20 +0200
-- Bas Couwenberg <sebastic@debian.org> Thu, 18 Apr 2019 06:30:22 +0200
mapserver (7.4.0~beta1-1~exp1) experimental; urgency=medium
......
......@@ -14,7 +14,7 @@ Forwarded: not-needed
include_directories(${PERL_INCLUDE_PATH})
include_directories(${PROJECT_SOURCE_DIR}/mapscript/swiginc)
include_directories(${PROJECT_SOURCE_DIR}/mapscript/)
@@ -23,5 +23,5 @@ if(APPLE)
@@ -23,8 +23,8 @@ if(APPLE)
set_target_properties(perlmapscript PROPERTIES SUFFIX ".bundle")
endif(APPLE)
......@@ -22,3 +22,6 @@ Forwarded: not-needed
-install(FILES $<TARGET_FILE_DIR:${SWIG_MODULE_perlmapscript_REAL_NAME}>/mapscript.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR})
+install(FILES $<TARGET_FILE:${SWIG_MODULE_perlmapscript_REAL_NAME}> DESTINATION ${CUSTOM_PERL_VENDOR_ARCH_DIR}/auto/mapscript)
+install(FILES $<TARGET_FILE_DIR:${SWIG_MODULE_perlmapscript_REAL_NAME}>/mapscript.pm DESTINATION ${CUSTOM_PERL_VENDOR_ARCH_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/tests DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/examples DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
Description: Fix variables set by find_package(PHP).
Author: Bas Couwenberg <sebastic@debian.org>
Forwarded: https://github.com/mapserver/mapserver/pull/5776
Applied-Upstream: https://github.com/mapserver/mapserver/commit/076701f6a9f83f2a68a2e56872d7d66f88df9e8e
--- a/mapscript/phpng/CMakeLists.txt
+++ b/mapscript/phpng/CMakeLists.txt
@@ -22,17 +22,17 @@ add_definitions(-DZTS=1)
endif(WITH_THREAD_SAFETY)
endif(WIN32)
-include_directories(${PHP_FOUND_INCLUDE_PATH})
-include_directories(${PHP_FOUND_INCLUDE_PATH}/main)
-include_directories(${PHP_FOUND_INCLUDE_PATH}/Zend)
-include_directories(${PHP_FOUND_INCLUDE_PATH}/TSRM)
+include_directories(${PHP_INCLUDE_PATH})
+include_directories(${PHP_INCLUDE_PATH}/main)
+include_directories(${PHP_INCLUDE_PATH}/Zend)
+include_directories(${PHP_INCLUDE_PATH}/TSRM)
include_directories(${PROJECT_SOURCE_DIR}/mapscript/swiginc)
include_directories(${PROJECT_SOURCE_DIR}/mapscript/)
include_directories(${PROJECT_SOURCE_DIR}/mapscript/phpng)
if(WIN32)
-include_directories(${PHP_FOUND_INCLUDE_PATH}/win32)
+include_directories(${PHP_INCLUDE_PATH}/win32)
endif(WIN32)
IF(PHP_VERSION LESS 5)
@@ -56,4 +56,4 @@ target_link_libraries(php_mapscriptng ma
set_target_properties(${SWIG_MODULE_mapscript_REAL_NAME} PROPERTIES PREFIX "")
if(NOT WIN32)
install(TARGETS php_mapscriptng DESTINATION ${PHP_EXTENSION_DIR})
-endif()
\ No newline at end of file
+endif()
Description: Install PHP MapScript.
Author: Bas Couwenberg <sebastic@debian.org>
Bug: https://github.com/mapserver/mapserver/issues/5770
Forwarded: https://github.com/mapserver/mapserver/pull/5771
Applied-Upstream: https://github.com/mapserver/mapserver/commit/6c9ca2e402eb4ceb3a31bef466d308d836946972
--- a/mapscript/php/CMakeLists.txt
+++ b/mapscript/php/CMakeLists.txt
@@ -43,4 +43,4 @@ target_link_libraries(php_mapscript ${MA
ENDIF(WIN32)
set_target_properties(php_mapscript PROPERTIES PREFIX "")
-#install(TARGETS php_mapscript DESTINATION ${PHP_EXTENSION_DIR})
+install(TARGETS php_mapscript DESTINATION ${PHP_EXTENSION_DIR})
Description: Add shebang to Python MapScript example scripts.
Author: Bas Couwenberg <sebastic@debian.org>
Bug: https://github.com/mapserver/mapserver/issues/5773
Forwarded: https://github.com/mapserver/mapserver/pull/5774
Applied-Upstream: https://github.com/mapserver/mapserver/commit/a7f6587d8e16c090e07365cfc14a6867813a3b99
--- a/mapscript/python/examples/project_csv.py
+++ b/mapscript/python/examples/project_csv.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
"""
Simple example to read a csv file and reproject point x/y data
--- a/mapscript/python/examples/shpdump.py
+++ b/mapscript/python/examples/shpdump.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
"""
Dump the contents of the passed in Shapefile
--- a/mapscript/python/examples/shpinfo.py
+++ b/mapscript/python/examples/shpinfo.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
"""
Extracts basic descriptive information from a Shapefile
--- a/mapscript/python/examples/wxs.py
+++ b/mapscript/python/examples/wxs.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
"""
Output WMS GetCapabilities response for a Mapfile
perl-mapscript-install.patch
java-hardening.patch
php-mapscript.patch
spelling-errors.patch
python-mapscript.patch
php-mapscript-ng.patch
Description: Fix spelling errors.
* sould -> should
Author: Bas Couwenberg <sebastic@debian.org>
Forwarded: https://github.com/mapserver/mapserver/pull/5772
Applied-Upstream: https://github.com/mapserver/mapserver/commit/9cc5c7a54fe50407d7ccf22b8da890ad4c66e5a2
--- a/mapkmlrenderer.cpp
+++ b/mapkmlrenderer.cpp
@@ -355,7 +355,7 @@ int KmlRenderer::startNewLayer(imageObj
/*check for image path and image url*/
if (layer->map->debug && (layer->map->web.imageurl == NULL || layer->map->web.imagepath == NULL))
- msDebug("KmlRenderer::startNewLayer: imagepath and imageurl sould be set in the web object\n");
+ msDebug("KmlRenderer::startNewLayer: imagepath and imageurl should be set in the web object\n");
/*map rect for ground overlay*/
......@@ -355,7 +355,7 @@ int KmlRenderer::startNewLayer(imageObj *img, layerObj *layer)
/*check for image path and image url*/
if (layer->map->debug && (layer->map->web.imageurl == NULL || layer->map->web.imagepath == NULL))
msDebug("KmlRenderer::startNewLayer: imagepath and imageurl sould be set in the web object\n");
msDebug("KmlRenderer::startNewLayer: imagepath and imageurl should be set in the web object\n");
/*map rect for ground overlay*/
......
......@@ -247,6 +247,7 @@ typedef struct ms_MSSQL2008_layer_info_t {
char *user_srid; /* zero length = calculate, non-zero means using this value! */
char *index_name; /* hopefully this isn't necessary - but if the optimizer ain't cuttin' it... */
char *sort_spec; /* the sort by specification which should be applied to the generated select statement */
int mssqlversion_major; /* the sql server major version number */
SQLSMALLINT *itemtypes; /* storing the sql field types for further reference */
msODBCconn * conn; /* Connection to db */
......@@ -973,6 +974,7 @@ int msMSSQL2008LayerOpen(layerObj *layer)
layerinfo->sort_spec = NULL;
layerinfo->conn = NULL;
layerinfo->itemtypes = NULL;
layerinfo->mssqlversion_major = 0;
layerinfo->conn = (msODBCconn *) msConnPoolRequest(layer);
......@@ -1102,25 +1104,161 @@ int msMSSQL2008LayerInitItemInfo(layerObj *layer)
return MS_SUCCESS;
}
static int getMSSQLMajorVersion(layerObj* layer)
{
msMSSQL2008LayerInfo *layerinfo = getMSSQL2008LayerInfo(layer);
if (layerinfo == NULL)
return 0;
if (layerinfo->mssqlversion_major == 0) {
char* mssqlversion_major = msLayerGetProcessingKey(layer, "MSSQL_VERSION_MAJOR");
if (mssqlversion_major != NULL) {
layerinfo->mssqlversion_major = atoi(mssqlversion_major);
}
else {
/* need to query from database */
if (executeSQL(layerinfo->conn, "SELECT SERVERPROPERTY('ProductVersion')")) {
SQLRETURN rc = SQLFetch(layerinfo->conn->hstmt);
if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) {
/* process results */
char result_data[256];
SQLLEN retLen = 0;
rc = SQLGetData(layerinfo->conn->hstmt, 1, SQL_C_CHAR, result_data, sizeof(result_data), &retLen);
if (rc != SQL_ERROR) {
result_data[retLen] = 0;
layerinfo->mssqlversion_major = atoi(result_data);
}
}
}
}
}
return layerinfo->mssqlversion_major;
}
/* Get the layer extent as specified in the mapfile or a largest area */
/* covering all features */
int msMSSQL2008LayerGetExtent(layerObj *layer, rectObj *extent)
{
msMSSQL2008LayerInfo *layerinfo;
char *query = 0;
char result_data[256];
SQLLEN retLen;
SQLRETURN rc;
if(layer->debug) {
msDebug("msMSSQL2008LayerGetExtent called\n");
}
if (layer->extent.minx == -1.0 && layer->extent.miny == -1.0 &&
layer->extent.maxx == -1.0 && layer->extent.maxy == -1.0) {
extent->minx = extent->miny = -1.0 * FLT_MAX;
extent->maxx = extent->maxy = FLT_MAX;
} else {
if (!(layer->extent.minx == -1.0 && layer->extent.miny == -1.0 &&
layer->extent.maxx == -1.0 && layer->extent.maxy == -1.0)) {
/* extent was already set */
extent->minx = layer->extent.minx;
extent->miny = layer->extent.miny;
extent->maxx = layer->extent.maxx;
extent->maxy = layer->extent.maxy;
}
layerinfo = getMSSQL2008LayerInfo(layer);
if (!layerinfo) {
msSetError(MS_QUERYERR, "GetExtent called with layerinfo = NULL", "msMSSQL2008LayerGetExtent()");
return MS_FAILURE;
}
/* set up statement */
if (getMSSQLMajorVersion(layer) >= 11) {
if (strcasecmp(layerinfo->geom_column_type, "geography") == 0) {
query = msStringConcatenate(query, "WITH extent(extentcol) AS (SELECT geometry::EnvelopeAggregate(geometry::STGeomFromWKB(");
query = msStringConcatenate(query, layerinfo->geom_column);
query = msStringConcatenate(query, ".STAsBinary(), ");
query = msStringConcatenate(query, layerinfo->geom_column);
query = msStringConcatenate(query, ".STSrid)");
}
else {
query = msStringConcatenate(query, "WITH extent(extentcol) AS (SELECT geometry::EnvelopeAggregate(");
query = msStringConcatenate(query, layerinfo->geom_column);
}
query = msStringConcatenate(query, ".MakeValid()) AS extentcol FROM ");
query = msStringConcatenate(query, layerinfo->geom_table);
query = msStringConcatenate(query, ") SELECT extentcol.STPointN(1).STX, extentcol.STPointN(1).STY, extentcol.STPointN(3).STX, extentcol.STPointN(3).STY FROM extent");
}
else {
if (strcasecmp(layerinfo->geom_column_type, "geography") == 0) {
query = msStringConcatenate(query, "WITH ENVELOPE as (SELECT geometry::STGeomFromWKB(");
query = msStringConcatenate(query, layerinfo->geom_column);
query = msStringConcatenate(query, ".STAsBinary(), ");
query = msStringConcatenate(query, layerinfo->geom_column);
query = msStringConcatenate(query, ".STSrid)");
}
else {
query = msStringConcatenate(query, "WITH ENVELOPE as (SELECT ");
query = msStringConcatenate(query, layerinfo->geom_column);
}
query = msStringConcatenate(query, ".MakeValid().STEnvelope() as envelope from ");
query = msStringConcatenate(query, layerinfo->geom_table);
query = msStringConcatenate(query, "), CORNERS as (SELECT envelope.STPointN(1) as point from ENVELOPE UNION ALL select envelope.STPointN(3) from ENVELOPE) SELECT MIN(point.STX), MIN(point.STY), MAX(point.STX), MAX(point.STY) FROM CORNERS");
}
if (!executeSQL(layerinfo->conn, query)) {
msFree(query);
return MS_FAILURE;
}
msFree(query);
/* process results */
rc = SQLFetch(layerinfo->conn->hstmt);
if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
if (layer->debug) {
msDebug("msMSSQL2008LayerGetExtent: No results found.\n");
}
return MS_FAILURE;
}
rc = SQLGetData(layerinfo->conn->hstmt, 1, SQL_C_CHAR, result_data, sizeof(result_data), &retLen);
if (rc == SQL_ERROR) {
msSetError(MS_QUERYERR, "Failed to get MinX value", "msMSSQL2008LayerGetExtent()");
return MS_FAILURE;
}
result_data[retLen] = 0;
extent->minx = atof(result_data);
rc = SQLGetData(layerinfo->conn->hstmt, 2, SQL_C_CHAR, result_data, sizeof(result_data), &retLen);
if (rc == SQL_ERROR) {
msSetError(MS_QUERYERR, "Failed to get MinY value", "msMSSQL2008LayerGetExtent()");
return MS_FAILURE;
}
result_data[retLen] = 0;
extent->miny = atof(result_data);
rc = SQLGetData(layerinfo->conn->hstmt, 3, SQL_C_CHAR, result_data, sizeof(result_data), &retLen);
if (rc == SQL_ERROR) {
msSetError(MS_QUERYERR, "Failed to get MaxX value", "msMSSQL2008LayerGetExtent()");
return MS_FAILURE;
}
result_data[retLen] = 0;
extent->maxx = atof(result_data);
rc = SQLGetData(layerinfo->conn->hstmt, 4, SQL_C_CHAR, result_data, sizeof(result_data), &retLen);
if (rc == SQL_ERROR) {
msSetError(MS_QUERYERR, "Failed to get MaxY value", "msMSSQL2008LayerGetExtent()");
return MS_FAILURE;
}
result_data[retLen] = 0;
extent->maxy = atof(result_data);
return MS_SUCCESS;
}
......@@ -1358,19 +1496,15 @@ static int prepare_database(layerObj *layer, rectObj rect, char **query_string)
}
/* adding spatial filter */
msMSSQL2008LayerGetExtent(layer, &extent);
if (rect.minx > extent.minx || rect.miny > extent.miny ||
rect.maxx < extent.maxx || rect.maxy < extent.maxy) {
if (hasFilter == MS_FALSE)
query = msStringConcatenate(query, " WHERE ");
else
query = msStringConcatenate(query, " AND ");
query = msStringConcatenate(query, layerinfo->geom_column);
query = msStringConcatenate(query, ".STIntersects(");
query = msStringConcatenate(query, ".MakeValid().STIntersects(");
query = msStringConcatenate(query, box3d);
query = msStringConcatenate(query, ") = 1 ");
}
if (layerinfo->sort_spec)
query = msStringConcatenate(query, layerinfo->sort_spec);
......
......@@ -3171,7 +3171,7 @@ int FLTCheckFeatureIdFilters(FilterEncodingNode *psFilterNode,
tokens = msStringSplit(psFilterNode->pszValue,',', &nTokens);
for (j=0; j<nTokens; j++) {
const char* pszId = tokens[j];
const char* pszDot = strchr(pszId, '.');
const char* pszDot = strrchr(pszId, '.');
if( pszDot )
{
if( pszDot - pszId != strlen(lp->name) ||
......
......@@ -645,7 +645,7 @@ char *FLTGetFeatureIdCommonExpression(FilterEncodingNode *psFilterNode, layerObj
char *pszTmp = NULL;
int bufferSize = 0;
const char* pszId = tokens[i];
const char* pszDot = strchr(pszId, '.');
const char* pszDot = strrchr(pszId, '.');
if( pszDot )
pszId = pszDot + 1;
......
......@@ -806,7 +806,7 @@ msProjectRectAsPolygon(projectionObj *in, projectionObj *out,
lineObj ring;
/* pointObj ringPoints[NUMBER_OF_SAMPLE_POINTS*4+4]; */
pointObj *ringPoints;
int ix, iy;
int ix, iy, ixy;
double dx, dy;
......@@ -841,7 +841,8 @@ msProjectRectAsPolygon(projectionObj *in, projectionObj *out,
}
/* -------------------------------------------------------------------- */
/* Build polygon as steps around the source rectangle. */
/* Build polygon as steps around the source rectangle */
/* and possibly its diagonal. */
/* -------------------------------------------------------------------- */
dx = (rect->maxx - rect->minx)/NUMBER_OF_SAMPLE_POINTS;
dy = (rect->maxy - rect->miny)/NUMBER_OF_SAMPLE_POINTS;
......@@ -857,7 +858,8 @@ msProjectRectAsPolygon(projectionObj *in, projectionObj *out,
return MS_SUCCESS;
}
ringPoints = (pointObj*) calloc(sizeof(pointObj),NUMBER_OF_SAMPLE_POINTS*4+4);
/* If there is more than two sample points we will also get samples from the diagonal line */
ringPoints = (pointObj*) calloc(sizeof(pointObj),NUMBER_OF_SAMPLE_POINTS*5+3);
ring.point = ringPoints;
ring.numpoints = 0;
......@@ -872,7 +874,7 @@ msProjectRectAsPolygon(projectionObj *in, projectionObj *out,
}
}
/* sample on along right side */
/* sample along right side */
if(dy != 0) {
for(iy = 1; iy <= NUMBER_OF_SAMPLE_POINTS; iy++ ) {
ringPoints[ring.numpoints].x = rect->maxx;
......@@ -888,7 +890,7 @@ msProjectRectAsPolygon(projectionObj *in, projectionObj *out,
}
}
/* sample on along left side */
/* sample along left side */
if(dy != 0) {
for(iy = NUMBER_OF_SAMPLE_POINTS-1; iy >= 0; iy-- ) {
ringPoints[ring.numpoints].x = rect->minx;
......@@ -896,6 +898,17 @@ msProjectRectAsPolygon(projectionObj *in, projectionObj *out,
}
}
/* sample along diagonal line */
/* This is done to handle cases where reprojection from world covering projection to one */
/* which isn't could cause min and max values of the projected rectangle to be invalid */
if(dy != 0 && dx != 0) {
/* No need to compute corners as they've already been computed */
for(ixy = NUMBER_OF_SAMPLE_POINTS-2; ixy >= 1; ixy-- ) {
ringPoints[ring.numpoints].x = rect->minx + ixy * dx;
ringPoints[ring.numpoints++].y = rect->miny + ixy * dy;
}
}
msAddLineDirectly( &polygonObj, &ring );
#ifdef notdef
......
......@@ -25,3 +25,6 @@ endif(APPLE)
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})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/tests DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/examples DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
#!/usr/bin/perl
use strict;
use warnings;
use mapscript;
$file=$ARGV[0];
use Data::Dumper;
my $file=$ARGV[0];
# utility
sub assertNotNull {
......@@ -12,13 +16,6 @@ sub assertNotNull {
}
}
sub dumpHash {
my ($hashmap) = @_;
print "Dumping hashmap: $hashmap\n";
for my $k ( keys %$hashmap ) {
print "\t".$k.": ".$hashmap{$k}."\n";
}
}
# layerObj
sub testGetLayerObj {
......@@ -99,8 +96,9 @@ testGetClassObj;
testClassObj;
testInsertClassObj;
$hashmap=mapscript::getPARENT_PTRS();
my $hashmap = mapscript::getPARENT_PTRS();
assertNotNull( keys( %$hashmap )==0 , "checking that hashmap of parent ptrs is empty");
print "No of keys:".keys( %$hashmap )."\n";
dumpHash($hashmap);
#dumpHash($hashmap);
print Dumper( $hashmap );
......@@ -9,8 +9,6 @@
use strict;
use warnings;
use POSIX;
use XBase;
use mapscript;
use Getopt::Long;
use File::Copy;
......@@ -19,7 +17,8 @@ my ($infile1, $infile1_shpid, $infile2, $infile2_shpid, $within);
GetOptions("infile1=s", \$infile1, "infile1_shpid=s", \$infile1_shpid, "infile2=s", \$infile2, "infile2_shpid=s", \$infile2_shpid);
if(!$infile1 or !$infile1_shpid or !$infile2 or !$infile2_shpid) {
# shpid can be zero, which looks false, so use defined()
if(!$infile1 or !defined($infile1_shpid) or !$infile2 or !defined($infile2_shpid)) {
print "Usage: $0 --infile1=[filename] --infile1_shpid=[shpid] --infile2=[filename] --infile2_shpid=[shpid]\n";
exit 0;
}
......
......@@ -10,8 +10,6 @@
use strict;
use warnings;
use POSIX;
use XBase;
use mapscript;
use Getopt::Long;
use File::Copy;
......
#!/usr/bin/perl
use strict;
use warnings;
use Test::More tests => 11;
# check the mapserver version for keywords
sub msHas
{
my ($mod) = @_;
my $ver = mapscript::msGetVersion();
if (index($ver, $mod) > -1) {
return 1;
} else {
return 0;
}
}
require_ok( 'mapscript' );
diag("Testing: " . $INC{'mapscript.pm'});
diag( mapscript::msGetVersion() );
SKIP: {
skip "no geos support", 10 unless msHas('SUPPORTS=GEOS');
my @wkt_list = (
'POINT (5.0000000000000000 7.0000000000000000)',
'LINESTRING (5.0000000000000000 7.0000000000000000, 7.0000000000000000 9.0000000000000000, 9.0000000000000000 -1.0000000000000000)',
'POLYGON ((500.0000000000000000 500.0000000000000000, 3500.0000000000000000 500.0000000000000000, 3500.0000000000000000 2500.0000000000000000, 500.0000000000000000 2500.0000000000000000, 500.0000000000000000 500.0000000000000000), (1000.0000000000000000 1000.0000000000000000, 1000.0000000000000000 1500.0000000000000000, 1500.0000000000000000 1500.0000000000000000, 1500.0000000000000000 1000.0000000000000000, 1000.0000000000000000 1000.0000000000000000))',
'MULTIPOINT (2000.0000000000000000 2000.0000000000000000, 2000.0000000000000000 1900.0000000000000000)',
'MULTILINESTRING ((600.0000000000000000 1500.0000000000000000, 1600.0000000000000000 2500.0000000000000000), (700.0000000000000000 1500.0000000000000000, 1700.0000000000000000 2500.0000000000000000))'
);
for my $orig (@wkt_list)
{
my $shp = mapscript::shapeObj::fromWKT( $orig );
ok( $shp, 'create shapeObj');
my $new_wkt = $shp->toWKT();
ok( $orig eq $new_wkt, 'from WKT <> toWKT' );
}
};