diff -Nru mapserver-7.0.6/CMakeLists.txt mapserver-7.0.7/CMakeLists.txt --- mapserver-7.0.6/CMakeLists.txt 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/CMakeLists.txt 2017-11-15 19:24:35.000000000 +0000 @@ -17,7 +17,7 @@ set (MapServer_VERSION_MAJOR 7) set (MapServer_VERSION_MINOR 0) -set (MapServer_VERSION_REVISION 6) +set (MapServer_VERSION_REVISION 7) set (MapServer_VERSION_SUFFIX "") set(TARGET_VERSION_MAJOR ${MapServer_VERSION_MAJOR}) diff -Nru mapserver-7.0.6/debian/changelog mapserver-7.0.7/debian/changelog --- mapserver-7.0.6/debian/changelog 2017-11-05 18:55:48.000000000 +0000 +++ mapserver-7.0.7/debian/changelog 2017-11-16 15:45:58.000000000 +0000 @@ -1,8 +1,20 @@ -mapserver (7.0.6-2~xenial1) xenial; urgency=medium +mapserver (7.0.7-1~xenial0) xenial; urgency=medium * No change rebuild for Xenial. - -- Angelos Tzotsos Sun, 05 Nov 2017 20:00:00 +0200 + -- Angelos Tzotsos Thu, 16 Nov 2017 17:00:00 +0200 + +mapserver (7.0.7-1) unstable; urgency=medium + + * New upstream release. + * Change priority from extra to optional. + * Bump Standards-Version to 4.1.1, changes: priority. + * Strip trailing whitespace from changelog & rules. + * Add lintian override for debian-watch-uses-insecure-uri. + * Add lintian override for python-foo-but-no-python3-foo. + * Update symbols for amd64. + + -- Bas Couwenberg Wed, 15 Nov 2017 21:00:35 +0100 mapserver (7.0.6-2) unstable; urgency=medium @@ -300,7 +312,7 @@ * New upstream release, fixes a vulnerability leading to potential leakage of information when using TIME filtering on postgis layers. * Refresh patches. - * Drop freetype2-include-dir.patch, applied upstream in modified form. + * Drop freetype2-include-dir.patch, applied upstream in modified form. * Bump Standards-Version to 3.9.5, no changes required. * Add lintian override for debian-watch-may-check-gpg-signature, upstream doesn't provide signatures for verification. @@ -326,7 +338,7 @@ * Remove debconf translations, debconf template no longer used. [ Francesco Paolo Lovergine ] - * Now build-dep on (versioned) libgdal-dev instead of (obsolete) libgdal1-dev. + * Now build-dep on (versioned) libgdal-dev instead of (obsolete) libgdal1-dev. * Added a new patch freetype2-include-dir.patch to fix problem in determining the correct FreeType2 include directory (why is it not using freetype-config?). @@ -379,7 +391,7 @@ [ Bas Couwenberg ] * Upload for Debian closes: #706157 - * Merge changes from 6.0.1-4: + * Merge changes from 6.0.1-4: - Migrated to debhelper level 9. - Depend on PHP API version instead of libapache2-mod-php5. - Bump libgeos-dev build dependency to 3.3.1-1~. @@ -470,7 +482,7 @@ * Fixed typo that prevented AGG use in debian/rules. (closes: #663875) * Now using libpng-dev as b-d. - * Migrated to debhelper level 9 and policy bumped to 3.9.3. + * Migrated to debhelper level 9 and policy bumped to 3.9.3. -- Francesco Paolo Lovergine Wed, 14 Mar 2012 21:43:53 +0100 @@ -498,7 +510,7 @@ [ Francesco Paolo Lovergine ] * Debhelper level set to 8. * This version still uses libpng 1.2, but is ready also for 1.5. - * Removed explicit settings of png dir, it collids with multi-arch support. + * Removed explicit settings of png dir, it collids with multi-arch support. * Now mapscript/php3 moved finally to mapscript/php. Install file changed as due. * Removed obsolete python-docutils build-dep. Thanks Jakub Wilk. @@ -596,7 +608,7 @@ * Policy bumped to 3.8.4 without changes. * Removed Andreas Putzo among Uploaders: last contribution dated more than two years ago. - * Added shapelib to Suggests in mapserver-bin. + * Added shapelib to Suggests in mapserver-bin. -- Francesco Paolo Lovergine Wed, 24 Mar 2010 22:13:25 +0100 @@ -615,9 +627,9 @@ mapserver (5.6.0+final-1) unstable; urgency=low * New upstream release, reissued after some last minute changes. This is - the current 5.6.0 upstream version. - * Added a lintian override-file for mismatched - possible-gpl-code-linked-with-openssl error. + the current 5.6.0 upstream version. + * Added a lintian override-file for mismatched + possible-gpl-code-linked-with-openssl error. * Policy bumped to 3.8.3 (no changes). * Added missing ${misc:Depends} item in each control stanza. * Added a README.source for documenting dpatch use. @@ -632,7 +644,7 @@ * Deprecated dh_movefiles changed in dh_install. * Removed debian/AGG and debian/agg-2.4.uu: use AGG included with Mapserver source. * Clean up of debian/rules: removed all agg related stuff. - * Added libxslt1-dev, libpam0g-dev and libreadline-dev build-dependencies. + * Added libxslt1-dev, libpam0g-dev and libreadline-dev build-dependencies. * Added msencrypt binary. * Added SWF support. (flash) * Added fribidi support. @@ -643,7 +655,7 @@ mapserver (5.4.2-1) unstable; urgency=high - * New upstream release, with a few fixes. + * New upstream release, with a few fixes. Proper fix for CVE-2009-0840. (closes: #535340, #532446) @@ -651,7 +663,7 @@ mapserver (5.4.1-1) experimental; urgency=low - * New upstream release, with a few fixes. + * New upstream release, with a few fixes. -- Alan Boudreault Thu, 04 Jun 2009 14:51:13 -0400 @@ -660,8 +672,8 @@ [ Alan Boudreault ] * New upstream release. * Added Alan as Uploader in debian/control. - * Removed obsolete html doc generation in debian/rules and - from mapserver-doc package. + * Removed obsolete html doc generation in debian/rules and + from mapserver-doc package. [ Francesco Paolo Lovergine ] * Updated sections due to ftmpasters changes. @@ -727,15 +739,15 @@ mapserver (5.0.3-1) unstable; urgency=low * New upstream release, with a good deal of fixes. - * Changed a bit clean-first-build to make lintian happy about + * Changed a bit clean-first-build to make lintian happy about debian-rules-ignores-make-clean-error warning. -- Francesco Paolo Lovergine Sun, 08 Jun 2008 11:50:22 +0200 mapserver (5.0.2-3) unstable; urgency=high - * The setup.py script is not able to manage properly static libraries flavor - for AGG now used embedded in mapserver. The trick is explicitly linking by + * The setup.py script is not able to manage properly static libraries flavor + for AGG now used embedded in mapserver. The trick is explicitly linking by manipulating the mapscriptvars file before running setup.py. That rendered python-mapscript unusable. (closes: #483400) @@ -745,8 +757,8 @@ mapserver (5.0.2-2) unstable; urgency=low * Added embedded AGG 2.4 for use with mapserver. This is a BSD-licensed - version roughly functionally identical to current 2.5 version. - See debian/AGG for additional maintainer information about the AGG integration. + version roughly functionally identical to current 2.5 version. + See debian/AGG for additional maintainer information about the AGG integration. (closes: #448198) * Added build-deps for AGG: libsdl1.2-dev, libfreetype6-dev, libx11-dev. * Added build-dep on sharutils for AGG uuencoded distfile. @@ -831,7 +843,7 @@ - French. Closes: #435933 - Czech. Closes: #436280 - Dutch. Closes: #436853 - + -- Andreas Putzo Tue, 28 Aug 2007 08:21:59 +0000 mapserver (4.10.2-1) unstable; urgency=low @@ -1151,12 +1163,12 @@ mapserver (4.4.1-0.dgis.unstable.1) unstable; urgency=low - * update release number + * update release number * New upstram release - * Major change to rule the files for make a double build one for php + * Major change to rule the files for make a double build one for php and another one for the rest * Change dep to php4-dev - + -- Thomas Sondag Fri, 07 Jan 2005 16:16:37 +0100 mapserver (4.2.5-2) unstable; urgency=low @@ -1171,19 +1183,19 @@ * Add configure section to debian rules * configure with thread safe support - -- Thomas Sondag Fri, 29 Oct 2004 13:06:50 +0200 + -- Thomas Sondag Fri, 29 Oct 2004 13:06:50 +0200 mapserver (4.2.5-1) unstable; urgency=low - * New upstream version + * New upstream version - -- Thomas Sondag Mon, 25 Oct 2004 19:13:21 +0200 + -- Thomas Sondag Mon, 25 Oct 2004 19:13:21 +0200 mapserver (4.2.0-2) unstable; urgency=low * Build For Sarge * Removing libming support (Where is it ? not found in Sarge) - + -- Thomas Sondag Sun, 25 Jul 2004 15:45:20 +0200 mapserver (4.2.0-1) stable; urgency=low @@ -1198,12 +1210,12 @@ * adding --without-tiff for fixing problem with perl-mapscript -- Thomas Sondag Wed, 04 Feb 2004 19:24:56 +0100 - + mapserver (4.0-1) stable; urgency=low * New release - -- Thomas Sondag Sun, 12 Oct 2003 18:44:57 +0200 + -- Thomas Sondag Sun, 12 Oct 2003 18:44:57 +0200 mapserver (3.6.4-5) stable; urgency=low @@ -1213,13 +1225,13 @@ mapserver (3.6.4-4) stable; urgency=low - * hum nothing + * hum nothing -- Thomas Sondag Mon, 13 May 2003 14:17:27 +0100 mapserver (3.6.4-3) unstable; urgency=low - * Added proj + * Added proj -- Thomas Sondag Mon, 07 Feb 2003 14:17:27 +0100 diff -Nru mapserver-7.0.6/debian/control mapserver-7.0.7/debian/control --- mapserver-7.0.6/debian/control 2017-06-21 19:00:36.000000000 +0000 +++ mapserver-7.0.7/debian/control 2017-11-15 19:59:31.000000000 +0000 @@ -45,7 +45,7 @@ docbook-xml, xsltproc Build-Conflicts: libcurl3-openssl-dev -Standards-Version: 4.0.0 +Standards-Version: 4.1.1 Vcs-Browser: https://anonscm.debian.org/cgit/pkg-grass/mapserver.git Vcs-Git: https://anonscm.debian.org/git/pkg-grass/mapserver.git Homepage: http://www.mapserver.org @@ -75,7 +75,6 @@ Package: libmapserver-dbg Architecture: any Section: debug -Priority: extra Depends: libmapserver2 (= ${binary:Version}), ${misc:Depends} Breaks: libmapserver1-dbg (<< 7.0.0~) diff -Nru mapserver-7.0.6/debian/libmapserver2.symbols mapserver-7.0.7/debian/libmapserver2.symbols --- mapserver-7.0.6/debian/libmapserver2.symbols 2017-06-26 19:07:21.000000000 +0000 +++ mapserver-7.0.7/debian/libmapserver2.symbols 2017-11-15 20:00:35.000000000 +0000 @@ -1,4 +1,4 @@ -# SymbolsHelper-Confirmed: 7.0.6 arm64 i386 m68k mips mips64el mipsel powerpc powerpcspe ppc64el s390x +# SymbolsHelper-Confirmed: 7.0.7 amd64 libmapserver.so.2 #PACKAGE# #MINVER# BuildExpressionTree@Base 6.2.1 CleanVSIDir@Base 6.2.1 @@ -270,6 +270,8 @@ _ZN10ClipperLib8IsMaximaEPNS_5TEdgeEx@Base 6.2.1 _ZN10ClipperLib8IsMinimaEPNS_5TEdgeE@Base 6.2.1 _ZN10ClipperLib8PolySortEPNS_6OutRecES1_@Base 6.2.1 + _ZN10ClipperLib9ExPolygonD1Ev@Base 7.0.7 + _ZN10ClipperLib9ExPolygonD2Ev@Base 7.0.7 _ZN10ClipperLib9SwapSidesERNS_5TEdgeES1_@Base 6.2.1 _ZN10ClipperLib9TestRangeERKSt6vectorINS_8IntPointESaIS1_EE@Base 6.2.1 _ZN10ClipperLiblsERSoRNS_8IntPointE@Base 6.2.1 @@ -542,7 +544,7 @@ _ZN9mapserver25font_engine_freetype_baseD1Ev@Base 6.2.1 _ZN9mapserver25font_engine_freetype_baseD2Ev@Base 6.2.1 (optional=templinst)_ZN9mapserver25render_scanline_bin_solidINS_12scanline_binENS_13renderer_baseI10pixfmt_utfI8utfpix32NS_13row_ptr_cacheIjEELj1ELj0EEEES4_EEvRKT_RT0_RKT1_@Base 7.0.0 - (optional=templinst|arch=!amd64)_ZN9mapserver28pattern_filter_bilinear_rgbaINS_5rgba8EE14pixel_high_resEPKPKS1_PS1_ii@Base 7.0.2 + (optional=templinst)_ZN9mapserver28pattern_filter_bilinear_rgbaINS_5rgba8EE14pixel_high_resEPKPKS1_PS1_ii@Base 7.0.2 _ZN9mapserver3arc19approximation_scaleEd@Base 6.2.1 _ZN9mapserver3arc4initEddddddb@Base 6.2.1 _ZN9mapserver3arc6rewindEj@Base 6.2.1 @@ -594,26 +596,23 @@ (optional=templinst|arch=!amd64 !arm64 !hppa !mips64el !ppc64el !s390x !sparc64)_ZNSt6vectorIN10ClipperLib11DoublePointESaIS1_EE17_M_default_appendEj@Base 7.0.2 (optional=templinst|arch=!amd64 !arm64 !mips64el !ppc64el !s390x !sparc64)_ZNSt6vectorIN10ClipperLib8IntPointESaIS1_EE17_M_default_appendEj@Base 7.0.2 (optional=templinst|arch=amd64 arm64 mips64el ppc64el s390x sparc64)_ZNSt6vectorIN10ClipperLib8IntPointESaIS1_EE17_M_default_appendEm@Base 7.0.2 - (optional=templinst)_ZNSt6vectorIN10ClipperLib8IntPointESaIS1_EE19_M_emplace_back_auxIJRKS1_EEEvDpOT_@Base 7.0.2 + (optional=templinst)_ZNSt6vectorIN10ClipperLib8IntPointESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_@Base 7.0.7 (optional=templinst|subst)_ZNSt6vectorIN10ClipperLib8IntPointESaIS1_EE7reserveE{size_t}@Base 6.4.0 (optional=templinst)_ZNSt6vectorIN10ClipperLib8IntPointESaIS1_EEaSERKS3_@Base 6.2.1 (optional=templinst|arch=!amd64 !arm64 !mips64el !ppc64el !s390x !sparc64)_ZNSt6vectorIN10ClipperLib9ExPolygonESaIS1_EE17_M_default_appendEj@Base 7.0.2 (optional=templinst|arch=amd64 arm64 mips64el ppc64el s390x sparc64)_ZNSt6vectorIN10ClipperLib9ExPolygonESaIS1_EE17_M_default_appendEm@Base 7.0.2 - (optional=templinst)_ZNSt6vectorIN10ClipperLib9ExPolygonESaIS1_EE19_M_emplace_back_auxIJRKS1_EEEvDpOT_@Base 7.0.2 - (optional=templinst)_ZNSt6vectorIP10msExprNodeSaIS1_EE19_M_emplace_back_auxIJRKS1_EEEvDpOT_@Base 7.0.5 + (optional=templinst)_ZNSt6vectorIN10ClipperLib9ExPolygonESaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_@Base 7.0.7 + (optional=templinst)_ZNSt6vectorIP10msExprNodeSaIS1_EE17_M_realloc_insertIJRKS1_EEEvN9__gnu_cxx17__normal_iteratorIPS1_S3_EEDpOT_@Base 7.0.7 (optional=templinst)_ZNSt6vectorIP10msExprNodeSaIS1_EE9push_backERKS1_@Base 7.0.5 (optional=templinst)_ZNSt6vectorIP10msExprNodeSaIS1_EEaSERKS3_@Base 7.0.5 (optional=templinst|arch=!amd64 !arm64 !mips64el !ppc64el !s390x !sparc64)_ZNSt6vectorIPN10ClipperLib11HorzJoinRecESaIS2_EE17_M_default_appendEj@Base 7.0.2 - (optional=templinst|arch=amd64 arm64 mips64el ppc64el s390x sparc64)_ZNSt6vectorIPN10ClipperLib11HorzJoinRecESaIS2_EE17_M_default_appendEm@Base 7.0.2 - (optional=templinst)_ZNSt6vectorIPN10ClipperLib11HorzJoinRecESaIS2_EE19_M_emplace_back_auxIJRKS2_EEEvDpOT_@Base 7.0.2 - (optional=templinst)_ZNSt6vectorIPN10ClipperLib5TEdgeESaIS2_EE19_M_emplace_back_auxIJRKS2_EEEvDpOT_@Base 7.0.2 - (optional=templinst)_ZNSt6vectorIPN10ClipperLib6OutRecESaIS2_EE19_M_emplace_back_auxIJRKS2_EEEvDpOT_@Base 7.0.2 + (optional=templinst)_ZNSt6vectorIPN10ClipperLib5TEdgeESaIS2_EE17_M_realloc_insertIJRKS2_EEEvN9__gnu_cxx17__normal_iteratorIPS2_S4_EEDpOT_@Base 7.0.7 + (optional=templinst)_ZNSt6vectorIPN10ClipperLib6OutRecESaIS2_EE17_M_realloc_insertIJRKS2_EEEvN9__gnu_cxx17__normal_iteratorIPS2_S4_EEDpOT_@Base 7.0.7 (optional=templinst|arch=!amd64 !arm64 !mips64el !ppc64el !s390x !sparc64)_ZNSt6vectorIPN10ClipperLib7JoinRecESaIS2_EE17_M_default_appendEj@Base 7.0.2 - (optional=templinst|arch=amd64 arm64 mips64el ppc64el s390x sparc64)_ZNSt6vectorIPN10ClipperLib7JoinRecESaIS2_EE17_M_default_appendEm@Base 7.0.2 - (optional=templinst)_ZNSt6vectorIPN10ClipperLib7JoinRecESaIS2_EE19_M_emplace_back_auxIJRKS2_EEEvDpOT_@Base 7.0.2 + (optional=templinst)_ZNSt6vectorIPN10ClipperLib7JoinRecESaIS2_EE17_M_realloc_insertIJRKS2_EEEvN9__gnu_cxx17__normal_iteratorIPS2_S4_EEDpOT_@Base 7.0.7 (optional=templinst|arch=!amd64 !arm64 !mips64el !ppc64el !s390x !sparc64)_ZNSt6vectorIS_IN10ClipperLib8IntPointESaIS1_EESaIS3_EE17_M_default_appendEj@Base 7.0.2 (optional=templinst|arch=amd64 arm64 mips64el ppc64el s390x sparc64)_ZNSt6vectorIS_IN10ClipperLib8IntPointESaIS1_EESaIS3_EE17_M_default_appendEm@Base 7.0.2 - (optional=templinst)_ZNSt6vectorIS_IN10ClipperLib8IntPointESaIS1_EESaIS3_EE19_M_emplace_back_auxIJRKS3_EEEvDpOT_@Base 7.0.2 + (optional=templinst)_ZNSt6vectorIS_IN10ClipperLib8IntPointESaIS1_EESaIS3_EE17_M_realloc_insertIJRKS3_EEEvN9__gnu_cxx17__normal_iteratorIPS3_S5_EEDpOT_@Base 7.0.7 (optional=templinst)_ZNSt6vectorIS_IN10ClipperLib8IntPointESaIS1_EESaIS3_EED1Ev@Base 6.2.1 (optional=templinst)_ZNSt6vectorIS_IN10ClipperLib8IntPointESaIS1_EESaIS3_EED2Ev@Base 6.2.1 (optional=templinst)_ZNSt6vectorIS_IN10ClipperLib8IntPointESaIS1_EESaIS3_EEaSERKS5_@Base 6.2.1 @@ -1676,6 +1675,7 @@ msProcessTemplate@Base 6.2.1 msProjLibInitFromEnv@Base 7.0.0 msProjTransformer@Base 6.2.1 + msProjectHasLonWrap@Base 7.0.7 msProjectLine@Base 6.2.1 msProjectPoint@Base 6.2.1 msProjectRect@Base 6.2.1 diff -Nru mapserver-7.0.6/debian/rules mapserver-7.0.7/debian/rules --- mapserver-7.0.6/debian/rules 2017-06-26 19:06:41.000000000 +0000 +++ mapserver-7.0.7/debian/rules 2017-11-15 20:00:35.000000000 +0000 @@ -2,7 +2,7 @@ # Made with the aid of debmake, by Christoph Lameter, # based on the sample debian/rules file for GNU hello by Ian Jackson. -# Uncomment this to turn on verbose mode. +# Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This has to be exported to make some magic below work. diff -Nru mapserver-7.0.6/debian/source.lintian-overrides mapserver-7.0.7/debian/source.lintian-overrides --- mapserver-7.0.6/debian/source.lintian-overrides 1970-01-01 00:00:00.000000000 +0000 +++ mapserver-7.0.7/debian/source.lintian-overrides 2017-11-15 20:00:35.000000000 +0000 @@ -0,0 +1,6 @@ +# download.osgeo.org is not available via HTTPS +mapserver source: debian-watch-uses-insecure-uri * + +# Only a single Python version is supported during the build +mapserver source: python-foo-but-no-python3-foo python-mapscript + diff -Nru mapserver-7.0.6/mapcairo.c mapserver-7.0.7/mapcairo.c --- mapserver-7.0.6/mapcairo.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/mapcairo.c 2017-11-15 19:24:35.000000000 +0000 @@ -907,6 +907,7 @@ free(cache->pixmap_buffer); } msFree(s->renderer_cache); + s->renderer_cache = NULL; #endif } diff -Nru mapserver-7.0.6/mapcopy.c mapserver-7.0.7/mapcopy.c --- mapserver-7.0.6/mapcopy.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/mapcopy.c 2017-11-15 19:24:35.000000000 +0000 @@ -500,6 +500,7 @@ MS_COPYSTELEM(offsetx); MS_COPYSTELEM(offsety); MS_COPYSTELEM(angle); + MS_COPYSTELEM(autoangle); MS_COPYSTELEM(minvalue); MS_COPYSTELEM(maxvalue); MS_COPYSTELEM(opacity); diff -Nru mapserver-7.0.6/mapdraw.c mapserver-7.0.7/mapdraw.c --- mapserver-7.0.6/mapdraw.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/mapdraw.c 2017-11-15 19:24:35.000000000 +0000 @@ -220,7 +220,8 @@ #if defined(USE_WMS_LYR) || defined(USE_WFS_LYR) enum MS_CONNECTION_TYPE lastconnectiontype; httpRequestObj *pasOWSReqInfo=NULL; - int numOWSLayers=0, numOWSRequests=0; + int numOWSLayers=0; + int numOWSRequests=0; wmsParamsObj sLastWMSParams; #endif @@ -256,30 +257,43 @@ */ numOWSLayers=0; for(i=0; inumlayers; i++) { - if(map->layerorder[i] != -1 && - msLayerIsVisible(map, GET_LAYER(map,map->layerorder[i]))) + if(map->layerorder[i] == -1 ) + continue; + + lp = GET_LAYER(map,map->layerorder[i]); + if( lp->connectiontype != MS_WMS && + lp->connectiontype != MS_WFS ) { + continue; + } numOWSLayers++; } - if (numOWSLayers > 0) { + /* Alloc and init pasOWSReqInfo... */ - pasOWSReqInfo = (httpRequestObj *)malloc((numOWSLayers+1)*sizeof(httpRequestObj)); + pasOWSReqInfo = (httpRequestObj *)malloc(numOWSLayers*sizeof(httpRequestObj)); if (pasOWSReqInfo == NULL) { msSetError(MS_MEMERR, "Allocation of httpRequestObj failed.", "msDrawMap()"); return NULL; } - msHTTPInitRequestObj(pasOWSReqInfo, numOWSLayers+1); + msHTTPInitRequestObj(pasOWSReqInfo, numOWSLayers); msInitWmsParamsObj(&sLastWMSParams); /* Pre-download all WMS/WFS layers in parallel before starting to draw map */ lastconnectiontype = MS_SHAPEFILE; - for(i=0; numOWSLayers && inumlayers; i++) { - if(map->layerorder[i] == -1 || !msLayerIsVisible(map, GET_LAYER(map,map->layerorder[i]))) + for(i=0; inumlayers; i++) { + if(map->layerorder[i] == -1 ) continue; lp = GET_LAYER(map,map->layerorder[i]); + if( lp->connectiontype != MS_WMS && + lp->connectiontype != MS_WFS ) { + continue; + } + + if( !msLayerIsVisible(map, lp) ) + continue; #ifdef USE_WMS_LYR if(lp->connectiontype == MS_WMS) { @@ -306,9 +320,7 @@ lastconnectiontype = lp->connectiontype; } -#ifdef USE_WMS_LYR msFreeWmsParamsObj(&sLastWMSParams); -#endif } /* if numOWSLayers > 0 */ if(numOWSRequests && msOWSExecuteRequests(pasOWSReqInfo, numOWSRequests, map, MS_TRUE) == MS_FAILURE) { @@ -582,17 +594,8 @@ if(layer->type == MS_LAYER_QUERY || layer->type == MS_LAYER_TILEINDEX) return(MS_FALSE); if((layer->status != MS_ON) && (layer->status != MS_DEFAULT)) return(MS_FALSE); - /* Only return MS_FALSE if it is definitely false. Sometimes it will return MS_UNKNOWN, which we - ** consider true, for this use case (it might be visible, try and draw it, see what happens). */ - if ( msExtentsOverlap(map, layer) == MS_FALSE ) { - if( layer->debug >= MS_DEBUGLEVEL_V ) { - msDebug("msLayerIsVisible(): Skipping layer (%s) because LAYER.EXTENT does not intersect MAP.EXTENT\n", layer->name); - } - return(MS_FALSE); - } - - if(msEvalContext(map, layer, layer->requires) == MS_FALSE) return(MS_FALSE); - + /* Do comparisons of layer scale vs map scale now, since msExtentsOverlap() */ + /* can be slow */ if(map->scaledenom > 0) { /* layer scale boundaries should be checked first */ @@ -602,13 +605,27 @@ } return(MS_FALSE); } - if((layer->minscaledenom > 0) && (map->scaledenom <= layer->minscaledenom)) { + if(/*(layer->minscaledenom > 0) &&*/ (map->scaledenom <= layer->minscaledenom)) { if( layer->debug >= MS_DEBUGLEVEL_V ) { msDebug("msLayerIsVisible(): Skipping layer (%s) because LAYER.MINSCALE is too large for this MAP scale\n", layer->name); } return(MS_FALSE); } - + } + + /* Only return MS_FALSE if it is definitely false. Sometimes it will return MS_UNKNOWN, which we + ** consider true, for this use case (it might be visible, try and draw it, see what happens). */ + if ( msExtentsOverlap(map, layer) == MS_FALSE ) { + if( layer->debug >= MS_DEBUGLEVEL_V ) { + msDebug("msLayerIsVisible(): Skipping layer (%s) because LAYER.EXTENT does not intersect MAP.EXTENT\n", layer->name); + } + return(MS_FALSE); + } + + if(msEvalContext(map, layer, layer->requires) == MS_FALSE) return(MS_FALSE); + + if(map->scaledenom > 0) { + /* now check class scale boundaries (all layers *must* pass these tests) */ if(layer->numclasses > 0) { for(i=0; inumclasses; i++) { @@ -939,8 +956,100 @@ 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 */ + if((map->projection.numargs > 0) && (layer->projection.numargs > 0)) { + int bDone = MS_FALSE; + + /* For UVRaster, it is important that the searchrect is not too large */ + /* to avoid insufficient intermediate raster resolution, which could */ + /* happen if we use the default code path, given potential reprojection */ + /* issues when using a map extent that is not in the validity area of */ + /* the layer projection. */ + if( layer->connectiontype == MS_UVRASTER && + !layer->projection.gt.need_geotransform && + !(pj_is_latlong(map->projection.proj) && + pj_is_latlong(layer->projection.proj)) ) { + rectObj layer_ori_extent; + + if( msLayerGetExtent(layer, &layer_ori_extent) == MS_SUCCESS ) { + projectionObj map_proj; + + double map_extent_minx = map->extent.minx; + double map_extent_miny = map->extent.miny; + double map_extent_maxx = map->extent.maxx; + double map_extent_maxy = map->extent.maxy; + rectObj layer_extent = layer_ori_extent; + + /* Create a variant of map->projection without geotransform for */ + /* conveniency */ + msInitProjection(&map_proj); + msCopyProjection(&map_proj, &map->projection); + map_proj.gt.need_geotransform = MS_FALSE; + if( map->projection.gt.need_geotransform ) { + map_extent_minx = map->projection.gt.geotransform[0] + + map->projection.gt.geotransform[1] * map->extent.minx + + map->projection.gt.geotransform[2] * map->extent.miny; + map_extent_miny = map->projection.gt.geotransform[3] + + map->projection.gt.geotransform[4] * map->extent.minx + + map->projection.gt.geotransform[5] * map->extent.miny; + map_extent_maxx = map->projection.gt.geotransform[0] + + map->projection.gt.geotransform[1] * map->extent.maxx + + map->projection.gt.geotransform[2] * map->extent.maxy; + map_extent_maxy = map->projection.gt.geotransform[3] + + map->projection.gt.geotransform[4] * map->extent.maxx + + map->projection.gt.geotransform[5] * map->extent.maxy; + } + + /* Reproject layer extent to map projection */ + msProjectRect(&layer->projection, &map_proj, &layer_extent); + + if( layer_extent.minx <= map_extent_minx && + layer_extent.miny <= map_extent_miny && + layer_extent.maxx >= map_extent_maxx && + layer_extent.maxy >= map_extent_maxy ) { + /* do nothing special if area to map is inside layer extent */ + } + else { + if( layer_extent.minx >= map_extent_minx && + layer_extent.maxx <= map_extent_maxx && + layer_extent.miny >= map_extent_miny && + layer_extent.maxy <= map_extent_maxy ) { + /* if the area to map is larger than the layer extent, then */ + /* use full layer extent and add some margin to reflect the */ + /* proportion of the useful area over the requested bbox */ + double extra_x = + (map_extent_maxx - map_extent_minx) / + (layer_extent.maxx - layer_extent.minx) * + (layer_ori_extent.maxx - layer_ori_extent.minx); + double extra_y = + (map_extent_maxy - map_extent_miny) / + (layer_extent.maxy - layer_extent.miny) * + (layer_ori_extent.maxy - layer_ori_extent.miny); + searchrect.minx = layer_ori_extent.minx - extra_x / 2; + searchrect.maxx = layer_ori_extent.maxx + extra_x / 2; + searchrect.miny = layer_ori_extent.miny - extra_y / 2; + searchrect.maxy = layer_ori_extent.maxy + extra_y / 2; + } + else + { + /* otherwise clip the map extent with the reprojected layer */ + /* extent */ + searchrect.minx = MAX( map_extent_minx, layer_extent.minx ); + searchrect.maxx = MIN( map_extent_maxx, layer_extent.maxx ); + searchrect.miny = MAX( map_extent_miny, layer_extent.miny ); + searchrect.maxy = MIN( map_extent_maxy, layer_extent.maxy ); + /* and reproject into the layer projection */ + msProjectRect(&map_proj, &layer->projection, &searchrect); + } + bDone = MS_TRUE; + } + + msFreeProjection(&map_proj); + } + } + + if( !bDone ) + msProjectRect(&map->projection, &layer->projection, &searchrect); /* project the searchrect to source coords */ + } #endif } else { searchrect.minx = searchrect.miny = 0; diff -Nru mapserver-7.0.6/mapfile.c mapserver-7.0.7/mapfile.c --- mapserver-7.0.6/mapfile.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/mapfile.c 2017-11-15 19:24:35.000000000 +0000 @@ -7140,6 +7140,25 @@ return; } +static void applyHashTableDefaultSubstitutions(hashTableObj *hashTab, hashTableObj *table) +{ + int i; + const char *default_key = msFirstKeyFromHashTable(table); + while (default_key) { + if (!strncmp(default_key, "default_", 8)) { + size_t buffer_size = (strlen(default_key) - 5); + char *to = msLookupHashTable(table, default_key); + char *tag = (char *)msSmallMalloc(buffer_size); + snprintf(tag, buffer_size, "%%%s%%", &(default_key[8])); + + hashTableSubstituteString(hashTab, tag, to); + free(tag); + } + default_key = msNextKeyFromHashTable(table, default_key); + } + return; +} + /* ** Loop through layer metadata for keys that have a default_%key% pattern to replace ** remaining %key% entries by their default value. @@ -7165,6 +7184,7 @@ applyLayerDefaultSubstitutions(layer, &(layer->validation)); /* ...then layer settings... */ applyLayerDefaultSubstitutions(layer, &(map->web.validation)); /* ...and finally web settings */ } + applyHashTableDefaultSubstitutions(&map->web.metadata, &(map->web.validation)); } char *_get_param_value(const char *key, char **names, char **values, int npairs) { diff -Nru mapserver-7.0.6/maphttp.c mapserver-7.0.7/maphttp.c --- mapserver-7.0.6/maphttp.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/maphttp.c 2017-11-15 19:24:35.000000000 +0000 @@ -113,11 +113,6 @@ * Should be called on a new array of httpRequestObj to initialize them * for use with msHTTPExecuteRequest(), etc. * - * Note that users of this module should always allocate and init one - * more instance of httpRequestObj in their array than what they plan to - * use because the terminate_handler() needs the last entry in the array - * to have reqObj->request == NULL - * **********************************************************************/ void msHTTPInitRequestObj(httpRequestObj *pasReqInfo, int numRequests) { diff -Nru mapserver-7.0.6/mapimageio.c mapserver-7.0.7/mapimageio.c --- mapserver-7.0.6/mapimageio.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/mapimageio.c 2017-11-15 19:24:35.000000000 +0000 @@ -206,11 +206,16 @@ cinfo.optimize_coding = TRUE; if( arithmetic || optimized ) { - if (map == NULL || msGetConfigOption(map, "JPEGMEM") == NULL) { - /* If the user doesn't provide a value for JPEGMEM, we want to be sure */ - /* that at least the image size will be used before creating the temporary file */ - cinfo.mem->max_memory_to_use = - MS_MAX(cinfo.mem->max_memory_to_use, cinfo.input_components * rb->width * rb->height); + /* libjpeg turbo 1.5.2 honours max_memory_to_use, but has no backing */ + /* store implementation, so better not set max_memory_to_use ourselves. */ + /* See https://github.com/libjpeg-turbo/libjpeg-turbo/issues/162 */ + if( cinfo.mem->max_memory_to_use > 0 ) { + if (map == NULL || msGetConfigOption(map, "JPEGMEM") == NULL) { + /* If the user doesn't provide a value for JPEGMEM, we want to be sure */ + /* that at least the image size will be used before creating the temporary file */ + cinfo.mem->max_memory_to_use = + MS_MAX(cinfo.mem->max_memory_to_use, cinfo.input_components * rb->width * rb->height); + } } } diff -Nru mapserver-7.0.6/maplayer.c mapserver-7.0.7/maplayer.c --- mapserver-7.0.6/maplayer.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/maplayer.c 2017-11-15 19:24:35.000000000 +0000 @@ -229,7 +229,8 @@ if(layer->tileindex && layer->connectiontype == MS_SHAPEFILE) layer->connectiontype = MS_TILED_SHAPEFILE; - if(layer->type == MS_LAYER_RASTER && layer->connectiontype != MS_WMS) + if(layer->type == MS_LAYER_RASTER && layer->connectiontype != MS_WMS + && layer->connectiontype != MS_KERNELDENSITY) layer->connectiontype = MS_RASTER; if ( ! layer->vtable) { @@ -1564,7 +1565,7 @@ int msLayerSupportsSorting(layerObj *layer) { if (layer && ( - (layer->connectiontype == MS_OGR) || (layer->connectiontype == MS_POSTGIS) || (layer->connectiontype == MS_ORACLESPATIAL) + (layer->connectiontype == MS_OGR) || (layer->connectiontype == MS_POSTGIS) || (layer->connectiontype == MS_ORACLESPATIAL) || ((layer->connectiontype == MS_PLUGIN) && (strstr(layer->plugin_library,"msplugin_oracle") != NULL)) ) ) return MS_TRUE; @@ -1880,7 +1881,8 @@ if(layer->tileindex && layer->connectiontype == MS_SHAPEFILE) layer->connectiontype = MS_TILED_SHAPEFILE; - if(layer->type == MS_LAYER_RASTER && layer->connectiontype != MS_WMS) + if(layer->type == MS_LAYER_RASTER && layer->connectiontype != MS_WMS + && layer->connectiontype != MS_KERNELDENSITY) layer->connectiontype = MS_RASTER; switch(layer->connectiontype) { @@ -1903,6 +1905,10 @@ /* WMS should be treated as a raster layer */ return(msRASTERLayerInitializeVirtualTable(layer)); break; + case(MS_KERNELDENSITY): + /* KERNELDENSITY should be treated as a raster layer */ + return(msRASTERLayerInitializeVirtualTable(layer)); + break; case(MS_ORACLESPATIAL): return(msOracleSpatialLayerInitializeVirtualTable(layer)); break; diff -Nru mapserver-7.0.6/mapogcsld.c mapserver-7.0.7/mapogcsld.c --- mapserver-7.0.6/mapogcsld.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/mapogcsld.c 2017-11-15 19:24:35.000000000 +0000 @@ -329,7 +329,7 @@ /* opacity for sld raster */ if (GET_LAYER(map, i)->type == MS_LAYER_RASTER && - pasLayers[i].compositer && pasLayers[j].compositer->opacity != 100) + pasLayers[j].compositer && pasLayers[j].compositer->opacity != 100) msSetLayerOpacity(GET_LAYER(map, i), pasLayers[j].compositer->opacity); /* mark as auto-generate SLD */ diff -Nru mapserver-7.0.6/mapogcsos.c mapserver-7.0.7/mapogcsos.c --- mapserver-7.0.6/mapogcsos.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/mapogcsos.c 2017-11-15 19:24:35.000000000 +0000 @@ -1340,6 +1340,8 @@ break; } + lp = (GET_LAYER(map, j)); + /*description*/ value = msOWSLookupMetadata(&(lp->metadata), "S", "offering_description"); @@ -1349,7 +1351,6 @@ xmlAddSibling(psNode, xmlNewComment(BAD_CAST "WARNING: Optional metadata \"sos_offering_description\" missing for gml:description")); /*name*/ - lp = (GET_LAYER(map, j)); /*first layer*/ value = msOWSLookupMetadata(&(lp->metadata), "S", "offering_name"); if (value) psNode = xmlNewChild(psOfferingNode, psNsGml, BAD_CAST "name", BAD_CAST value); diff -Nru mapserver-7.0.6/mapogroutput.c mapserver-7.0.7/mapogroutput.c --- mapserver-7.0.6/mapogroutput.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/mapogroutput.c 2017-11-15 19:24:35.000000000 +0000 @@ -767,6 +767,7 @@ /* Create a subdirectory to handle this request. */ /* -------------------------------------------------------------------- */ if( !EQUAL(storage,"stream") ) { + const char* dir_to_create; if (strlen(base_dir) > 0) request_dir = msTmpFile(map, NULL, base_dir, "" ); else @@ -775,11 +776,19 @@ if( request_dir[strlen(request_dir)-1] == '.' ) request_dir[strlen(request_dir)-1] = '\0'; - if( VSIMkdir( request_dir, 0777 ) != 0 ) { + dir_to_create = request_dir; + /* Workaround issue in GDAL versions released at this time : + * GDAL issue fixed per https://trac.osgeo.org/gdal/ticket/6991 */ + if( EQUAL(storage,"memory") && EQUAL(format->driver+4, "ESRI Shapefile") ) + { + dir_to_create = base_dir; + } + + if( VSIMkdir( dir_to_create, 0777 ) != 0 ) { msSetError( MS_MISCERR, "Attempt to create directory '%s' failed.", "msOGRWriteFromQuery()", - request_dir ); + dir_to_create ); return MS_FAILURE; } } else diff -Nru mapserver-7.0.6/maporaclespatial.c mapserver-7.0.7/maporaclespatial.c --- mapserver-7.0.6/maporaclespatial.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/maporaclespatial.c 2017-11-15 19:24:35.000000000 +0000 @@ -1707,7 +1707,7 @@ } /* end of not-null-object if */ if (compound_type){ - if(gtype == 2003) + if (gtype == 2003 || gtype == 2007) shape->type = MS_SHAPE_POLYGON; msFreeShape(&newshape); } @@ -2019,7 +2019,7 @@ /* define SQL query */ for( i=0; i < layer->numitems; ++i ) { - snprintf( query_str + strlen(query_str), sizeof(query_str)-strlen(query_str), "%s, ", layer->items[i] ); + snprintf( query_str + strlen(query_str), sizeof(query_str)-strlen(query_str), "\"%s\", ", layer->items[i] ); } /*we add the uniqueid if it was not part of the current item list*/ @@ -3956,7 +3956,7 @@ assert(layer != NULL); assert(vtable != NULL); - layer->vtable->LayerTranslateFilter = msOracleSpatialLayerTranslateFilter; + vtable->LayerTranslateFilter = msOracleSpatialLayerTranslateFilter; vtable->LayerInitItemInfo = msOracleSpatialLayerInitItemInfo; @@ -3975,7 +3975,7 @@ vtable->LayerApplyFilterToLayer = msLayerApplyCondSQLFilterToLayer; vtable->LayerSetTimeFilter = msLayerMakeBackticsTimeFilter; //vtable->LayerSetTimeFilter = msOracleSpatialLayerSetTimeFilter; - vtable->LayerEscapePropertyName = msOracleSpatialEscapePropertyName; + //vtable->LayerEscapePropertyName = msOracleSpatialEscapePropertyName; /* layer->vtable->LayerGetNumFeatures, use default */ /* layer->vtable->LayerGetAutoProjection = msOracleSpatialLayerGetAutoProjection; Disabled until tested */ vtable->LayerEnablePaging = msOracleSpatialEnablePaging; @@ -4009,7 +4009,7 @@ layer->vtable->LayerApplyFilterToLayer = msLayerApplyCondSQLFilterToLayer; layer->vtable->LayerSetTimeFilter = msLayerMakeBackticsTimeFilter; //layer->vtable->LayerSetTimeFilter = msOracleSpatialLayerSetTimeFilter; - layer->vtable->LayerEscapePropertyName = msOracleSpatialEscapePropertyName; + //layer->vtable->LayerEscapePropertyName = msOracleSpatialEscapePropertyName; /* layer->vtable->LayerCreateItems, use default */ /* layer->vtable->LayerGetNumFeatures, use default */ /* layer->vtable->LayerGetAutoProjection = msOracleSpatialLayerGetAutoProjection; Disabled until tested */ diff -Nru mapserver-7.0.6/mapproject.c mapserver-7.0.7/mapproject.c --- mapserver-7.0.6/mapproject.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/mapproject.c 2017-11-15 19:24:35.000000000 +0000 @@ -930,7 +930,7 @@ /* logic. */ /* -------------------------------------------------------------------- */ if( out && pj_is_latlong(out->proj) && in && !pj_is_latlong(in->proj) - && rect->maxx - rect->minx > 360.0 ) { + && rect->maxx - rect->minx > 360.0 && !out->gt.need_geotransform ) { rect->maxx = 180; rect->minx = -180; } @@ -943,6 +943,32 @@ } /************************************************************************/ +/* msProjectHasLonWrap() */ +/************************************************************************/ + +int msProjectHasLonWrap(projectionObj *in, double* pdfLonWrap) +{ + int i; + if( pdfLonWrap ) + *pdfLonWrap = 0; +#if USE_PROJ + if( !pj_is_latlong(in->proj) ) + return MS_FALSE; +#endif + for( i = 0; i < in->numargs; i++ ) + { + if( strncmp(in->args[i], "lon_wrap=", + strlen("lon_wrap=")) == 0 ) + { + if( pdfLonWrap ) + *pdfLonWrap = atof(in->args[i] + strlen("lon_wrap=")); + return MS_TRUE; + } + } + return MS_FALSE; +} + +/************************************************************************/ /* msProjectRect() */ /************************************************************************/ @@ -953,7 +979,10 @@ #else char *over = "+over"; int ret; + int bFreeInOver = MS_FALSE; + int bFreeOutOver = MS_FALSE; projectionObj in_over,out_over,*inp,*outp; + double dfLonWrap = 0.0; #if USE_PROJ /* Detect projecting from north polar stereographic to longlat */ @@ -988,6 +1017,14 @@ } #endif + if(in && msProjectHasLonWrap(in, &dfLonWrap) && dfLonWrap == 180.0) { + inp = in; + outp = out; + if( rect->maxx > 180.0 ) { + rect->minx = -180.0; + rect->maxx = 180.0; + } + } /* * Issue #4892: When projecting a rectangle we do not want proj to wrap resulting * coordinates around the dateline, as in practice a requested bounding box of @@ -997,24 +1034,28 @@ * To enforce this, we clone the input projections and add the "+over" proj * parameter in order to disable dateline wrapping. */ - if(out) { - msInitProjection(&out_over); - msCopyProjectionExtended(&out_over,out,&over,1); - outp = &out_over; - } else { - outp = out; - } - if(in) { - msInitProjection(&in_over); - msCopyProjectionExtended(&in_over,in,&over,1); - inp = &in_over; - } else { - inp = in; + else { + if(out) { + bFreeOutOver = MS_TRUE; + msInitProjection(&out_over); + msCopyProjectionExtended(&out_over,out,&over,1); + outp = &out_over; + } else { + outp = out; + } + if(in) { + bFreeInOver = MS_TRUE; + msInitProjection(&in_over); + msCopyProjectionExtended(&in_over,in,&over,1); + inp = &in_over; + } else { + inp = in; + } } ret = msProjectRectAsPolygon(inp,outp, rect ); - if(in) + if(bFreeInOver) msFreeProjection(&in_over); - if(out) + if(bFreeOutOver) msFreeProjection(&out_over); return ret; #endif @@ -1132,7 +1173,11 @@ int ret; ret = msProjectionsDifferInternal(proj1, proj2); - if( ret ) + if( ret && + /* to speed up things, do normalization only if one proj is */ + /* likely of the form init=epsg:XXX and the other proj=XXX datum=YYY... */ + ( (proj1->numargs == 1 && proj2->numargs > 1) || + (proj1->numargs > 1 && proj2->numargs == 1) ) ) { projectionObj* p1normalized; projectionObj* p2normalized; diff -Nru mapserver-7.0.6/mapproject.h mapserver-7.0.7/mapproject.h --- mapserver-7.0.6/mapproject.h 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/mapproject.h 2017-11-15 19:24:35.000000000 +0000 @@ -108,6 +108,8 @@ /*utility functions */ MS_DLL_EXPORT int GetMapserverUnitUsingProj(projectionObj *psProj); + + int msProjectHasLonWrap(projectionObj *in, double* pdfLonWrap); #endif #ifdef __cplusplus diff -Nru mapserver-7.0.6/maprasterquery.c mapserver-7.0.7/maprasterquery.c --- mapserver-7.0.6/maprasterquery.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/maprasterquery.c 2017-11-15 19:24:35.000000000 +0000 @@ -193,7 +193,7 @@ /* We need to do this or the layer->layerinfo will be interpreted */ /* as shapefile access info because the default connectiontype is */ /* MS_SHAPEFILE. */ - if (layer->connectiontype != MS_WMS) + if (layer->connectiontype != MS_WMS && layer->connectiontype != MS_KERNELDENSITY) layer->connectiontype = MS_RASTER; rlinfo->query_result_hard_max = 1000000; diff -Nru mapserver-7.0.6/mapregex.c mapserver-7.0.7/mapregex.c --- mapserver-7.0.6/mapregex.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/mapregex.c 2017-11-15 19:24:35.000000000 +0000 @@ -45,7 +45,7 @@ /*Need to specify this so that mapregex.h doesn't defined constants and doesn't #define away our ms_*/ -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) && _MSC_VER < 1900 #define off_t long #endif diff -Nru mapserver-7.0.6/maprendering.c mapserver-7.0.7/maprendering.c --- mapserver-7.0.6/maprendering.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/maprendering.c 2017-11-15 19:24:35.000000000 +0000 @@ -1026,6 +1026,7 @@ int g; double ox, oy; double cosa,sina; + int ret; if(ts->rotation != 0) { cosa = cos(ts->rotation); sina = sin(ts->rotation); @@ -1048,9 +1049,11 @@ ts_shadow->textpath->glyphs[g].pnt.y += oy; } - renderer->renderGlyphs(image,ts_shadow->textpath,&ts->label->shadowcolor,NULL,0); + ret = renderer->renderGlyphs(image,ts_shadow->textpath,&ts->label->shadowcolor,NULL,0); freeTextSymbol(ts_shadow); msFree(ts_shadow); + if( ret != MS_SUCCESS ) + return ret; } if(MS_VALID_COLOR(ts->label->color)) diff -Nru mapserver-7.0.6/mapresample.c mapserver-7.0.7/mapresample.c --- mapserver-7.0.6/mapresample.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/mapresample.c 2017-11-15 19:24:35.000000000 +0000 @@ -1136,18 +1136,8 @@ /* -------------------------------------------------------------------- */ if( bOutInit && pj_is_latlong(psSrcProj->proj) ) { - int bHasLonWrap = MS_FALSE; double dfLonWrap = 0; - for( i = 0; i < psSrcProj->numargs; i++ ) - { - if( strncmp(psSrcProj->args[i], "lon_wrap=", - strlen("lon_wrap=")) == 0 ) - { - bHasLonWrap = MS_TRUE; - dfLonWrap = atof( psSrcProj->args[i] + strlen("lon_wrap=") ); - break; - } - } + int bHasLonWrap = msProjectHasLonWrap(psSrcProj, &dfLonWrap); if( bHasLonWrap ) { @@ -1366,14 +1356,47 @@ /* -------------------------------------------------------------------- */ if( CSLFetchBoolean( layer->processing, "LOAD_WHOLE_IMAGE", FALSE ) ) bSuccess = FALSE; - else + else { bSuccess = msTransformMapToSource( nDstXSize, nDstYSize, adfDstGeoTransform, &(map->projection), nSrcXSize, nSrcYSize,adfInvSrcGeoTransform, &(layer->projection), &sSrcExtent, FALSE ); - + if (bSuccess) { + /* -------------------------------------------------------------------- */ + /* Repeat transformation for a rectangle interior to the output */ + /* requested region. If the latter results in a more extreme y */ + /* extent, then extend extents in source layer projection to */ + /* southern/northing bounds and entire x extent. */ + /* -------------------------------------------------------------------- */ + memcpy( &sOrigSrcExtent, &sSrcExtent, sizeof(sSrcExtent) ); + adfDstGeoTransform[0] = adfDstGeoTransform[0] + adfDstGeoTransform[1]; + adfDstGeoTransform[3] = adfDstGeoTransform[3] + adfDstGeoTransform[5]; + bSuccess = + msTransformMapToSource( nDstXSize-2, nDstYSize-2, adfDstGeoTransform, + &(map->projection), + nSrcXSize, nSrcYSize,adfInvSrcGeoTransform, + &(layer->projection), + &sSrcExtent, FALSE ); + /* Reset this array to its original value! */ + memcpy( adfDstGeoTransform, map->gt.geotransform, sizeof(double)*6 ); + + if (bSuccess) { + if (sSrcExtent.maxy > sOrigSrcExtent.maxy || sSrcExtent.miny < sOrigSrcExtent.miny) { + msDebug( "msTransformMapToSource(): extending bounds.\n"); + sOrigSrcExtent.minx = 0; + sOrigSrcExtent.maxx = nSrcXSize; + if (sSrcExtent.maxy > sOrigSrcExtent.maxy) + sOrigSrcExtent.maxy = nSrcYSize; + if (sSrcExtent.miny < sOrigSrcExtent.miny) + sOrigSrcExtent.miny = 0; + } + } + memcpy( &sSrcExtent, &sOrigSrcExtent, sizeof(sOrigSrcExtent) ); + bSuccess = TRUE; + } + } /* -------------------------------------------------------------------- */ /* If the transformation failed, it is likely that we have such */ /* broad extents that the projection transformation failed at */ diff -Nru mapserver-7.0.6/mapscript/csharp/CMakeLists.txt mapserver-7.0.7/mapscript/csharp/CMakeLists.txt --- mapserver-7.0.6/mapscript/csharp/CMakeLists.txt 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/mapscript/csharp/CMakeLists.txt 2017-11-15 19:24:35.000000000 +0000 @@ -44,8 +44,10 @@ ADD_CUSTOM_COMMAND(TARGET csharpmapscript WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} POST_BUILD - COMMAND copy /Y ..\\..\\..\\mapscript\\csharp\\mapscript.snk - COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /t:library /out:mapscript_csharp.dll ${KEYFILE_SPEC} *.cs ${PROJECT_SOURCE_DIR}\\mapscript\\csharp\\config\\AssemblyInfo.cs + COMMAND set MAPSCRIPT_SNK=${PROJECT_SOURCE_DIR}\\mapscript\\csharp\\mapscript.snk + COMMAND set MAPSCRIPT_SNK=%MAPSCRIPT_SNK:/=\\% + COMMAND copy /Y \"%MAPSCRIPT_SNK%\" + COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /t:library /out:mapscript_csharp.dll ${KEYFILE_SPEC} *.cs ${PROJECT_SOURCE_DIR}\\mapscript\\csharp\\config\\AssemblyInfo.cs COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /r:mapscript_csharp.dll /out:shpdump.exe ${PROJECT_SOURCE_DIR}\\mapscript\\csharp\\examples\\shpdump.cs COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /r:mapscript_csharp.dll /out:drawmap.exe ${PROJECT_SOURCE_DIR}\\mapscript\\csharp\\examples\\drawmap.cs COMMAND ${CSHARP_COMPILER} ${PLATFORM_TARGET} /r:mapscript_csharp.dll /out:shapeinfo.exe ${PROJECT_SOURCE_DIR}\\mapscript\\csharp\\examples\\shapeinfo.cs diff -Nru mapserver-7.0.6/mapserver.h mapserver-7.0.7/mapserver.h --- mapserver-7.0.6/mapserver.h 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/mapserver.h 2017-11-15 19:24:35.000000000 +0000 @@ -1123,6 +1123,16 @@ labelLeaderObj *leader; }; + +#ifdef SWIG +#ifdef __cplusplus +extern "C" { +#endif +typedef struct labelObj labelObj; +#ifdef __cplusplus +} +#endif +#endif #ifndef SWIG /* lightweight structure containing information to render a labelObj */ diff -Nru mapserver-7.0.6/maputil.c mapserver-7.0.7/maputil.c --- mapserver-7.0.6/maputil.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/maputil.c 2017-11-15 19:24:35.000000000 +0000 @@ -2260,6 +2260,14 @@ if( ! (layer->projection.numargs > 0) ) return msRectOverlap( &(map->extent), &(layer->extent) ); + /* In the case where map and layer projections are identical, and the */ + /* bounding boxes don't cross the dateline, do simple rectangle comparison */ + if( map->extent.minx < map->extent.maxx && + layer->extent.minx < layer->extent.maxx && + !msProjectionsDiffer(&(map->projection), &(layer->projection)) ) { + return msRectOverlap( &(map->extent), &(layer->extent) ); + } + /* We need to transform our rectangles for comparison, ** so we will work with copies and leave the originals intact. */ MS_COPYRECT(&map_extent, &(map->extent) ); diff -Nru mapserver-7.0.6/mapuvraster.c mapserver-7.0.7/mapuvraster.c --- mapserver-7.0.6/mapuvraster.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/mapuvraster.c 2017-11-15 19:24:35.000000000 +0000 @@ -345,7 +345,8 @@ int width, height, u_src_off, v_src_off, i, x, y; char **alteredProcessing = NULL, *saved_layer_mask; char **savedProcessing = NULL; - + int bHasLonWrap = MS_FALSE; + double dfLonWrap = 0.0; if (layer->debug) msDebug("Entering msUVRASTERLayerWhichShapes().\n"); @@ -389,10 +390,6 @@ map_cellsize = MS_MAX(MS_CELLSIZE(rect.minx, rect.maxx,layer->map->width), MS_CELLSIZE(rect.miny,rect.maxy,layer->map->height)); map_tmp->cellsize = map_cellsize*spacing; - - if (layer->debug) - msDebug("msUVRASTERLayerWhichShapes(): width: %d, height: %d, cellsize: %g\n", - width, height, map_tmp->cellsize); /* Initialize our dummy map */ MS_INIT_COLOR(map_tmp->imagecolor, 255,255,255,255); @@ -419,7 +416,55 @@ map_tmp->extent.maxy = map_tmp->extent.miny+((height-1)*map_tmp->cellsize); map_tmp->gt.rotation_angle = 0.0; - msCopyProjection(&map_tmp->projection, &layer->projection); + /* Custom msCopyProjection() that removes lon_wrap parameter */ + { +#ifdef USE_PROJ + int i; + + map_tmp->projection.numargs = 0; + map_tmp->projection.gt = layer->projection.gt; + map_tmp->projection.automatic = layer->projection.automatic; + + for (i = 0; i < layer->projection.numargs; i++) { + if( strncmp(layer->projection.args[i], "lon_wrap=", + strlen("lon_wrap=")) == 0 ) { + bHasLonWrap = MS_TRUE; + dfLonWrap = atof( layer->projection.args[i] + strlen("lon_wrap=") ); + } + else { + map_tmp->projection.args[map_tmp->projection.numargs ++] = + msStrdup(layer->projection.args[i]); + } + } + if (map_tmp->projection.numargs != 0) { + msProcessProjection(&(map_tmp->projection)); + } +#endif + map_tmp->projection.wellknownprojection = layer->projection.wellknownprojection; + } + + if( bHasLonWrap && dfLonWrap == 180.0) { + if( map_tmp->extent.minx >= 180 ) { + /* Request on the right half of the shifted raster (= western hemisphere) */ + map_tmp->extent.minx -= 360; + map_tmp->extent.maxx -= 360; + } + else if( map_tmp->extent.maxx >= 180.0 ) { + /* Request spanning on the 2 hemispheres => drawing whole planet */ + /* Take only into account vertical resolution, as horizontal one */ + /* will be unreliable (assuming square pixels...) */ + map_cellsize = MS_CELLSIZE(rect.miny,rect.maxy,layer->map->height); + map_tmp->cellsize = map_cellsize*spacing; + + width = 360.0 / map_tmp->cellsize; + map_tmp->extent.minx = -180.0+(0.5*map_tmp->cellsize); + map_tmp->extent.maxx = 180.0-(0.5*map_tmp->cellsize); + } + } + + if (layer->debug) + msDebug("msUVRASTERLayerWhichShapes(): width: %d, height: %d, cellsize: %g\n", + width, height, map_tmp->cellsize); if (layer->debug == 5) msDebug("msUVRASTERLayerWhichShapes(): extent: %g %g %g %g\n", @@ -653,6 +698,8 @@ msTryBuildPath3(szPath, map->mappath, map->shapepath, layer->data); decrypted_path = msDecryptStringTokens( map, szPath ); + GDALAllRegister(); + msAcquireLock( TLOCK_GDAL ); if( decrypted_path ) { hDS = GDALOpen(decrypted_path, GA_ReadOnly ); diff -Nru mapserver-7.0.6/mapwcs11.c mapserver-7.0.7/mapwcs11.c --- mapserver-7.0.6/mapwcs11.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/mapwcs11.c 2017-11-15 19:24:35.000000000 +0000 @@ -720,21 +720,29 @@ /* -------------------------------------------------------------------- */ { char format_buf[500]; + projectionObj proj; + double x0 = cm.geotransform[0]+cm.geotransform[1]/2+cm.geotransform[2]/2; + double y0 = cm.geotransform[3]+cm.geotransform[4]/2+cm.geotransform[5]/2; + double resx = cm.geotransform[1]; + double resy = cm.geotransform[5]; + + msInitProjection( &proj ); + if( msLoadProjectionString( &proj, cm.srs_urn ) == 0 ) { + msAxisNormalizePoints( &proj, 1, &x0, &y0 ); + msAxisNormalizePoints( &proj, 1, &resx, &resy ); + } + msFreeProjection( &proj ); psGridCRS = xmlNewChild( psSD, NULL, BAD_CAST "GridCRS", NULL ); - xmlNewChild( psGridCRS, NULL, BAD_CAST "GridBaseCRS", BAD_CAST cm.srs_urn ); xmlNewChild( psGridCRS, NULL, BAD_CAST "GridType", BAD_CAST "urn:ogc:def:method:WCS:1.1:2dSimpleGrid" ); - sprintf( format_buf, "%.15g %.15g", - cm.geotransform[0]+cm.geotransform[1]/2+cm.geotransform[2]/2, - cm.geotransform[3]+cm.geotransform[4]/2+cm.geotransform[5]/2); + sprintf( format_buf, "%.15g %.15g", x0, y0 ); xmlNewChild( psGridCRS, NULL, BAD_CAST "GridOrigin", BAD_CAST format_buf ); - sprintf( format_buf, "%.15g %.15g", - cm.geotransform[1], cm.geotransform[5] ); + sprintf( format_buf, "%.15g %.15g", resx, resy ); xmlNewChild( psGridCRS, NULL, BAD_CAST "GridOffsets", BAD_CAST format_buf ); xmlNewChild( psGridCRS, NULL, BAD_CAST "GridCS", diff -Nru mapserver-7.0.6/mapwcs20.c mapserver-7.0.7/mapwcs20.c --- mapserver-7.0.6/mapwcs20.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/mapwcs20.c 2017-11-15 19:24:35.000000000 +0000 @@ -2009,12 +2009,18 @@ { xmlNodePtr psDomainSet, psGrid, psLimits, psGridEnvelope, psOrigin, psOffsetX, psOffsetY; - char low[100], high[100], id[100], point[100], resx[100], resy[100], axisLabels[100]; + char low[100], high[100], id[100], point[100]; + char offsetVector1[100], offsetVector2[100], axisLabels[100]; psDomainSet = xmlNewChild( psRoot, psGmlNs, BAD_CAST "domainSet", NULL); { psGrid = xmlNewChild(psDomainSet, psGmlNs, BAD_CAST "RectifiedGrid", NULL); { + double x0 = cm->geotransform[0]+cm->geotransform[1]/2+cm->geotransform[2]/2; + double y0 = cm->geotransform[3]+cm->geotransform[4]/2+cm->geotransform[5]/2; + double resx = cm->geotransform[1]; + double resy = cm->geotransform[5]; + xmlNewProp(psGrid, BAD_CAST "dimension", BAD_CAST "2"); snprintf(id, sizeof(id), "grid_%s", layer->name); xmlNewNsProp(psGrid, psGmlNs, BAD_CAST "id", BAD_CAST id); @@ -2032,17 +2038,9 @@ } if(projection->proj != NULL && pj_is_latlong(projection->proj)) { - if (swapAxes == MS_FALSE) { - strlcpy(axisLabels, "long lat", sizeof(axisLabels)); - } else { - strlcpy(axisLabels, "lat long", sizeof(axisLabels)); - } + strlcpy(axisLabels, "long lat", sizeof(axisLabels)); } else { - if (swapAxes == MS_FALSE) { - strlcpy(axisLabels, "x y", sizeof(axisLabels)); - } else { - strlcpy(axisLabels, "y x", sizeof(axisLabels)); - } + strlcpy(axisLabels, "x y", sizeof(axisLabels)); } xmlNewChild(psGrid, psGmlNs, BAD_CAST "axisLabels", BAD_CAST axisLabels); @@ -2050,9 +2048,9 @@ psOrigin = xmlNewChild(psGrid, psGmlNs, BAD_CAST "origin", NULL); { if (swapAxes == MS_FALSE) { - snprintf(point, sizeof(point), "%f %f", cm->extent.minx, cm->extent.maxy); + snprintf(point, sizeof(point), "%f %f", x0, y0); } else { - snprintf(point, sizeof(point), "%f %f", cm->extent.maxy, cm->extent.minx); + snprintf(point, sizeof(point), "%f %f", y0, x0); } psOrigin = xmlNewChild(psOrigin, psGmlNs, BAD_CAST "Point", NULL); snprintf(id, sizeof(id), "grid_origin_%s", layer->name); @@ -2063,14 +2061,14 @@ } if (swapAxes == MS_FALSE) { - snprintf(resx, sizeof(resx), "%f 0", cm->xresolution); - snprintf(resy, sizeof(resy), "0 %f", -fabs(cm->yresolution)); + snprintf(offsetVector1, sizeof(offsetVector1), "%f 0", resx); + snprintf(offsetVector2, sizeof(offsetVector2), "0 %f", resy); } else { - snprintf(resx, sizeof(resx), "0 %f", cm->xresolution); - snprintf(resy, sizeof(resy), "%f 0", -fabs(cm->yresolution)); + snprintf(offsetVector1, sizeof(offsetVector1), "0 %f", resx); + snprintf(offsetVector2, sizeof(offsetVector2), "%f 0", resy); } - psOffsetX = xmlNewChild(psGrid, psGmlNs, BAD_CAST "offsetVector", BAD_CAST resx); - psOffsetY = xmlNewChild(psGrid, psGmlNs, BAD_CAST "offsetVector", BAD_CAST resy); + psOffsetX = xmlNewChild(psGrid, psGmlNs, BAD_CAST "offsetVector", BAD_CAST offsetVector1); + psOffsetY = xmlNewChild(psGrid, psGmlNs, BAD_CAST "offsetVector", BAD_CAST offsetVector2); xmlNewProp(psOffsetX, BAD_CAST "srsName", BAD_CAST cm->srs_uri); xmlNewProp(psOffsetY, BAD_CAST "srsName", BAD_CAST cm->srs_uri); diff -Nru mapserver-7.0.6/mapwfslayer.c mapserver-7.0.7/mapwfslayer.c --- mapserver-7.0.6/mapwfslayer.c 2017-06-21 17:48:24.000000000 +0000 +++ mapserver-7.0.7/mapwfslayer.c 2017-11-15 19:24:35.000000000 +0000 @@ -445,7 +445,7 @@ } else { snprintf(pszURL + strlen(pszURL), bufferSize - strlen(pszURL), "&BBOX=%.15g,%.15g,%.15g,%.15g,%s&SRSNAME=%s", - bbox->minx, bbox->miny, bbox->maxy, bbox->maxy, + bbox->minx, bbox->miny, bbox->maxx, bbox->maxy, projUrn, projUrn); } } else {