From 92b80dacfa36c56197854598cea5ea595529db05 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Thu, 6 Jun 2024 17:07:58 -0300 Subject: [PATCH 01/53] update for 8.2.0-beta1 release --- CMakeLists.txt | 4 ++-- HISTORY.md | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b078877221..f984830ef9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,9 +16,9 @@ include(CheckIncludeFile) include(CheckCSourceCompiles) set (MapServer_VERSION_MAJOR 8) -set (MapServer_VERSION_MINOR 1) +set (MapServer_VERSION_MINOR 2) set (MapServer_VERSION_REVISION 0) -set (MapServer_VERSION_SUFFIX "") +set (MapServer_VERSION_SUFFIX "-beta1") # Set C++ version # Make CMAKE_CXX_STANDARD available as cache option overridable by user diff --git a/HISTORY.md b/HISTORY.md index d104673937..a41cfc4fab 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -13,6 +13,44 @@ https://mapserver.org/development/changelog/ The online Migration Guide can be found at https://mapserver.org/MIGRATION_GUIDE.html +8.2.0-beta1 release (2024-06-06) +-------------------------------- + +- restructure repo to move source code into /src (#6837) + +- remove sym2img.c from codebase (#6593) + +- handle templates + includes (#6113) + +- handle empty query response (#6907) + +- remove support for GDAL < 3 (#6901) + +- remove support for PROJ < 6 (#6900) + +- OGC API Features: implement Part 2 - CRS (#6893) + +- allow custom projections to be requested via WMS (#6795) + +- allow mapfiles to be accessed via URL Keys (#6862) + +- allow expressions in LABEL PRIORITY (#6884) + +- reference SLD files in Mapfiles (#7034) + +see detailed changelog for other fixes + +8.0.1 release (2023-04-17) +-------------------------- + +- fix WFS paging on Oracle (#6774) + +- allow runtime substitutions on the Web template parameter (#6804) + +- handle multiple PROJ_DATA paths through config (#6863) + +see detailed changelog for other fixes + 8.0.0 release (2022-09-12) -------------------------- From 31b431a433fd5140bc3d46b0d17eb5e69feb4d71 Mon Sep 17 00:00:00 2001 From: Bas Couwenberg Date: Fri, 7 Jun 2024 11:13:37 +0200 Subject: [PATCH 02/53] Fix Python MapScript installation. (#7071) ERROR: You must give at least one requirement to install (see "pip help install") --- src/mapscript/python/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapscript/python/CMakeLists.txt b/src/mapscript/python/CMakeLists.txt index 7ab1d021b4..4ee661f3fa 100644 --- a/src/mapscript/python/CMakeLists.txt +++ b/src/mapscript/python/CMakeLists.txt @@ -122,7 +122,7 @@ install( endif() execute_process( - COMMAND ${Python_EXECUTABLE} -m pip install \${PYTHON_ROOT} \${PYTHON_PREFIX} + COMMAND ${Python_EXECUTABLE} -m pip install \${PYTHON_ROOT} \${PYTHON_PREFIX} . WORKING_DIRECTORY ${OUTPUT_FOLDER} ) " From d472ccf03b8d0f2db0a07eaf6ec8088fae74c399 Mon Sep 17 00:00:00 2001 From: Bas Couwenberg Date: Fri, 7 Jun 2024 11:09:52 +0200 Subject: [PATCH 03/53] Fix spelling errors. (#7072) * instanciate -> instantiate --- src/mapogcapi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapogcapi.cpp b/src/mapogcapi.cpp index 845ce876b1..861dc34cb7 100644 --- a/src/mapogcapi.cpp +++ b/src/mapogcapi.cpp @@ -1217,7 +1217,7 @@ static int processCollectionItemsRequest(mapObj *map, cgiRequestObj *request, msProjectionInheritContextFrom(&reprObjs.proj, &(map->projection)); if (msLoadProjectionString(&reprObjs.proj, outputCrs.c_str()) != 0) { - outputError(OGCAPI_SERVER_ERROR, "Cannot instanciate output CRS."); + outputError(OGCAPI_SERVER_ERROR, "Cannot instantiate output CRS."); return MS_SUCCESS; } From 76cf6c994c8dc3285060dcd589c5c2e3a52ab291 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Sat, 8 Jun 2024 15:44:42 -0300 Subject: [PATCH 04/53] update for 8.2.0-beta2 release --- CMakeLists.txt | 2 +- HISTORY.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f984830ef9..4a50aa6164 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ include(CheckCSourceCompiles) set (MapServer_VERSION_MAJOR 8) set (MapServer_VERSION_MINOR 2) set (MapServer_VERSION_REVISION 0) -set (MapServer_VERSION_SUFFIX "-beta1") +set (MapServer_VERSION_SUFFIX "-beta2") # Set C++ version # Make CMAKE_CXX_STANDARD available as cache option overridable by user diff --git a/HISTORY.md b/HISTORY.md index a41cfc4fab..0cf6a6177b 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -13,6 +13,11 @@ https://mapserver.org/development/changelog/ The online Migration Guide can be found at https://mapserver.org/MIGRATION_GUIDE.html +8.2.0-beta2 release (2024-06-08) +-------------------------------- + +- fix Python MapScript installation (#7071) + 8.2.0-beta1 release (2024-06-06) -------------------------------- From 33381a9ee0f9c66d7eaf339f8f6a9a90639ce56b Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Mon, 10 Jun 2024 15:20:44 +0200 Subject: [PATCH 05/53] OGR output format: avoid potential stack buffer overflow on too long filename --- src/mapogroutput.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mapogroutput.cpp b/src/mapogroutput.cpp index 274d679e1d..09925b2667 100644 --- a/src/mapogroutput.cpp +++ b/src/mapogroutput.cpp @@ -768,7 +768,12 @@ int msOGRWriteFromQuery(mapObj *map, outputFormatObj *format, int sendheaders) } if (!EQUAL(storage, "stream")) { - msBuildPath(datasource_name, request_dir, fo_filename); + if (!msBuildPath(datasource_name, request_dir, fo_filename)) { + msFree(request_dir); + CSLDestroy(layer_options); + CSLDestroy(ds_options); + return MS_FAILURE; + } if (EQUAL(form, "zip")) { /* if generating a zip file, remove the zip extension for the internal */ @@ -779,7 +784,7 @@ int msOGRWriteFromQuery(mapObj *map, outputFormatObj *format, int sendheaders) /* and add .dat extension if user didn't provide another extension */ if (EQUAL(CPLGetExtension(datasource_name), "")) { - strcat(datasource_name, ".dat"); + strlcat(datasource_name, ".dat", sizeof(datasource_name)); } } From af7fe7765aecf03482317778205c45c186651232 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 8 Jun 2024 17:16:17 +0200 Subject: [PATCH 06/53] mapregex.c: fix invalid mapping of MS_REG_NOSUB and MS_REG_NEWLINE with GNU regex --- msautotest/query/expected/rfc62_test003.txt | 9 +++------ src/mapregex.c | 11 ++++++++++- src/mapregex.h | 5 ++--- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/msautotest/query/expected/rfc62_test003.txt b/msautotest/query/expected/rfc62_test003.txt index cb7687360a..9b6b6d1b8d 100644 --- a/msautotest/query/expected/rfc62_test003.txt +++ b/msautotest/query/expected/rfc62_test003.txt @@ -1,6 +1,5 @@ --xxOGRBoundaryxx -Content-Disposition: attachment; filename=foo -bar.gml +Content-Disposition: attachment; filename=some_default_value.gml Content-Type: application/binary Content-Transfer-Encoding: binary @@ -8,8 +7,7 @@ Content-Transfer-Encoding: binary 363237.626104089 5045148.78911013591752.164237744 5386497.208 @@ -59,8 +57,7 @@ bar.xsd" --xxOGRBoundaryxx -Content-Disposition: attachment; filename=foo -bar.xsd +Content-Disposition: attachment; filename=some_default_value.xsd Content-Type: application/binary Content-Transfer-Encoding: binary diff --git a/src/mapregex.c b/src/mapregex.c index cd42c3e1ee..bd8bf329ad 100644 --- a/src/mapregex.c +++ b/src/mapregex.c @@ -57,7 +57,16 @@ MS_API_EXPORT(int) ms_regcomp(ms_regex_t *regex, const char *expr, int cflags) { /* Must free in regfree() */ regex_t *sys_regex = (regex_t *)msSmallMalloc(sizeof(regex_t)); regex->sys_regex = (void *)sys_regex; - int ret = regcomp(sys_regex, expr, cflags); + int reg_cflags = 0; + if (cflags & MS_REG_EXTENDED) + reg_cflags |= REG_EXTENDED; + if (cflags & MS_REG_ICASE) + reg_cflags |= REG_ICASE; + if (cflags & MS_REG_NOSUB) + reg_cflags |= REG_NOSUB; + if (cflags & MS_REG_NEWLINE) + reg_cflags |= REG_NEWLINE; + int ret = regcomp(sys_regex, expr, reg_cflags); if (ret != 0) { free(regex->sys_regex); regex->sys_regex = NULL; diff --git a/src/mapregex.h b/src/mapregex.h index 10bd765727..ea7c44c3ba 100644 --- a/src/mapregex.h +++ b/src/mapregex.h @@ -66,11 +66,10 @@ MS_API_EXPORT(void) ms_regfree(ms_regex_t *); #define MS_REG_BASIC 0000 #define MS_REG_EXTENDED 0001 #define MS_REG_ICASE 0002 +// WARNING: GNU regex has REG_NOSUB = (1 << 3) = 8 #define MS_REG_NOSUB 0004 +// WARNING: GNU regex has REG_NEWLINE = (1 << 2) = 4 #define MS_REG_NEWLINE 0010 -#define MS_REG_NOSPEC 0020 -#define MS_REG_PEND 0040 -#define MS_REG_DUMP 0200 /* === regerror.c === */ #define MS_REG_OKAY 0 From 80dec54714f629a5504d85a8b813571d9f22dbf3 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Tue, 11 Jun 2024 17:09:18 -0300 Subject: [PATCH 07/53] update history --- HISTORY.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index 0cf6a6177b..9a9fa86a69 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -115,6 +115,15 @@ RC2 was released as the final 8.0.0 (see major changes below) - upgrade Travis and GitHub CI to run on Ubuntu Focal (#6430) +7.6.5 release (2023-04-17) +-------------------------- + +- remove password content from logs (#6621) + +- increase security and stability (#6818) + +see detailed changelog for other fixes + 7.6.4 release (2021-07-12) -------------------------- From f3f1939ae66a0dd4c76a01c4f4af57da9933e4bb Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Tue, 11 Jun 2024 17:21:39 -0300 Subject: [PATCH 08/53] update for 8.2.0-beta3 release --- CMakeLists.txt | 2 +- HISTORY.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a50aa6164..89c4e43583 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ include(CheckCSourceCompiles) set (MapServer_VERSION_MAJOR 8) set (MapServer_VERSION_MINOR 2) set (MapServer_VERSION_REVISION 0) -set (MapServer_VERSION_SUFFIX "-beta2") +set (MapServer_VERSION_SUFFIX "-beta3") # Set C++ version # Make CMAKE_CXX_STANDARD available as cache option overridable by user diff --git a/HISTORY.md b/HISTORY.md index 9a9fa86a69..89065275ae 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -13,6 +13,11 @@ https://mapserver.org/development/changelog/ The online Migration Guide can be found at https://mapserver.org/MIGRATION_GUIDE.html +8.2.0-beta3 release (2024-06-11) +-------------------------------- + +- security fix to prevent SQL injections through regex validation (#7075) + 8.2.0-beta2 release (2024-06-08) -------------------------------- From 65e0c8243f1f2feaf44da7b88fddca2773cdec70 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Fri, 14 Jun 2024 13:48:01 -0300 Subject: [PATCH 09/53] update for 8.2.0-rc1 release --- CMakeLists.txt | 2 +- HISTORY.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 89c4e43583..832ef5554f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ include(CheckCSourceCompiles) set (MapServer_VERSION_MAJOR 8) set (MapServer_VERSION_MINOR 2) set (MapServer_VERSION_REVISION 0) -set (MapServer_VERSION_SUFFIX "-beta3") +set (MapServer_VERSION_SUFFIX "-rc1") # Set C++ version # Make CMAKE_CXX_STANDARD available as cache option overridable by user diff --git a/HISTORY.md b/HISTORY.md index 89065275ae..b24c05d369 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -13,6 +13,11 @@ https://mapserver.org/development/changelog/ The online Migration Guide can be found at https://mapserver.org/MIGRATION_GUIDE.html +8.2.0-rc1 release (2024-06-14) +-------------------------------- + +- no changes since beta3 (see major changes below) + 8.2.0-beta3 release (2024-06-11) -------------------------------- From 807f26be0af5bcc29d83c3bd71b5cc899c0ee0de Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 16:21:15 +0200 Subject: [PATCH 10/53] [Backport branch-8-2] Python mapscript: remove deprecated SWIG t_output_helper (#7084) Add compatibility with SWIG 4.3.0dev Fixes #7081 --- Makefile | 2 +- ci/build.sh | 2 +- src/mapscript/python/pymodule.i | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 50cb0cfd1f..adfc92c359 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ FLEX=flex YACC=yacc CMAKEFLAGS_MAPSCRIPT_PYTHON=-DWITH_CLIENT_WMS=1 \ -DWITH_CLIENT_WFS=1 -DWITH_KML=1 -DWITH_SOS=1 \ - -DWITH_PYTHON=1-DWITH_THREAD_SAFETY=1 -DWITH_FRIBIDI=1 -DWITH_FCGI=1 -DWITH_EXEMPI=1 \ + -DWITH_PYTHON=1 -DWITH_THREAD_SAFETY=1 -DWITH_FRIBIDI=1 -DWITH_FCGI=1 -DWITH_EXEMPI=1 \ -DCMAKE_BUILD_TYPE=Release -DWITH_RSVG=1 -DWITH_CURL=1 -DWITH_HARFBUZZ=1 ${EXTRA_CMAKEFLAGS} -DLIBMAPSERVER_EXTRA_FLAGS="${LIBMAPSERVER_EXTRA_FLAGS}" -DCMAKE_INSTALL_PREFIX=/tmp/install-mapserver CMAKEFLAGS_NOCOVERAGE=-DWITH_CLIENT_WMS=1 \ diff --git a/ci/build.sh b/ci/build.sh index 4ced832179..b63ed078fb 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -5,7 +5,7 @@ export CC="ccache gcc" export CXX="ccache g++" if [ "${MAPSCRIPT_PYTHON_ONLY:-}" = "true" ]; then - # only build MapServer with the Python MapScript + # only build MapServer with the Python MapScript and not PHP, Perl etc. make cmakebuild_mapscript_python MFLAGS="-j$(nproc)" CMAKE_C_FLAGS="-O2" CMAKE_CXX_FLAGS="-O2" LIBMAPSERVER_EXTRA_FLAGS="-Wall -Werror -Wextra" # build the wheel and run the Python MapScript test suite make mspython-wheel diff --git a/src/mapscript/python/pymodule.i b/src/mapscript/python/pymodule.i index d0d3dfaeca..792afb91dd 100644 --- a/src/mapscript/python/pymodule.i +++ b/src/mapscript/python/pymodule.i @@ -82,13 +82,17 @@ CreateTupleFromDoubleArray( double *first, unsigned int size ) { $2 = &nListSize; } -%typemap(argout,fragment="t_output_helper,CreateTupleFromDoubleArray") (double** argout, int* pnListSize) +%typemap(argout,fragment="CreateTupleFromDoubleArray") (double** argout, int* pnListSize) { /* %typemap(argout) (double* argout, int* pnListSize) */ PyObject *r; r = CreateTupleFromDoubleArray(*$1, *$2); free(*$1); - $result = t_output_helper($result,r); + %#if SWIG_VERSION >= 0x040300 + $result = SWIG_Python_AppendOutput($result, r, $isvoid); + %#else + $result = SWIG_Python_AppendOutput($result, r); + %#endif } /* From 2eaa88aec7aa383de8f807baa4c84ba64304bf24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szekeres=20Tam=C3=A1s?= Date: Fri, 21 Jun 2024 12:13:07 +0200 Subject: [PATCH 11/53] Fix opacity calculation problem with the agg renderer (#5697) --- msautotest/renderers/expected/compositing.png | Bin 1025 -> 1022 bytes src/mapagg.cpp | 7 ++++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/msautotest/renderers/expected/compositing.png b/msautotest/renderers/expected/compositing.png index 7957fd23de46bdab7c38f852fc05e615a60e9406..f3514f705f90b6b418cb861751e6ec6b34beb962 100644 GIT binary patch literal 1022 zcmeAS@N?(olHy`uVBq!ia0vp^CxCbw2NRGK*%#o)z`%Ue)5S5QV$R!3p?$IuBF=&5 z;}g@;()?Oy&YZdP(41F-d-_+GtL$FCZ3|mMWc1_XEK@GG)H~Sv{^7oId5Jxc@sIb) zmmHCrMzTR<);14y*>ZV-;nQKw6)*qrgLU$y-wFPTb@+@rBnZI)QI}8 zFvWIC*tg@0G7kR@_!ba#6R5EFJ4~V3U0$fdf2_?noE6t3W_+FtQ>MG!8EW3Pdt6Xu zx5|uR=Kb!4DU`hqQ&<+q4O3WZ3RC!fDpcX4c!LgGkwa2#-(vV+%BnSC%I+V9nfF&5 z=03M`%Zu7Co%t6bBx@mlO5RKPcXD9Kha8P+jkRz3T`w*)UifC=mQD6zuI>Kqo7yj( z`WGSczsd2-5vjG42 zG@wYST7dukG@wYWRlxcE46&E`GaYRI&f&UpdA%l(F^}iU<@ugK#$1jom-llz*!K1U x({PRqSnVfZ{`kXvLG?dV$w{DAO1b}-H{9DUeB#(17ht|-@O1TaS?83{1OU~0^l$(G literal 1025 zcmeAS@N?(olHy`uVBq!ia0vp^CxCbw2NRGK*%#o)z`%UM)5S5QV$R!3p?LxU5-tyK z);C!njqTbkrW=$oP6@)6GO(QCQtPP{Dc29d^LG%9^iku zp7E>6WAy-k<9eXTYwH02&HEX@{^7o$diE#RmCJYZ9c<73=DBkDkH3R0ZwNr8Q`Bi52*1QXMq1}Ip(ih{spdBc=3PF-;EklH4>-fytIEO2X1-js8Ox4_D#R* z#bdu0zFD|slfBr{{RuYT0ywgjw!DmkNj}>Rm2{1M*RrYo(y4zDBDs5IVWzwdgDLzr z8>Y}Y52o<#9yzGOKitQX`CB)rIqhE83N_{JJ}H71EbuhZ4n19O$EEzJ2PZ$e<^ zeVh!l_^>)mOIy1$P&41@zY!vHCHPYLmrex+p;e{L6x%6b-;OVOab;t`w}2>+HJ9B% zDnZt`^}(!}YbgWuU&*%sm^C{W!nAy5hiR!lSn+0|z%`c_hZ=!)gm(Lly-$ra11 zX9F4g1y?+eZ_s;rkZr*{IX3@euRGdtMU&f>pv z`FSOfF%y_*uUi5cvw6Wu^h>Q+fWLhj(Ar|Q0RR2Vn7@9hmJ0B%Uj`H@=L+yop4?a^ tHJb&j7L-GPMxO-cfKR~GO(Az_eZvv$qcvf#{{gc$gQu&X%Q~loCIBK_^zQ%w diff --git a/src/mapagg.cpp b/src/mapagg.cpp index eb063544d2..ba7243c0bf 100644 --- a/src/mapagg.cpp +++ b/src/mapagg.cpp @@ -1324,7 +1324,7 @@ int aggCompositeRasterBuffer(imageObj *dest, rasterBufferObj *overlay, if (opacity == 100) { alpha_mask_i_ptr = NULL; } else { - unsigned char alpha = (unsigned char)(opacity * 2.55); + unsigned char alpha = (unsigned char)(MS_NINT(opacity * 2.55)); if (!alpha_mask_i) { alpha_mask = (unsigned char *)msSmallMalloc(dest->width * dest->height); alpha_mask_i = @@ -1350,12 +1350,13 @@ int aggCompositeRasterBuffer(imageObj *dest, rasterBufferObj *overlay, pixel_format pf(b); mapserver::comp_op_e comp_op = ms2agg_compop(comp); if (comp_op == mapserver::comp_op_src_over) { - r->m_renderer_base.blend_from(pf, 0, 0, 0, unsigned(opacity * 2.55)); + r->m_renderer_base.blend_from(pf, 0, 0, 0, + unsigned(MS_NINT(opacity * 2.55))); } else { compop_pixel_format pixf(r->m_rendering_buffer); compop_renderer_base ren(pixf); pixf.comp_op(comp_op); - ren.blend_from(pf, 0, 0, 0, unsigned(opacity * 2.55)); + ren.blend_from(pf, 0, 0, 0, unsigned(MS_NINT(opacity * 2.55))); } return MS_SUCCESS; #endif From 23097cab63fe37acc1e904eb450adea8d4d97b7c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:45:46 +0200 Subject: [PATCH 12/53] Fix SWIG mapscript failure with out of source builds (#7090) (#7092) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Szekeres Tamás --- src/mapscript/csharp/CMakeLists.txt | 1 + src/mapscript/java/CMakeLists.txt | 1 + src/mapscript/perl/CMakeLists.txt | 1 + src/mapscript/python/CMakeLists.txt | 1 + src/mapscript/ruby/CMakeLists.txt | 1 + 5 files changed, 5 insertions(+) diff --git a/src/mapscript/csharp/CMakeLists.txt b/src/mapscript/csharp/CMakeLists.txt index 4eb36e0015..b17b3c9c0c 100644 --- a/src/mapscript/csharp/CMakeLists.txt +++ b/src/mapscript/csharp/CMakeLists.txt @@ -34,6 +34,7 @@ MARK_AS_ADVANCED(CSHARP_COMPILER) include_directories(${PROJECT_SOURCE_DIR}/src/mapscript/swiginc) include_directories(${PROJECT_SOURCE_DIR}/src/mapscript/) include_directories(${PROJECT_SOURCE_DIR}/src/mapscript/csharp) +include_directories(${PROJECT_BINARY_DIR}/src/mapscript/) SET (CMAKE_SWIG_OUTDIR "${CMAKE_CURRENT_BINARY_DIR}") if (WIN32) SET( CMAKE_SWIG_FLAGS -namespace OSGeo.MapServer -DWIN32 ${MAPSERVER_COMPILE_DEFINITIONS}) diff --git a/src/mapscript/java/CMakeLists.txt b/src/mapscript/java/CMakeLists.txt index 4201148b86..e72bb4ef6e 100644 --- a/src/mapscript/java/CMakeLists.txt +++ b/src/mapscript/java/CMakeLists.txt @@ -11,6 +11,7 @@ include_directories(${JNI_INCLUDE_DIRS}) include_directories(${PROJECT_SOURCE_DIR}/src/mapscript/swiginc) include_directories(${PROJECT_SOURCE_DIR}/src/mapscript/) include_directories(${PROJECT_SOURCE_DIR}/src/mapscript/java) +include_directories(${PROJECT_BINARY_DIR}/src/mapscript/) set (CMAKE_SWIG_OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/edu/umn/gis/mapscript") set(CMAKE_SWIG_FLAGS -package edu.umn.gis.mapscript) diff --git a/src/mapscript/perl/CMakeLists.txt b/src/mapscript/perl/CMakeLists.txt index a69d5b7085..ee04cadf7c 100644 --- a/src/mapscript/perl/CMakeLists.txt +++ b/src/mapscript/perl/CMakeLists.txt @@ -9,6 +9,7 @@ include_directories(${PROJECT_SOURCE_DIR}/src/mapscript/) add_definitions(${PERL_EXTRA_C_FLAGS}) set(CMAKE_SWIG_FLAGS -shadow -w314) include_directories(${PROJECT_SOURCE_DIR}/src/mapscript/perl) +include_directories(${PROJECT_BINARY_DIR}/src/mapscript/) if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 3.7) swig_add_library(perlmapscript TYPE MODULE LANGUAGE perl5 SOURCES ../mapscript.i) diff --git a/src/mapscript/python/CMakeLists.txt b/src/mapscript/python/CMakeLists.txt index 4ee661f3fa..529fdd82b9 100644 --- a/src/mapscript/python/CMakeLists.txt +++ b/src/mapscript/python/CMakeLists.txt @@ -7,6 +7,7 @@ include_directories(${Python_INCLUDE_DIRS}) include_directories(${PROJECT_SOURCE_DIR}/src/mapscript/swiginc) include_directories(${PROJECT_SOURCE_DIR}/src/mapscript/) include_directories(${PROJECT_SOURCE_DIR}/src/mapscript/python) +include_directories(${PROJECT_BINARY_DIR}/src/mapscript/) set(SwigFile ${PROJECT_SOURCE_DIR}/src/mapscript/mapscript.i) diff --git a/src/mapscript/ruby/CMakeLists.txt b/src/mapscript/ruby/CMakeLists.txt index 9cacc8bbde..69151b44e2 100644 --- a/src/mapscript/ruby/CMakeLists.txt +++ b/src/mapscript/ruby/CMakeLists.txt @@ -5,6 +5,7 @@ include_directories(${RUBY_INCLUDE_DIRS}) include_directories(${PROJECT_SOURCE_DIR}/src/mapscript/swiginc) include_directories(${PROJECT_SOURCE_DIR}/src/mapscript/) include_directories(${PROJECT_SOURCE_DIR}/src/mapscript/ruby) +include_directories(${PROJECT_BINARY_DIR}/src/mapscript/) if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER 3.7) swig_add_library(rubymapscript TYPE MODULE LANGUAGE ruby SOURCES ../mapscript.i) From 854593b1b6af6cfdcabe0dc174600b7ae80c68e6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 26 Jun 2024 09:53:04 -0300 Subject: [PATCH 13/53] msProjectionInheritContextFrom(): do not reuse source PROJ context if called from different thread (#7093) Fixes #7079 Co-authored-by: Even Rouault --- src/mapproject.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/mapproject.c b/src/mapproject.c index c27be3c207..78cfa66548 100644 --- a/src/mapproject.c +++ b/src/mapproject.c @@ -70,6 +70,7 @@ typedef struct { } pjCacheEntry; struct projectionContext { + void *thread_id; PJ_CONTEXT *proj_ctx; unsigned ms_proj_data_change_counter; int ref_count; @@ -341,6 +342,7 @@ static void msProjErrorLogger(void *user_data, int level, const char *message) { projectionContext *msProjectionContextCreate(void) { projectionContext *ctx = (projectionContext *)msSmallCalloc(1, sizeof(projectionContext)); + ctx->thread_id = msGetThreadId(); ctx->proj_ctx = proj_context_create(); if (ctx->proj_ctx == NULL) { msFree(ctx); @@ -520,6 +522,28 @@ void msFreeProjectionExceptContext(projectionObj *p) { p->proj_ctx = ctx; } +/************************************************************************/ +/* msProjectionContextClone() */ +/************************************************************************/ + +static projectionContext * +msProjectionContextClone(const projectionContext *ctxSrc) { + projectionContext *ctx = msProjectionContextCreate(); + if (ctx) { + ctx->pj_cache_size = ctxSrc->pj_cache_size; + for (int i = 0; i < ctx->pj_cache_size; ++i) { + pjCacheEntry *entryDst = &(ctx->pj_cache[i]); + const pjCacheEntry *entrySrc = &(ctxSrc->pj_cache[i]); + entryDst->inStr = msStrdup(entrySrc->inStr); + entryDst->outStr = msStrdup(entrySrc->outStr); + entryDst->pj = proj_clone( + /* use target PROJ context for cloning */ + ctx->proj_ctx, entrySrc->pj); + } + } + return ctx; +} + /************************************************************************/ /* msProjectionInheritContextFrom() */ /************************************************************************/ @@ -527,8 +551,12 @@ void msFreeProjectionExceptContext(projectionObj *p) { void msProjectionInheritContextFrom(projectionObj *pDst, const projectionObj *pSrc) { if (pDst->proj_ctx == NULL && pSrc->proj_ctx != NULL) { - pDst->proj_ctx = pSrc->proj_ctx; - pDst->proj_ctx->ref_count++; + if (pSrc->proj_ctx->thread_id == msGetThreadId()) { + pDst->proj_ctx = pSrc->proj_ctx; + pDst->proj_ctx->ref_count++; + } else { + pDst->proj_ctx = msProjectionContextClone(pSrc->proj_ctx); + } } } From 13709474923b180b040d82803f53c64c6895be61 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Thu, 27 Jun 2024 17:25:28 -0300 Subject: [PATCH 14/53] update for 8.2.0-rc2 release --- CMakeLists.txt | 2 +- HISTORY.md | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 832ef5554f..3a07161b9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ include(CheckCSourceCompiles) set (MapServer_VERSION_MAJOR 8) set (MapServer_VERSION_MINOR 2) set (MapServer_VERSION_REVISION 0) -set (MapServer_VERSION_SUFFIX "-rc1") +set (MapServer_VERSION_SUFFIX "-rc2") # Set C++ version # Make CMAKE_CXX_STANDARD available as cache option overridable by user diff --git a/HISTORY.md b/HISTORY.md index b24c05d369..cef3b7bb13 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -13,8 +13,13 @@ https://mapserver.org/development/changelog/ The online Migration Guide can be found at https://mapserver.org/MIGRATION_GUIDE.html +8.2.0-rc2 release (2024-06-27) +------------------------------ + +- fix SWIG MapScript build failure (#7090) + 8.2.0-rc1 release (2024-06-14) --------------------------------- +------------------------------ - no changes since beta3 (see major changes below) From e964c39c132375f48eed7cbf87854f93770b430a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 09:13:49 -0300 Subject: [PATCH 15/53] Fix for the memory corruption issues in msUpdate...FromString (#7038) (#7095) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Szekeres Tamás --- src/mapfile.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/mapfile.c b/src/mapfile.c index 50e5cdd7e4..45db899c81 100644 --- a/src/mapfile.c +++ b/src/mapfile.c @@ -2102,9 +2102,9 @@ int msUpdateLabelFromString(labelObj *label, char *string) { return MS_FAILURE; /* parse error */ ; } - msReleaseLock(TLOCK_PARSER); msyylex_destroy(); + msReleaseLock(TLOCK_PARSER); return MS_SUCCESS; } @@ -2616,9 +2616,9 @@ int msUpdateClusterFromString(clusterObj *cluster, char *string) { return MS_FAILURE; /* parse error */ ; } - msReleaseLock(TLOCK_PARSER); msyylex_destroy(); + msReleaseLock(TLOCK_PARSER); return MS_SUCCESS; } @@ -3096,9 +3096,9 @@ int msUpdateStyleFromString(styleObj *style, char *string) { return MS_FAILURE; /* parse error */ ; } - msReleaseLock(TLOCK_PARSER); msyylex_destroy(); + msReleaseLock(TLOCK_PARSER); return MS_SUCCESS; } @@ -3766,9 +3766,9 @@ int msUpdateClassFromString(classObj *class, char *string) { return MS_FAILURE; /* parse error */ ; } - msReleaseLock(TLOCK_PARSER); msyylex_destroy(); + msReleaseLock(TLOCK_PARSER); if (classResolveSymbolNames(class) != MS_SUCCESS) return MS_FAILURE; @@ -4836,9 +4836,9 @@ int msUpdateLayerFromString(layerObj *layer, char *string) { return MS_FAILURE; /* parse error */ ; } - msReleaseLock(TLOCK_PARSER); msyylex_destroy(); + msReleaseLock(TLOCK_PARSER); /* step through classes to resolve symbol names */ for (i = 0; i < layer->numclasses; i++) { @@ -5249,9 +5249,9 @@ int msUpdateReferenceMapFromString(referenceMapObj *ref, char *string) { return MS_FAILURE; /* parse error */ ; } - msReleaseLock(TLOCK_PARSER); msyylex_destroy(); + msReleaseLock(TLOCK_PARSER); return MS_SUCCESS; } @@ -5643,9 +5643,9 @@ int msUpdateLegendFromString(legendObj *legend, char *string) { return MS_FAILURE; /* parse error */ ; } - msReleaseLock(TLOCK_PARSER); msyylex_destroy(); + msReleaseLock(TLOCK_PARSER); return MS_SUCCESS; } @@ -5842,9 +5842,9 @@ int msUpdateScalebarFromString(scalebarObj *scalebar, char *string) { return MS_FAILURE; /* parse error */ ; } - msReleaseLock(TLOCK_PARSER); msyylex_destroy(); + msReleaseLock(TLOCK_PARSER); return MS_SUCCESS; } @@ -5991,9 +5991,9 @@ int msUpdateQueryMapFromString(queryMapObj *querymap, char *string) { return MS_FAILURE; /* parse error */ ; } - msReleaseLock(TLOCK_PARSER); msyylex_destroy(); + msReleaseLock(TLOCK_PARSER); return MS_SUCCESS; } @@ -6240,9 +6240,9 @@ int msUpdateWebFromString(webObj *web, char *string) { return MS_FAILURE; /* parse error */ ; } - msReleaseLock(TLOCK_PARSER); msyylex_destroy(); + msReleaseLock(TLOCK_PARSER); return MS_SUCCESS; } @@ -6966,6 +6966,7 @@ mapObj *msLoadMapFromString(char *buffer, char *new_mappath, if (!msGetCWD(szCWDPath, MS_MAXPATHLEN, "msLoadMapFromString()")) { msFreeMap(map); msReleaseLock(TLOCK_PARSER); + return (NULL); } if (new_mappath) { mappath = msStrdup(new_mappath); @@ -7111,12 +7112,12 @@ mapObj *msLoadMap(const char *filename, const char *new_mappath, if (loadMapInternal(map) != MS_SUCCESS) { msFreeMap(map); - msReleaseLock(TLOCK_PARSER); if (msyyin) { msyycleanup_includes(); fclose(msyyin); msyyin = NULL; } + msReleaseLock(TLOCK_PARSER); return NULL; } msReleaseLock(TLOCK_PARSER); From 68bc303cb916bfc91102f22e019a279f0d02c1cc Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Fri, 28 Jun 2024 10:18:54 -0300 Subject: [PATCH 16/53] change to markdown --- INSTALL => INSTALL.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename INSTALL => INSTALL.md (100%) diff --git a/INSTALL b/INSTALL.md similarity index 100% rename from INSTALL rename to INSTALL.md From 0cfb54eae98d6db63ececb76b0f3f882f7026137 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Fri, 28 Jun 2024 10:23:00 -0300 Subject: [PATCH 17/53] change to markdown --- INSTALL.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index fc27754e6d..f2c56a5acd 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -4,11 +4,11 @@ instructions. Unix compilation instructions ----------------------------- -See INSTALL.CMAKE or the document on the MapServer website at - +See [INSTALL.CMAKE](INSTALL.CMAKE) or the document on the MapServer website at +https://mapserver.org/installation/unix.html Win32 compilation instructions ------------------------------ See README.WIN32 or the document on the MapServer website at - +https://mapserver.org/installation/win32.html From 99d029ddda920f65c4c1333c7e14e191979ef556 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Fri, 28 Jun 2024 10:39:35 -0300 Subject: [PATCH 18/53] update for 8.2.0-rc3 release --- CMakeLists.txt | 2 +- HISTORY.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a07161b9a..fb61750b2a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ include(CheckCSourceCompiles) set (MapServer_VERSION_MAJOR 8) set (MapServer_VERSION_MINOR 2) set (MapServer_VERSION_REVISION 0) -set (MapServer_VERSION_SUFFIX "-rc2") +set (MapServer_VERSION_SUFFIX "-rc3") # Set C++ version # Make CMAKE_CXX_STANDARD available as cache option overridable by user diff --git a/HISTORY.md b/HISTORY.md index cef3b7bb13..d3839384a2 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -13,6 +13,11 @@ https://mapserver.org/development/changelog/ The online Migration Guide can be found at https://mapserver.org/MIGRATION_GUIDE.html +8.2.0-rc3 release (2024-06-28) +------------------------------ + +- fix memory corruption in msUpdate...FromString (#7038) + 8.2.0-rc2 release (2024-06-27) ------------------------------ From 490daf377a310964cfc68be5e2facd66697df9e2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 09:26:09 -0300 Subject: [PATCH 19/53] [Backport branch-8-2] add PHP 8.3 to test matrix (#7098) --- .github/workflows/build-mapscript-php.yml | 9 +++++++-- ci/build.sh | 15 +++++++++++---- msautotest/php/run_test.sh | 11 +++++++++-- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-mapscript-php.yml b/.github/workflows/build-mapscript-php.yml index 549819b27e..f1ebc5918d 100644 --- a/.github/workflows/build-mapscript-php.yml +++ b/.github/workflows/build-mapscript-php.yml @@ -3,9 +3,14 @@ name: Build and test PHP MapScript on: push: branches: - - 'main' + - '*' except: - /^(cherry-pick-)?backport-\d+-to-/ + pull_request: + branches: + - '*' + except: + - /^(cherry-pick-)?backport-\d+-to-/ concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} @@ -19,7 +24,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - php-version: [8.1, 8.2] + php-version: [8.3, 8.2] env: IGNORE_COMPARISON_RESULT_ON_CI: 'true' diff --git a/ci/build.sh b/ci/build.sh index b63ed078fb..1afdf0ea23 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -43,12 +43,19 @@ python -m pyflakes . # run the Python server for the tests python -m http.server &> /dev/null & -# get phpunit +# get PHPUnit echo "PHP version" php -v -cd php && curl -LO https://phar.phpunit.de/phpunit-10.phar -echo "phpunit version" -php phpunit-10.phar --version +PHPVersionMinor=$(php --version | head -n 1 | cut -d " " -f 2 | cut -c 1,3) +if [ ${PHPVersionMinor} -gt 81 ]; then + cd php && curl -LO https://phar.phpunit.de/phpunit-11.phar + echo "PHPUnit version" + php phpunit-11.phar --version +else + cd php && curl -LO https://phar.phpunit.de/phpunit-10.phar + echo "PHPUnit version" + php phpunit-10.phar --version +fi echo "PHP includes" php-config --includes diff --git a/msautotest/php/run_test.sh b/msautotest/php/run_test.sh index 2dd3fc3117..6408f83ba9 100755 --- a/msautotest/php/run_test.sh +++ b/msautotest/php/run_test.sh @@ -1,9 +1,16 @@ #!/bin/bash +PHPVersionMinor=$(php --version | head -n 1 | cut -d " " -f 2 | cut -c 1,3) +if [ ${PHPVersionMinor} -gt 81 ]; then + PHPUnitVersion=11 +else + PHPUnitVersion=10 +fi + if test -z $PHP_MAPSCRIPT_SO; then - php phpunit-10.phar . + php phpunit-$PHPUnitVersion.phar . exit $? else - php -d "extension=$PHP_MAPSCRIPT_SO" phpunit-10.phar . + php -d "extension=$PHP_MAPSCRIPT_SO" phpunit-$PHPUnitVersion.phar . exit $? fi From 48c3f498cca14d394a4c9ac3dea51a1bb0b76800 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Mon, 8 Jul 2024 12:34:18 -0300 Subject: [PATCH 20/53] update for 8.2.0 release --- CMakeLists.txt | 2 +- HISTORY.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb61750b2a..6b6157df9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ include(CheckCSourceCompiles) set (MapServer_VERSION_MAJOR 8) set (MapServer_VERSION_MINOR 2) set (MapServer_VERSION_REVISION 0) -set (MapServer_VERSION_SUFFIX "-rc3") +set (MapServer_VERSION_SUFFIX "") # Set C++ version # Make CMAKE_CXX_STANDARD available as cache option overridable by user diff --git a/HISTORY.md b/HISTORY.md index d3839384a2..894386ae24 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -13,6 +13,11 @@ https://mapserver.org/development/changelog/ The online Migration Guide can be found at https://mapserver.org/MIGRATION_GUIDE.html +8.2.0 release (2024-07-08) +-------------------------- + +RC3 was released as the final 8.2.0 (see major changes below) + 8.2.0-rc3 release (2024-06-28) ------------------------------ From b054904f96cc75a404396ebd795cbb96da05b8df Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 21:56:50 +0200 Subject: [PATCH 21/53] [Backport branch-8-2] Use EPSGTreatsAsLatLong and EPSGTreatsAsNorthingEasting to determine inverted axis (#7099) --- .../mapaxisorder/create_mapaxisorder_csv.py | 36 +- scripts/mapaxisorder/mapaxisorder.csv | 485 ++++++++++++++++++ scripts/mapaxisorder/mapaxisorder.sh | 15 +- src/mapaxisorder.h | 282 +++++----- 4 files changed, 654 insertions(+), 164 deletions(-) diff --git a/scripts/mapaxisorder/create_mapaxisorder_csv.py b/scripts/mapaxisorder/create_mapaxisorder_csv.py index 2e3e4598ff..3e0de1f722 100644 --- a/scripts/mapaxisorder/create_mapaxisorder_csv.py +++ b/scripts/mapaxisorder/create_mapaxisorder_csv.py @@ -30,16 +30,32 @@ from osgeo import gdal, osr -sr = osr.SpatialReference() -print("epsg_code") -for code in range(32767): + +def inverted_axis(code): gdal.PushErrorHandler() ret = sr.ImportFromEPSGA(code) gdal.PopErrorHandler() - if ret == 0 and sr.GetAxesCount() >= 2: - first_axis = sr.GetAxisOrientation(None, 0) - second_axis = sr.GetAxisOrientation(None, 1) - if first_axis == osr.OAO_North and second_axis == osr.OAO_East: - print(code) - elif first_axis == osr.OAO_South and second_axis == osr.OAO_West: - print(code) + + if ret == 0 and sr.GetAxesCount() < 2: + return False + + if sr.IsGeographic() and sr.EPSGTreatsAsLatLong(): + return True + if sr.IsProjected() and sr.EPSGTreatsAsNorthingEasting(): + return True + + first_axis = sr.GetAxisOrientation(None, 0) + second_axis = sr.GetAxisOrientation(None, 1) + if first_axis == osr.OAO_North and second_axis == osr.OAO_East: + return True + if first_axis == osr.OAO_South and second_axis == osr.OAO_West: + return True + + return False + + +sr = osr.SpatialReference() +print("epsg_code") +for code in range(32767): + if inverted_axis(code): + print(code) diff --git a/scripts/mapaxisorder/mapaxisorder.csv b/scripts/mapaxisorder/mapaxisorder.csv index 36cd0e5f02..2fcf010c36 100755 --- a/scripts/mapaxisorder/mapaxisorder.csv +++ b/scripts/mapaxisorder/mapaxisorder.csv @@ -1452,6 +1452,7 @@ epsg_code 5479 5480 5481 +5482 5488 5489 5498 @@ -1789,6 +1790,9 @@ epsg_code 8545 8684 8685 +8694 +8698 +8699 8817 8818 8860 @@ -1813,6 +1817,8 @@ epsg_code 8942 8944 8946 +8948 +8949 8972 8973 8974 @@ -1874,8 +1880,269 @@ epsg_code 9067 9068 9069 +9071 +9072 +9074 +9075 9139 9140 +9147 +9148 +9152 +9153 +9183 +9184 +9221 +9222 +9248 +9249 +9250 +9251 +9252 +9253 +9254 +9267 +9271 +9272 +9273 +9284 +9285 +9286 +9289 +9290 +9293 +9294 +9299 +9308 +9309 +9332 +9333 +9364 +9372 +9377 +9379 +9380 +9384 +9403 +9422 +9423 +9424 +9425 +9426 +9427 +9428 +9429 +9430 +9449 +9450 +9452 +9453 +9462 +9463 +9464 +9469 +9470 +9474 +9475 +9498 +9500 +9501 +9502 +9503 +9504 +9505 +9506 +9507 +9508 +9509 +9510 +9511 +9512 +9513 +9514 +9515 +9516 +9517 +9518 +9519 +9520 +9521 +9522 +9523 +9524 +9525 +9526 +9527 +9528 +9529 +9530 +9531 +9532 +9533 +9534 +9535 +9536 +9537 +9538 +9539 +9540 +9541 +9542 +9543 +9544 +9546 +9547 +9656 +9657 +9695 +9696 +9701 +9702 +9705 +9707 +9723 +9724 +9725 +9739 +9754 +9755 +9758 +9763 +9776 +9777 +9781 +9782 +9785 +9821 +9831 +9832 +9833 +9834 +9835 +9836 +9837 +9838 +9839 +9840 +9841 +9851 +9852 +9853 +9854 +9855 +9856 +9857 +9858 +9859 +9860 +9861 +9862 +9863 +9864 +9865 +9866 +9871 +9883 +9893 +9895 +9897 +9907 +9924 +9939 +9948 +9949 +9950 +9964 +9969 +9974 +9989 +9990 +10156 +10157 +10158 +10162 +10163 +10164 +10165 +10166 +10167 +10168 +10169 +10170 +10171 +10172 +10173 +10174 +10175 +10177 +10178 +10185 +10191 +10196 +10204 +10209 +10214 +10219 +10224 +10229 +10237 +10245 +10249 +10252 +10256 +10260 +10265 +10268 +10272 +10277 +10283 +10284 +10286 +10288 +10290 +10293 +10298 +10299 +10304 +10305 +10306 +10309 +10310 +10327 +10328 +10329 +10345 +10346 +10355 +10356 +10357 +10365 +10413 +10414 +10468 +10474 +10475 +10486 +10487 +10488 +10507 +10545 +10553 +10554 +10555 +10556 +10570 +10571 +10605 +10606 +10623 +10628 +11114 +11115 +11116 +11117 +11118 +20001 20004 20005 20006 @@ -1905,6 +2172,14 @@ epsg_code 20030 20031 20032 +20033 +20037 +20038 +20040 +20041 +20043 +20045 +20046 20064 20065 20066 @@ -1934,6 +2209,180 @@ epsg_code 20090 20091 20092 +20904 +20905 +20906 +20907 +20908 +20909 +20910 +20911 +20912 +20913 +20914 +20915 +20916 +20917 +20918 +20919 +20920 +20921 +20922 +20923 +20924 +20925 +20926 +20927 +20928 +20929 +20930 +20931 +20932 +21004 +21005 +21006 +21007 +21008 +21009 +21010 +21011 +21012 +21013 +21014 +21015 +21016 +21017 +21018 +21019 +21020 +21021 +21022 +21023 +21024 +21025 +21026 +21027 +21028 +21029 +21030 +21031 +21032 +21207 +21208 +21209 +21210 +21211 +21212 +21213 +21214 +21215 +21216 +21217 +21218 +21219 +21220 +21221 +21222 +21223 +21224 +21225 +21226 +21227 +21228 +21229 +21230 +21231 +21232 +21233 +21234 +21235 +21236 +21237 +21238 +21239 +21240 +21241 +21242 +21243 +21244 +21245 +21246 +21247 +21248 +21249 +21250 +21251 +21252 +21253 +21254 +21255 +21256 +21257 +21258 +21259 +21260 +21261 +21262 +21263 +21264 +21307 +21308 +21309 +21310 +21311 +21312 +21313 +21314 +21315 +21316 +21317 +21318 +21319 +21320 +21321 +21322 +21323 +21324 +21325 +21326 +21327 +21328 +21329 +21330 +21331 +21332 +21333 +21334 +21335 +21336 +21337 +21338 +21339 +21340 +21341 +21342 +21343 +21344 +21345 +21346 +21347 +21348 +21349 +21350 +21351 +21352 +21353 +21354 +21355 +21356 +21357 +21358 +21359 +21360 +21361 +21362 +21363 +21364 21413 21414 21415 @@ -1996,6 +2445,40 @@ epsg_code 22195 22196 22197 +22240 +23301 +23302 +23303 +23304 +23305 +23306 +23307 +23308 +23309 +23310 +23311 +23312 +23313 +23314 +23315 +23316 +23317 +23318 +23319 +23320 +23321 +23322 +23323 +23324 +23325 +23326 +23327 +23328 +23329 +23330 +23331 +23332 +23333 25884 27205 27206 @@ -2161,3 +2644,5 @@ epsg_code 31468 31469 31700 +32661 +32761 diff --git a/scripts/mapaxisorder/mapaxisorder.sh b/scripts/mapaxisorder/mapaxisorder.sh index fe924f2831..759c72c06d 100755 --- a/scripts/mapaxisorder/mapaxisorder.sh +++ b/scripts/mapaxisorder/mapaxisorder.sh @@ -50,7 +50,7 @@ print_header () echo ' * and/or sell copies of the Software, and to permit persons to whom the' echo ' * Software is furnished to do so, subject to the following conditions:' echo ' *' - echo ' * The above copyright notice and this permission notice shall be included in ' + echo ' * The above copyright notice and this permission notice shall be included in' echo ' * all copies of this Software or works derived from this Software.' echo ' *' echo ' * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS' @@ -66,14 +66,11 @@ print_header () print_comment () { - echo ' ' echo '/*' echo ' * Generated file' echo ' *' echo ' * This file was generated from by means of a script. Do not edit manually.' echo ' */' - echo ' ' - } print_body () @@ -81,24 +78,20 @@ print_body () echo '#ifdef __cplusplus' echo 'extern "C" '{ echo '#endif' - echo ' ' - echo 'static unsigned char axisOrientationEpsgCodes[] = {' + echo 'static const unsigned char axisOrientationEpsgCodes[] = {' # traverse array and print out elements for i in {0..4095} do - echo -n " ${ARRAY[$i]:7:1} << 7 | ${ARRAY[$i]:6:1} << 6 | ${ARRAY[$i]:5:1} << 5 | ${ARRAY[$i]:4:1} << 4 | ${ARRAY[$i]:3:1} << 3 | ${ARRAY[$i]:2:1} << 2 | ${ARRAY[$i]:1:1} << 1 | ${ARRAY[$i]:0:1} << 0" + echo -n " ${ARRAY[$i]:7:1} << 7 | ${ARRAY[$i]:6:1} << 6 | ${ARRAY[$i]:5:1} << 5 | ${ARRAY[$i]:4:1} << 4 | ${ARRAY[$i]:3:1} << 3 | ${ARRAY[$i]:2:1} << 2 | ${ARRAY[$i]:1:1} << 1 | ${ARRAY[$i]:0:1} << 0" if [ $i -le 4094 ] then echo , else - echo + echo '};' fi done - echo '};' - echo ' ' - echo '#ifdef __cplusplus' echo '}' echo '#endif' diff --git a/src/mapaxisorder.h b/src/mapaxisorder.h index f3b3dd8aff..505232a563 100644 --- a/src/mapaxisorder.h +++ b/src/mapaxisorder.h @@ -25,17 +25,14 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. ****************************************************************************/ - /* * Generated file * * This file was generated from by means of a script. Do not edit manually. */ - #ifdef __cplusplus extern "C" { #endif - static const unsigned char axisOrientationEpsgCodes[] = { 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, @@ -722,7 +719,7 @@ static const unsigned char axisOrientationEpsgCodes[] = { 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 0 << 2 | 0 << 1 | 1 << 0, 1 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 1 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 1 << 2 | 1 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, @@ -1123,8 +1120,8 @@ static const unsigned char axisOrientationEpsgCodes[] = { 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 1 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 1 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, @@ -1155,7 +1152,7 @@ static const unsigned char axisOrientationEpsgCodes[] = { 0 << 7 | 1 << 6 | 0 << 5 | 1 << 4 | 0 << 3 | 1 << 2 | 0 << 1 | 1 << 0, 0 << 7 | 1 << 6 | 0 << 5 | 1 << 4 | 0 << 3 | 1 << 2 | 0 << 1 | 1 << 0, 0 << 7 | 1 << 6 | 0 << 5 | 1 << 4 | 0 << 3 | 1 << 2 | 0 << 1 | 1 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 1 << 2 | 0 << 1 | 1 << 0, + 0 << 7 | 0 << 6 | 1 << 5 | 1 << 4 | 0 << 3 | 1 << 2 | 0 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, @@ -1170,8 +1167,8 @@ static const unsigned char axisOrientationEpsgCodes[] = { 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 1 << 0, 1 << 7 | 1 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 0 << 2 | 1 << 1 | 1 << 0, - 0 << 7 | 0 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 0 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 1 << 2 | 0 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, @@ -1180,26 +1177,57 @@ static const unsigned char axisOrientationEpsgCodes[] = { 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 1 << 4 | 1 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 1 << 4 | 1 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 1 << 0, + 0 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 1 << 2 | 1 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 1 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 1 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 1 << 4 | 1 << 3 | 0 << 2 | 1 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 1 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 1 << 5 | 1 << 4 | 0 << 3 | 1 << 2 | 1 << 1 | 0 << 0, + 1 << 7 | 1 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 1 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 1 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 0 << 3 | 1 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 1 << 2 | 0 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, @@ -1213,21 +1241,48 @@ static const unsigned char axisOrientationEpsgCodes[] = { 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 1 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 0 << 2 | 1 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 1 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 1 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 1 << 2 | 1 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 0 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, @@ -1248,29 +1303,66 @@ static const unsigned char axisOrientationEpsgCodes[] = { 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 1 << 2 | 1 << 1 | 0 << 0, + 1 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 1 << 0, + 0 << 7 | 0 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 1 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 1 << 0, + 0 << 7 | 1 << 6 | 0 << 5 | 1 << 4 | 1 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 1 << 2 | 0 << 1 | 1 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 1 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 1 << 2 | 1 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 1 << 2 | 1 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 1 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 1 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 1 << 3 | 1 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, @@ -1331,6 +1423,7 @@ static const unsigned char axisOrientationEpsgCodes[] = { 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, @@ -2441,108 +2534,12 @@ static const unsigned char axisOrientationEpsgCodes[] = { 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 0 << 0, 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 1 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 1 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 1 << 0, + 0 << 7 | 1 << 6 | 1 << 5 | 0 << 4 | 1 << 3 | 0 << 2 | 1 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, @@ -2650,6 +2647,10 @@ static const unsigned char axisOrientationEpsgCodes[] = { 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, @@ -2658,6 +2659,11 @@ static const unsigned char axisOrientationEpsgCodes[] = { 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, @@ -2678,36 +2684,27 @@ static const unsigned char axisOrientationEpsgCodes[] = { 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, @@ -2817,6 +2814,7 @@ static const unsigned char axisOrientationEpsgCodes[] = { 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, @@ -2948,12 +2946,11 @@ static const unsigned char axisOrientationEpsgCodes[] = { 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 1 << 7 | 1 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, + 0 << 7 | 0 << 6 | 1 << 5 | 1 << 4 | 1 << 3 | 1 << 2 | 1 << 1 | 1 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, @@ -4119,6 +4116,7 @@ static const unsigned char axisOrientationEpsgCodes[] = { 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, + 0 << 7 | 0 << 6 | 1 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, @@ -4131,9 +4129,7 @@ static const unsigned char axisOrientationEpsgCodes[] = { 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0, - 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 0 << 1 | 0 << 0}; - + 0 << 7 | 0 << 6 | 0 << 5 | 0 << 4 | 0 << 3 | 0 << 2 | 1 << 1 | 0 << 0}; #ifdef __cplusplus } #endif From 50c3d0c9592f00451b563d057ab924d84a24b2fb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2024 08:34:45 -0300 Subject: [PATCH 22/53] handle PHP out of source builds (#7108) Co-authored-by: Jeff McKenna --- src/mapscript/phpng/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mapscript/phpng/CMakeLists.txt b/src/mapscript/phpng/CMakeLists.txt index 7f95b8826b..44407440bd 100644 --- a/src/mapscript/phpng/CMakeLists.txt +++ b/src/mapscript/phpng/CMakeLists.txt @@ -30,6 +30,7 @@ message(STATUS "PHP Include Path: ${PHP_INCLUDE_PATH}") include_directories(${PROJECT_SOURCE_DIR}/src/mapscript/swiginc) include_directories(${PROJECT_SOURCE_DIR}/src/mapscript/) include_directories(${PROJECT_SOURCE_DIR}/src/mapscript/phpng) +include_directories(${PROJECT_BINARY_DIR}/src/mapscript/) include_directories(${CMAKE_CURRENT_BINARY_DIR}) # make sure mapscriptPHP7_wrap.c is found if(WIN32) From e1ded1c6f1f99bf07a557cf72c4dc2bf8d418159 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 18 Jul 2024 09:26:31 -0300 Subject: [PATCH 23/53] Fix build -DWITH_OGCAPI=1 -DWITH_WFS=0 (#7116) Fixes #6752 Co-authored-by: Even Rouault --- src/mapgml.c | 7 +++++++ src/mapogcapi.cpp | 2 +- src/mapows.h | 2 +- src/mapwfs.cpp | 47 ++++++++++++++++++++++++++++------------------- src/mapwfs11.cpp | 2 +- src/mapwfs20.c | 6 +++--- 6 files changed, 41 insertions(+), 25 deletions(-) diff --git a/src/mapgml.c b/src/mapgml.c index a0828cd339..aa07026db9 100644 --- a/src/mapgml.c +++ b/src/mapgml.c @@ -2166,6 +2166,13 @@ int msGMLWriteWFSQuery(mapObj *map, FILE *stream, return (MS_SUCCESS); #else /* Stub for mapscript */ + (void)map; + (void)stream; + (void)default_namespace_prefix; + (void)outputformat; + (void)nWFSVersion; + (void)bUseURN; + (void)bGetPropertyValueRequest; msSetError(MS_MISCERR, "WFS server support not enabled", "msGMLWriteWFSQuery()"); return MS_FAILURE; diff --git a/src/mapogcapi.cpp b/src/mapogcapi.cpp index 861dc34cb7..fb7246e6e3 100644 --- a/src/mapogcapi.cpp +++ b/src/mapogcapi.cpp @@ -126,7 +126,7 @@ static void outputError(OGCAPIErrorType errorType, static int includeLayer(mapObj *map, layerObj *layer) { if (!msOWSRequestIsEnabled(map, layer, "AO", "OGCAPI", MS_FALSE) || - !msWFSIsLayerSupported(layer) || !msIsLayerQueryable(layer)) { + !msIsLayerSupportedForWFSOrOAPIF(layer) || !msIsLayerQueryable(layer)) { return MS_FALSE; } else { return MS_TRUE; diff --git a/src/mapows.h b/src/mapows.h index c1662d6ab7..92a0b2e40e 100644 --- a/src/mapows.h +++ b/src/mapows.h @@ -547,7 +547,7 @@ wfsParamsObj *msWFSCreateParamsObj(void); int msWFSHandleUpdateSequence(mapObj *map, wfsParamsObj *wfsparams, const char *pszFunction); void msWFSFreeParamsObj(wfsParamsObj *wfsparams); -int msWFSIsLayerSupported(layerObj *lp); +int msIsLayerSupportedForWFSOrOAPIF(layerObj *lp); int msWFSException(mapObj *map, const char *locator, const char *code, const char *version); diff --git a/src/mapwfs.cpp b/src/mapwfs.cpp index c04ffcb763..163cfdeeb4 100644 --- a/src/mapwfs.cpp +++ b/src/mapwfs.cpp @@ -514,26 +514,8 @@ static int msWFSGetFeatureApplySRS(mapObj *map, const char *srs, return MS_SUCCESS; } -/* msWFSIsLayerSupported() -** -** Returns true (1) is this layer meets the requirements to be served as -** a WFS feature type. -*/ -int msWFSIsLayerSupported(layerObj *lp) { - /* In order to be supported, lp->type must be specified, even for - ** layers that are OGR, SDE, SDO, etc connections. - */ - if ((lp->type == MS_LAYER_POINT || lp->type == MS_LAYER_LINE || - lp->type == MS_LAYER_POLYGON) && - lp->connectiontype != MS_WMS && lp->connectiontype != MS_GRATICULE) { - return 1; /* true */ - } - - return 0; /* false */ -} - static int msWFSIsLayerAllowed(layerObj *lp, owsRequestObj *ows_request) { - return msWFSIsLayerSupported(lp) && + return msIsLayerSupportedForWFSOrOAPIF(lp) && (msIntegerInArray(lp->index, ows_request->enabled_layers, ows_request->numlayers)); } @@ -4715,6 +4697,10 @@ int msWFSDispatch(mapObj *map, cgiRequestObj *requestobj, return returnvalue; #else + (void)map; + (void)requestobj; + (void)ows_request; + (void)force_wfs_mode; msSetError(MS_WFSERR, "WFS server support is not available.", "msWFSDispatch()"); return (MS_FAILURE); @@ -5591,6 +5577,29 @@ int msWFSParseRequest(mapObj *map, cgiRequestObj *request, msFree(pszSchemaLocation); } +#else + (void)map; + (void)request; + (void)wfsparams; + (void)force_wfs_mode; #endif return MS_SUCCESS; } + +/* msIsLayerSupportedForWFSOrOAPIF() +** +** Returns true (1) is this layer meets the requirements to be served as +** a WFS feature type or OGC API Features. +*/ +int msIsLayerSupportedForWFSOrOAPIF(layerObj *lp) { + /* In order to be supported, lp->type must be specified, even for + ** layers that are OGR, SDE, SDO, etc connections. + */ + if ((lp->type == MS_LAYER_POINT || lp->type == MS_LAYER_LINE || + lp->type == MS_LAYER_POLYGON) && + lp->connectiontype != MS_WMS && lp->connectiontype != MS_GRATICULE) { + return 1; /* true */ + } + + return 0; /* false */ +} diff --git a/src/mapwfs11.cpp b/src/mapwfs11.cpp index bbeb433768..e974f7176a 100644 --- a/src/mapwfs11.cpp +++ b/src/mapwfs11.cpp @@ -520,7 +520,7 @@ int msWFSGetCapabilities11(mapObj *map, wfsParamsObj *params, ows_request->numlayers)) continue; - if (msWFSIsLayerSupported(lp)) + if (msIsLayerSupportedForWFSOrOAPIF(lp)) xmlAddChild(psFtNode, msWFSDumpLayer11(map, lp, psNsOws, OWS_1_1_0, NULL, script_url)); } diff --git a/src/mapwfs20.c b/src/mapwfs20.c index fae773dceb..61ca419b79 100644 --- a/src/mapwfs20.c +++ b/src/mapwfs20.c @@ -815,7 +815,7 @@ int msWFSGetCapabilities20(mapObj *map, wfsParamsObj *params, ows_request->numlayers)) continue; - if (msWFSIsLayerSupported(lp)) { + if (msIsLayerSupportedForWFSOrOAPIF(lp)) { if (psFtNode != NULL) { xmlAddChild(psFtNode, msWFSDumpLayer11(map, lp, psNsOws, OWS_2_0_0, validated_language, script_url)); @@ -1137,7 +1137,7 @@ int msWFSListStoredQueries20(mapObj *map, owsRequestObj *ows_request) { if (!msIntegerInArray(lp->index, ows_request->enabled_layers, ows_request->numlayers) || - !msWFSIsLayerSupported(lp)) + !msIsLayerSupportedForWFSOrOAPIF(lp)) continue; value = msOWSLookupMetadata(&(map->web.metadata), "FO", @@ -1372,7 +1372,7 @@ int msWFSDescribeStoredQueries20(mapObj *map, wfsParamsObj *params, if (!msIntegerInArray(lp->index, ows_request->enabled_layers, ows_request->numlayers) || - !msWFSIsLayerSupported(lp)) + !msIsLayerSupportedForWFSOrOAPIF(lp)) continue; value = msOWSLookupMetadata(&(map->web.metadata), "FO", From 147e7b97edbf7366fdf6747ebc2c21f1ed8addfe Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 20 Jul 2024 17:22:06 +0200 Subject: [PATCH 24/53] msProcessProjection(): strip epsgaxis= MapServer specific parameter that confuses PROJ < 9.5.0 Fixes #7019 --- src/mapproject.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/mapproject.c b/src/mapproject.c index 78cfa66548..9c42fc0705 100644 --- a/src/mapproject.c +++ b/src/mapproject.c @@ -755,16 +755,25 @@ int msProcessProjection(projectionObj *p) { return (-1); } } else { + // Reserve one extra slot for terminating "type=crs" char **args = (char **)msSmallMalloc(sizeof(char *) * (p->numargs + 1)); - memcpy(args, p->args, sizeof(char *) * p->numargs); + int numargs = 0; + for (int i = 0; i < p->numargs; ++i) { + // PROJ doesn't like extraneous parameters that it doesn't recognize + // when initializing a CRS from a +init=epsg:xxxx string + // Cf https://github.com/OSGeo/PROJ/issues/4203 + if (strncmp(p->args[i], "epsgaxis=", strlen("epsgaxis=")) != 0) { + args[numargs] = p->args[i]; + ++numargs; + } + } #if PROJ_VERSION_MAJOR == 6 && PROJ_VERSION_MINOR < 2 /* PROJ lookups are faster with EPSG in uppercase. Fixed in PROJ 6.2 */ /* Do that only for those versions, as it can create confusion if using */ /* a real old-style 'epsg' file... */ char szTemp[24]; - if (p->numargs && - strncmp(args[0], "init=epsg:", strlen("init=epsg:")) == 0 && + if (numargs && strncmp(args[0], "init=epsg:", strlen("init=epsg:")) == 0 && strlen(args[0]) < 24) { strcpy(szTemp, "init=EPSG:"); strcat(szTemp, args[0] + strlen("init=epsg:")); @@ -772,14 +781,15 @@ int msProcessProjection(projectionObj *p) { } #endif - args[p->numargs] = (char *)"type=crs"; + args[numargs] = (char *)"type=crs"; + ++numargs; + #if 0 - for( int i = 0; i < p->numargs + 1; i++ ) + for( int i = 0; i < numargs; i++ ) fprintf(stderr, "%s ", args[i]); fprintf(stderr, "\n"); #endif - if (!(p->proj = - proj_create_argv(p->proj_ctx->proj_ctx, p->numargs + 1, args))) { + if (!(p->proj = proj_create_argv(p->proj_ctx->proj_ctx, numargs, args))) { int l_pj_errno = proj_context_errno(p->proj_ctx->proj_ctx); if (p->numargs > 1) { msSetError(MS_PROJERR, "proj error \"%s\" for \"%s:%s\"", From 6f26c4f8e419c1355d8866df00d541e622a563af Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 18 Jul 2024 17:34:09 +0200 Subject: [PATCH 25/53] tostring() expression function: validate format string, and make sure buffer is large enough --- src/mapparser.c | 43 ++++++++++++++++++-------------- src/mapparser.y | 9 +++++-- src/mapserver.h | 1 + src/mapstring.cpp | 63 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+), 21 deletions(-) diff --git a/src/mapparser.c b/src/mapparser.c index 60265f96ae..259390bc30 100644 --- a/src/mapparser.c +++ b/src/mapparser.c @@ -557,8 +557,8 @@ static const yytype_uint16 yyrline[] = 672, 689, 705, 723, 724, 725, 726, 727, 728, 729, 736, 737, 738, 739, 750, 751, 754, 755, 756, 770, 784, 798, 812, 826, 840, 854, 868, 882, 896, 910, - 924, 939, 961, 962, 963, 967, 972, 976, 980, 984, - 988, 994, 995 + 924, 939, 961, 962, 963, 967, 977, 981, 985, 989, + 993, 999, 1000 }; #endif @@ -2890,66 +2890,71 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); case 95: #line 967 "mapparser.y" /* yacc.c:1646 */ { - (yyval.strval) = (char *) malloc(strlen((yyvsp[-1].strval)) + 64); /* Plenty big? Should use snprintf below... */ - sprintf((yyval.strval), (yyvsp[-1].strval), (yyvsp[-3].dblval)); + char* ret = msToString((yyvsp[-1].strval), (yyvsp[-3].dblval)); free((yyvsp[-1].strval)); + (yyvsp[-1].strval) = NULL; + if(!ret) { + yyerror(p, "tostring() failed."); + return(-1); + } + (yyval.strval) = ret; } -#line 2898 "/vagrant/mapparser.c" /* yacc.c:1646 */ +#line 2903 "/vagrant/mapparser.c" /* yacc.c:1646 */ break; case 96: -#line 972 "mapparser.y" /* yacc.c:1646 */ +#line 977 "mapparser.y" /* yacc.c:1646 */ { (yyvsp[-1].strval) = msCommifyString((yyvsp[-1].strval)); (yyval.strval) = (yyvsp[-1].strval); } -#line 2907 "/vagrant/mapparser.c" /* yacc.c:1646 */ +#line 2912 "/vagrant/mapparser.c" /* yacc.c:1646 */ break; case 97: -#line 976 "mapparser.y" /* yacc.c:1646 */ +#line 981 "mapparser.y" /* yacc.c:1646 */ { msStringToUpper((yyvsp[-1].strval)); (yyval.strval) = (yyvsp[-1].strval); } -#line 2916 "/vagrant/mapparser.c" /* yacc.c:1646 */ +#line 2921 "/vagrant/mapparser.c" /* yacc.c:1646 */ break; case 98: -#line 980 "mapparser.y" /* yacc.c:1646 */ +#line 985 "mapparser.y" /* yacc.c:1646 */ { msStringToLower((yyvsp[-1].strval)); (yyval.strval) = (yyvsp[-1].strval); } -#line 2925 "/vagrant/mapparser.c" /* yacc.c:1646 */ +#line 2930 "/vagrant/mapparser.c" /* yacc.c:1646 */ break; case 99: -#line 984 "mapparser.y" /* yacc.c:1646 */ +#line 989 "mapparser.y" /* yacc.c:1646 */ { msStringInitCap((yyvsp[-1].strval)); (yyval.strval) = (yyvsp[-1].strval); } -#line 2934 "/vagrant/mapparser.c" /* yacc.c:1646 */ +#line 2939 "/vagrant/mapparser.c" /* yacc.c:1646 */ break; case 100: -#line 988 "mapparser.y" /* yacc.c:1646 */ +#line 993 "mapparser.y" /* yacc.c:1646 */ { msStringFirstCap((yyvsp[-1].strval)); (yyval.strval) = (yyvsp[-1].strval); } -#line 2943 "/vagrant/mapparser.c" /* yacc.c:1646 */ +#line 2948 "/vagrant/mapparser.c" /* yacc.c:1646 */ break; case 102: -#line 995 "mapparser.y" /* yacc.c:1646 */ +#line 1000 "mapparser.y" /* yacc.c:1646 */ { (yyval.tmval) = (yyvsp[-1].tmval); } -#line 2949 "/vagrant/mapparser.c" /* yacc.c:1646 */ +#line 2954 "/vagrant/mapparser.c" /* yacc.c:1646 */ break; -#line 2953 "/vagrant/mapparser.c" /* yacc.c:1646 */ +#line 2958 "/vagrant/mapparser.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -3177,7 +3182,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); #endif return yyresult; } -#line 998 "mapparser.y" /* yacc.c:1906 */ +#line 1003 "mapparser.y" /* yacc.c:1906 */ /* diff --git a/src/mapparser.y b/src/mapparser.y index eb180abfd6..9a4f13d9be 100644 --- a/src/mapparser.y +++ b/src/mapparser.y @@ -965,9 +965,14 @@ string_exp: STRING sprintf($$, "%s%s", $1, $3); free($1); free($3); } | TOSTRING '(' math_exp ',' string_exp ')' { - $$ = (char *) malloc(strlen($5) + 64); /* Plenty big? Should use snprintf below... */ - sprintf($$, $5, $3); + char* ret = msToString($5, $3); free($5); + $5 = NULL; + if(!ret) { + yyerror(p, "tostring() failed."); + return(-1); + } + $$ = ret; } | COMMIFY '(' string_exp ')' { $3 = msCommifyString($3); diff --git a/src/mapserver.h b/src/mapserver.h index 167d937a42..cb84d89262 100644 --- a/src/mapserver.h +++ b/src/mapserver.h @@ -2874,6 +2874,7 @@ MS_DLL_EXPORT char *msJoinStrings(char **array, int arrayLength, const char *delimeter); MS_DLL_EXPORT char *msHashString(const char *pszStr); MS_DLL_EXPORT char *msCommifyString(char *str); +MS_DLL_EXPORT char *msToString(const char *format, double value); MS_DLL_EXPORT int msHexToInt(char *hex); MS_DLL_EXPORT char *msGetEncodedString(const char *string, const char *encoding); diff --git a/src/mapstring.cpp b/src/mapstring.cpp index 4435e08c89..f746d63d14 100644 --- a/src/mapstring.cpp +++ b/src/mapstring.cpp @@ -37,6 +37,7 @@ #include "cpl_vsi.h" #include +#include #include #include @@ -1548,6 +1549,68 @@ char *msCommifyString(char *str) { return str; } +/************************************************************************/ +/* msToString() */ +/************************************************************************/ + +char *msToString(const char *format, double value) { + bool pctAlreadyFound = false; + // Validate that the formatting string is OK for a single input double value + int extra_size = 0; + for (const char *ptr = format; *ptr; ++ptr) { + if (*ptr == '%' && ptr[1] == '%') { + ++ptr; + } else if (*ptr == '%') { + if (pctAlreadyFound) { + msSetError(MS_MISCERR, "More than one conversion specifier", + "msToString()"); + return nullptr; + } + pctAlreadyFound = true; + ++ptr; + // Skip flag characters + while (*ptr == '+' || *ptr == '-' || *ptr == ' ' || *ptr == '\'' || + *ptr == '0') { + ++ptr; + } + // Skip width + if (*ptr >= '1' && *ptr <= '9') { + extra_size = atoi(ptr); + do { + ++ptr; + } while (*ptr >= '0' && *ptr <= '9'); + if (extra_size > 1024) { + // To avoid arbitrary memory allocatin + msSetError(MS_MISCERR, "Too large width", "msToString()"); + return nullptr; + } + } + // maximum double value is of the order of ~1e308 + if (extra_size < DBL_MAX_10_EXP) + extra_size = DBL_MAX_10_EXP; + extra_size += 32; // extra margin + + // Skip precision + if (*ptr == '.') { + ++ptr; + while (*ptr >= '0' && *ptr <= '9') + ++ptr; + } + // Check conversion specifier + if (!(*ptr == 'e' || *ptr == 'E' || *ptr == 'f' || *ptr == 'F' || + *ptr == 'g' || *ptr == 'G')) { + msSetError(MS_MISCERR, "Invalid conversion specifier", "msToString()"); + return nullptr; + } + } + } + // extra_size / 3 if thousands' grouping characters is used + const size_t nBufferSize = strlen(format) + extra_size + (extra_size / 3) + 1; + char *ret = static_cast(msSmallMalloc(nBufferSize)); + snprintf(ret, nBufferSize, format, value); + return ret; +} + /* ------------------------------------------------------------------------------- */ /* Replace all occurrences of old with new in str. */ From cd74df3d664572e4a83b3f85e8f49f9bf672ca57 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 18 Jul 2024 18:04:04 +0200 Subject: [PATCH 26/53] Add unit tests for msToString() --- tests/unit/test.cpp | 75 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/tests/unit/test.cpp b/tests/unit/test.cpp index 4644b975d7..24721cf318 100644 --- a/tests/unit/test.cpp +++ b/tests/unit/test.cpp @@ -19,6 +19,17 @@ static void EXPECT_STREQ_func(const char *got, const char *expected, #define EXPECT_STREQ(got, expected) \ EXPECT_STREQ_func(got, expected, __func__, __LINE__) +static void EXPECT_TRUE_FUNC(bool cond, const char *condstr, + const char *function, int line) { + if (!cond) { + fprintf(stderr, "EXPECT_TRUE(\"%s\") failed at %s:%d\n", condstr, function, + line); + gTestRetCode = 1; + } +} + +#define EXPECT_TRUE(cond) EXPECT_TRUE_FUNC(cond, #cond, __func__, __LINE__) + /* ----------------------------------------------------------------------- */ static void testRedactCredentials() { @@ -68,7 +79,71 @@ static void testRedactCredentials() { /* ----------------------------------------------------------------------- */ +static void testToString() { + { + char *ret = msToString("x%f %%y", 1.5); + EXPECT_STREQ(ret, "x1.500000 %y"); + msFree(ret); + } + { + char *ret = msToString("%+f", 1.5); + EXPECT_STREQ(ret, "+1.500000"); + msFree(ret); + } + { + char *ret = msToString("%5.2f", 1.5); + EXPECT_STREQ(ret, " 1.50"); + msFree(ret); + } + { + char *ret = msToString("%f", 1e308); + EXPECT_STREQ( + ret, "10000000000000000109790636294404554174049230967731184633681068290" + "31575854049114915371633289784946888990612496697211725156115902837" + "43140088328307009198146046031271664502933027185697489699588559043" + "33838446616500117842689762621294517762809119578670745812278397017" + "1784415105291802893207873272974885715430223118336.000000"); + msFree(ret); + } + { + char *ret = msToString("%1f", 1e308); + EXPECT_STREQ( + ret, "10000000000000000109790636294404554174049230967731184633681068290" + "31575854049114915371633289784946888990612496697211725156115902837" + "43140088328307009198146046031271664502933027185697489699588559043" + "33838446616500117842689762621294517762809119578670745812278397017" + "1784415105291802893207873272974885715430223118336.000000"); + msFree(ret); + } + { + char *ret = msToString("%320f", 1e308); + EXPECT_STREQ( + ret, " " + "10000000000000000109790636294404554174049230967731184633681068290" + "31575854049114915371633289784946888990612496697211725156115902837" + "43140088328307009198146046031271664502933027185697489699588559043" + "33838446616500117842689762621294517762809119578670745812278397017" + "1784415105291802893207873272974885715430223118336.000000"); + msFree(ret); + } + { + char *ret = msToString("%f%f", 1); + EXPECT_TRUE(ret == nullptr); + } + { + char *ret = msToString("%s", 1); + EXPECT_TRUE(ret == nullptr); + } + { + char *ret = msToString("%100000f", 1); + EXPECT_TRUE(ret == nullptr); + } +} + +/* ----------------------------------------------------------------------- */ + int main() { testRedactCredentials(); + testToString(); return gTestRetCode; } From c156038fdaedacbaef6878d42c57b986f43dc92a Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 19 Jul 2024 18:19:35 +0200 Subject: [PATCH 27/53] CMakeLists.txt: fix build of unit_test --- CMakeLists.txt | 1 - tests/unit/test.cpp | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b6157df9f..562a6e06ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1135,7 +1135,6 @@ option(BUILD_TESTING "Build unit test" ON) if(BUILD_DYNAMIC AND BUILD_TESTING) enable_testing() add_executable(unit_test tests/unit/test.cpp) - target_include_directories(unit_test PRIVATE src) target_link_libraries(unit_test PRIVATE mapserver) add_test(NAME unit_test COMMAND unit_test) endif() diff --git a/tests/unit/test.cpp b/tests/unit/test.cpp index 24721cf318..46ebf1ac7c 100644 --- a/tests/unit/test.cpp +++ b/tests/unit/test.cpp @@ -1,5 +1,5 @@ -#include "mapserver.h" -#include "maperror.h" +#include "../../src/mapserver.h" +#include "../../src/maperror.h" /* ----------------------------------------------------------------------- */ From d971722c5333eb69c85a7229c1eeb1ed39cd9114 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 21 Jul 2024 11:58:00 -0300 Subject: [PATCH 28/53] [Backport branch-8-2] Update security policy to mention 8.2 release (#7125) --- SECURITY.md | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index ac7faa18b5..43e72602a5 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -11,25 +11,30 @@ submissions, when describing the vulnerability (see https://mapserver.org/develo ## Supported Versions The MapServer PSC (Project Steering Committee) will release patches for security vulnerabilities -for the last release branch of the **two most recent release series** (such as 8.x, 7.x. 6.x, etc...). +for the last release branch of the **two most recent release series** (such as 8.x, 7.x, 6.x, etc..., +where "x" is the most recent release in the series, such as: 7.6.6 being supported, but +not 7.6.5). For example, once 8.4 is released, support for 8.2 will be dropped. + Patches will only be provided **for a period of three years** from the release date of the current series. -For example, as 8.0 has been released, now only 8.0.x and 7.6.x will be supported/patched and 7.6.x will -only be supported for three years from the date of the 8.0 series release. +For example, as 8.2 has been released, now 8.2.x, and 7.6.x will be supported/patched, and 7.6.x will +only be supported for three years from the date of the 8.0 series release (until 2025-09-12). Currently, the following versions are supported: -| Version | Supported | -| ------- | ------------------ | -| 8.0.x | :white_check_mark: | -| 7.6.x | :white_check_mark: | -| 7.4.x | :x: | -| 7.2.x | :x: | -| 7.0.x | :x: | -| 6.4.x | :x: | -| < 6.4 | :x: | - -Note: _MapServer 8.0.0 was released on 2022-09-12._ -Note: _MapServer 7.0.0 was released on 2015-07-24._ +| Version | Supported | Support Until | +| ------- | ------------------ |-------------- | +| 8.2.x | :white_check_mark: | | +| 8.0.x | :x: | | +| 7.6.x | :white_check_mark: | 2025-09-12 | +| 7.4.x | :x: | | +| 7.2.x | :x: | | +| 7.0.x | :x: | | +| 6.4.x | :x: | | +| < 6.4 | :x: | | + +- _MapServer 8.2.0 was released on 2024-07-08_ +- _MapServer 8.0.0 was released on 2022-09-12_ +- _MapServer 7.0.0 was released on 2015-07-24_ ## Version Numbering: Explained From 94604573a28a0edc5c5a5e7d8da88384e2a493d1 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Sun, 21 Jul 2024 14:10:12 -0300 Subject: [PATCH 29/53] update for 8.2.1 release --- CMakeLists.txt | 2 +- HISTORY.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 562a6e06ed..d42e56bf07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ include(CheckCSourceCompiles) set (MapServer_VERSION_MAJOR 8) set (MapServer_VERSION_MINOR 2) -set (MapServer_VERSION_REVISION 0) +set (MapServer_VERSION_REVISION 1) set (MapServer_VERSION_SUFFIX "") # Set C++ version diff --git a/HISTORY.md b/HISTORY.md index 894386ae24..c79ab891f9 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -13,6 +13,13 @@ https://mapserver.org/development/changelog/ The online Migration Guide can be found at https://mapserver.org/MIGRATION_GUIDE.html +8.2.1 release (2024-07-21) +-------------------------------- + +- security: validate tostring() expression function (#7123) + +- handle PHP MapScript out of source builds (#7108) + 8.2.0 release (2024-07-08) -------------------------- From f9f380b927eb642737e99e32402afbb5c6a48ad0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 16:31:34 +0200 Subject: [PATCH 30/53] [Backport branch-8-2] Fix CLUSTER layers to return EXTENT (#7126) Fixes #7070 --- msautotest/misc/cluster.map | 89 ++++++++++++ msautotest/misc/expected/cluster.png | Bin 0 -> 4952 bytes msautotest/misc/expected/wms_cluster_cap.xml | 127 +++++++++++++++++ .../wms_cluster_cap_latestversion.xml | 133 ++++++++++++++++++ .../misc/expected/wms_get_map_cluster.png | Bin 0 -> 4965 bytes src/mapcluster.c | 20 ++- src/mappostgis.cpp | 2 +- 7 files changed, 368 insertions(+), 3 deletions(-) create mode 100644 msautotest/misc/cluster.map create mode 100644 msautotest/misc/expected/cluster.png create mode 100644 msautotest/misc/expected/wms_cluster_cap.xml create mode 100644 msautotest/misc/expected/wms_cluster_cap_latestversion.xml create mode 100644 msautotest/misc/expected/wms_get_map_cluster.png diff --git a/msautotest/misc/cluster.map b/msautotest/misc/cluster.map new file mode 100644 index 0000000000..7796f826dd --- /dev/null +++ b/msautotest/misc/cluster.map @@ -0,0 +1,89 @@ +# +# Test a layer with clustering +# +# REQUIRES: INPUT=GDAL INPUT=POSTGIS OUTPUT=PNG SUPPORTS=WMS +# +# RUN_PARMS: cluster.png [MAP2IMG] -m [MAPFILE] -l popplace -o [RESULT] +# +# Capabilities (return latest supported version by default) +# +# RUN_PARMS: wms_cluster_cap_latestversion.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&REQUEST=GetCapabilities" > [RESULT_DEVERSION] +# RUN_PARMS: wms_cluster_cap.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities" > [RESULT_DEVERSION] +# +# Draw a map +# RUN_PARMS: wms_get_map_cluster.png [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&CRS=EPSG:3978&BBOX=2279399,-55345,2600377,461587&FORMAT=image/png&WIDTH=400&HEIGHT=400&STYLES=&LAYERS=popplace" > [RESULT_DEMIME] +# +MAP + +NAME "clusters" +EXTENT 2279399 -55345 2600377 461587 +SIZE 400 400 + +PROJECTION + "epsg:3978" +END + +IMAGETYPE png + +SYMBOL + NAME 'circle' + TYPE ELLIPSE + POINTS 1 1 END + FILLED TRUE +END + +WEB + METADATA + "ows_enable_request" "*" + "ows_srs" "EPSG:3978" + "ows_onlineresource" "http://foo" + END +END + +LAYER + NAME popplace + TYPE POINT + CONNECTIONTYPE POSTGIS + CONNECTION "user=postgres dbname=msautotest" + DATA "the_geom FROM popplace USING UNIQUE gid USING srid=3978" + PROCESSING "CLOSE_CONNECTION=DEFER" + STATUS OFF + CLUSTER + MAXDISTANCE 50 + REGION "ellipse" + END + LABELITEM "Cluster_FeatureCount" + CLASSITEM "Cluster_FeatureCount" + + CLASS + NAME "single" + EXPRESSION "1" + STYLE + COLOR 50 50 50 + SIZE 5 + SYMBOL 'circle' + END + END + + CLASS + NAME "cluster" + EXPRESSION ("[Cluster_FeatureCount]" != "1") + LABEL + SIZE 8 + COLOR 0 0 0 + ALIGN CENTER + PRIORITY 10 + BUFFER 1 + PARTIALS TRUE + POSITION cc + FORCE TRUE + END + STYLE + COLOR 0 255 0 + SIZE 20 + SYMBOL 'circle' + END + END +END + +END diff --git a/msautotest/misc/expected/cluster.png b/msautotest/misc/expected/cluster.png new file mode 100644 index 0000000000000000000000000000000000000000..486bf1620f282f9f85b4bcb927d5972a1e9afc08 GIT binary patch literal 4952 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 literal 0 HcmV?d00001 diff --git a/msautotest/misc/expected/wms_cluster_cap.xml b/msautotest/misc/expected/wms_cluster_cap.xml new file mode 100644 index 0000000000..5f9bf72259 --- /dev/null +++ b/msautotest/misc/expected/wms_cluster_cap.xml @@ -0,0 +1,127 @@ +Content-Type: application/vnd.ogc.wms_xml; charset=UTF-8 + + + + ]> + + + + OGC:WMS + + clusters + + + + + + + + + application/vnd.ogc.wms_xml + + + + + + + + + image/png + image/jpeg + image/png; mode=8bit + image/vnd.jpeg-png + image/vnd.jpeg-png8 + application/x-pdf + image/svg+xml + image/tiff + application/vnd.google-earth.kml+xml + application/vnd.google-earth.kmz + application/vnd.mapbox-vector-tile + application/x-protobuf + application/json + + + + + + + + + text/plain + application/vnd.ogc.gml + + + + + + + + + text/xml + + + + + + + + + image/png + image/jpeg + image/png; mode=8bit + image/vnd.jpeg-png + image/vnd.jpeg-png8 + + + + + + + + + text/xml + + + + + + + + + + application/vnd.ogc.se_xml + application/vnd.ogc.se_inimage + application/vnd.ogc.se_blank + + + + + clusters + + clusters + clusters + EPSG:3978 + + + popplace + + popplace + + + text/xml + + + + + + + diff --git a/msautotest/misc/expected/wms_cluster_cap_latestversion.xml b/msautotest/misc/expected/wms_cluster_cap_latestversion.xml new file mode 100644 index 0000000000..5bdafd0e4e --- /dev/null +++ b/msautotest/misc/expected/wms_cluster_cap_latestversion.xml @@ -0,0 +1,133 @@ +Content-Type: text/xml; charset=UTF-8 + + + + + WMS + + clusters + + + + 4096 + 4096 + + + + + + text/xml + + + + + + + + + image/png + image/jpeg + image/png; mode=8bit + image/vnd.jpeg-png + image/vnd.jpeg-png8 + application/x-pdf + image/svg+xml + image/tiff + application/vnd.google-earth.kml+xml + application/vnd.google-earth.kmz + application/vnd.mapbox-vector-tile + application/x-protobuf + application/json + + + + + + + + + text/plain + application/vnd.ogc.gml + + + + + + + + + text/xml + + + + + + + + + image/png + image/jpeg + image/png; mode=8bit + image/vnd.jpeg-png + image/vnd.jpeg-png8 + + + + + + + + + text/xml + + + + + + + + + + XML + INIMAGE + BLANK + + + + clusters + + clusters + clusters + EPSG:3978 + + -66.328620 + -59.688211 + 42.563121 + 47.941252 + + + popplace + + popplace + + -66.328617 + -59.688212 + 42.563125 + 47.941251 + + + text/xml + + + + + + + diff --git a/msautotest/misc/expected/wms_get_map_cluster.png b/msautotest/misc/expected/wms_get_map_cluster.png new file mode 100644 index 0000000000000000000000000000000000000000..601bc60a47253825fda32abf9ec897878188590b GIT binary patch literal 4965 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 literal 0 HcmV?d00001 diff --git a/src/mapcluster.c b/src/mapcluster.c index 1467dee3c1..ca34369b56 100644 --- a/src/mapcluster.c +++ b/src/mapcluster.c @@ -106,7 +106,7 @@ struct cluster_tree_node { clusterTreeNode *subnode[4]; }; -/* layeinfo */ +/* layerinfo */ struct cluster_layer_info { /* array of features (finalized clusters) */ clusterInfo *finalized; @@ -1415,7 +1415,7 @@ int RebuildClusters(layerObj *layer, int isQuery) { return MS_SUCCESS; } -/* Close the the combined layer */ +/* Close the combined layer */ int msClusterLayerClose(layerObj *layer) { msClusterLayerInfo *layerinfo = (msClusterLayerInfo *)layer->layerinfo; @@ -1584,6 +1584,21 @@ int msClusterLayerGetShape(layerObj *layer, shapeObj *shape, return prepareShape(layer, layerinfo, current, shape); } +int msClusterLayerGetExtent(layerObj *layer, rectObj *extent) { + + msClusterLayerInfo *layerinfo = (msClusterLayerInfo *)layer->layerinfo; + + if (!layerinfo) { + msSetError(MS_MISCERR, "Layer not open: %s", "msClusterLayerGetExtent()", + layer->name); + return MS_FAILURE; + } + + int status = + layerinfo->srcLayer.vtable->LayerGetExtent(&layerinfo->srcLayer, extent); + return status; +} + /* find the next shape with the appropriate shape type */ /* also, load in the attribute data */ /* MS_DONE => no more data */ @@ -1814,6 +1829,7 @@ void msClusterLayerCopyVirtualTable(layerVTableObj *vtable) { vtable->LayerWhichShapes = msClusterLayerWhichShapes; vtable->LayerNextShape = msClusterLayerNextShape; vtable->LayerGetShape = msClusterLayerGetShape; + vtable->LayerGetExtent = msClusterLayerGetExtent; /* layer->vtable->LayerGetShapeCount, use default */ vtable->LayerClose = msClusterLayerClose; diff --git a/src/mappostgis.cpp b/src/mappostgis.cpp index fbc17d24c4..2c59aa4e5d 100644 --- a/src/mappostgis.cpp +++ b/src/mappostgis.cpp @@ -134,7 +134,7 @@ static int arcStrokeCircularString(wkbObj *w, double segment_angle, /* ** msPostGISCloseConnection() ** -** Handler registered witih msConnPoolRegister so that Mapserver +** Handler registered with msConnPoolRegister so that Mapserver ** can clean up open connections during a shutdown. */ static void msPostGISCloseConnection(void *pgconn) { From 35fc344cabb1c9515e93a506c84f9b44ff147464 Mon Sep 17 00:00:00 2001 From: sethg Date: Wed, 10 Jul 2024 17:45:16 +0200 Subject: [PATCH 31/53] Set GDAL_DRIVER_PATH so the GIF driver is found and re-enable tests --- appveyor.yml | 4 +++- msautotest/mspython/test_rq.py | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index ce8a0de890..01ba55fd9d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -85,7 +85,9 @@ build_script: - cd %BUILD_FOLDER%/build # set the MapScript custom environment variable for python 3.8+ - set MAPSERVER_DLL_PATH=%BUILD_FOLDER%/build/Release;%SDK_BIN% - - set PROJ_LIB=%SDK_BIN%/proj9/SHARE + - set PROJ_DATA=%SDK_BIN%/proj9/SHARE + # ensure the GIF driver is available for tests + - set GDAL_DRIVER_PATH=%SDK_BIN%/gdal/plugins # check the mapserver exe can run - mapserv -v - cmake --build . --target pythonmapscript-wheel --config Release diff --git a/msautotest/mspython/test_rq.py b/msautotest/mspython/test_rq.py index 69515f0b57..1bd6f81b98 100755 --- a/msautotest/mspython/test_rq.py +++ b/msautotest/mspython/test_rq.py @@ -398,6 +398,9 @@ def test_rq_9(): def test_rq_10(): + """ + This test requires the GIF driver to be available in GDAL, by setting GDAL_DRIVER_PATH + """ map = mapscript.mapObj(get_relpath_to_this("../gdal/classtest1.map")) layer = map.getLayer(0) @@ -453,6 +456,9 @@ def test_rq_10(): def test_rqtest_12(): + """ + This test requires the GIF driver to be available in GDAL, by setting GDAL_DRIVER_PATH + """ map = mapscript.mapObj(get_relpath_to_this("../gdal/classtest1.map")) layer = map.getLayer(0) From e8c0434598b167f770518f397340ca79ba9ec672 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 11:26:53 -0300 Subject: [PATCH 32/53] [Backport branch-8-2] Fix style scale factor inheritance (#7128) --- msautotest/misc/data/styleitem_style.csv | 2 + .../expected/scale_factor_inheritance.png | Bin 0 -> 440 bytes msautotest/misc/scale_factor_inheritance.map | 25 +++ src/mapdraw.c | 153 ++++++++++-------- src/maplayer.c | 5 + src/mapserver.h | 4 + 6 files changed, 123 insertions(+), 66 deletions(-) create mode 100644 msautotest/misc/data/styleitem_style.csv create mode 100644 msautotest/misc/expected/scale_factor_inheritance.png create mode 100644 msautotest/misc/scale_factor_inheritance.map diff --git a/msautotest/misc/data/styleitem_style.csv b/msautotest/misc/data/styleitem_style.csv new file mode 100644 index 0000000000..fd9963a5a4 --- /dev/null +++ b/msautotest/misc/data/styleitem_style.csv @@ -0,0 +1,2 @@ +WKT,STYLE,comment +"LINESTRING(0.1 0.9,0.9 0.9)","STYLE WIDTH 1 COLOR 0 0 255 END","" diff --git a/msautotest/misc/expected/scale_factor_inheritance.png b/msautotest/misc/expected/scale_factor_inheritance.png new file mode 100644 index 0000000000000000000000000000000000000000..5aa2d669100dfe319eab8c8afac0bcc239a7fdf6 GIT binary patch literal 440 zcmeAS@N?(olHy`uVBq!ia0vp^DIm1Uq#KiTV(`|Q8eZP(KK`FGwIS{$jnpHP&a zcV2qgiq(I29#;-q{bJX#&2h&+NB-Wl&uh(j^=F^I1s#5(TIruVHR5=3_2Q3n{95~8 zuRe0??JeeB_4g}%bplkcJ-sBCVRJqE;p1Og8$a<^Z_LOyIa3t*pE2;y%MW$O(}Xui zdM~@P@9wwhQ^I>pzf>K4EB3s&`Q+Z6wTsja{ [RESULT_DEMIME] + +MAP + EXTENT 0 -1 1 1 + SIZE 100 100 + LAYER + NAME "test" + EXTENT 0 -1 1 1 + CONNECTIONTYPE OGR + CONNECTION "data/styleitem_style.csv" + DATA "styleitem_style" + TYPE LINE + STATUS ON + SYMBOLSCALEDENOM 500 + STYLEITEM "STYLE" + CLASS + END + END +END diff --git a/src/mapdraw.c b/src/mapdraw.c index 8be0f280af..332c4e6167 100644 --- a/src/mapdraw.c +++ b/src/mapdraw.c @@ -36,6 +36,91 @@ #include "mapows.h" #include "cpl_port.h" +/* msGetGeoCellSize + * + * A helper function to get the first parameter for msUpdateClassScaleFactor() + */ +double msGetGeoCellSize(const mapObj *map) { + double geo_cellsize; + + /* We will need a cellsize that represents a real georeferenced */ + /* coordinate cellsize here, so compute it from saved extents. */ + + geo_cellsize = map->cellsize; + if (map->gt.need_geotransform == MS_TRUE) { + double cellsize_x = + (map->saved_extent.maxx - map->saved_extent.minx) / map->width; + double cellsize_y = + (map->saved_extent.maxy - map->saved_extent.miny) / map->height; + + geo_cellsize = + sqrt(cellsize_x * cellsize_x + cellsize_y * cellsize_y) / sqrt(2.0); + } + return geo_cellsize; +} + +/* msUpdateClassScaleFactor + * + * Provides correct scale factor inheritance for Class and all of its + * styles and labels. + */ +void msUpdateClassScaleFactor(double geo_cellsize, const mapObj *map, + const layerObj *layer, classObj *c) { + if (c->sizeunits == MS_INHERIT) + c->scalefactor = layer->scalefactor; + else if (c->sizeunits != MS_PIXELS) + c->scalefactor = + (msInchesPerUnit(c->sizeunits, 0) / msInchesPerUnit(map->units, 0)) / + geo_cellsize; + else if (layer->symbolscaledenom > 0 && map->scaledenom > 0) + c->scalefactor = layer->symbolscaledenom / map->scaledenom * + map->resolution / map->defresolution; + else + c->scalefactor = map->resolution / map->defresolution; + for (int sid = 0; sid < c->numstyles; sid++) { + styleObj *style = c->styles[sid]; + if (style->sizeunits == MS_INHERIT) + style->scalefactor = c->scalefactor; + else if (style->sizeunits != MS_PIXELS) + style->scalefactor = (msInchesPerUnit(style->sizeunits, 0) / + msInchesPerUnit(map->units, 0)) / + geo_cellsize; + else if (layer->symbolscaledenom > 0 && map->scaledenom > 0) + style->scalefactor = layer->symbolscaledenom / map->scaledenom * + map->resolution / map->defresolution; + else + style->scalefactor = map->resolution / map->defresolution; + } + for (int sid = 0; sid < c->numlabels; sid++) { + labelObj *label = c->labels[sid]; + if (label->sizeunits == MS_INHERIT) + label->scalefactor = c->scalefactor; + else if (label->sizeunits != MS_PIXELS) + label->scalefactor = (msInchesPerUnit(label->sizeunits, 0) / + msInchesPerUnit(map->units, 0)) / + geo_cellsize; + else if (layer->symbolscaledenom > 0 && map->scaledenom > 0) + label->scalefactor = layer->symbolscaledenom / map->scaledenom * + map->resolution / map->defresolution; + else + label->scalefactor = map->resolution / map->defresolution; + for (int lsid = 0; lsid < label->numstyles; lsid++) { + styleObj *lstyle = label->styles[lsid]; + if (lstyle->sizeunits == MS_INHERIT) + lstyle->scalefactor = label->scalefactor; + else if (lstyle->sizeunits != MS_PIXELS) + lstyle->scalefactor = (msInchesPerUnit(lstyle->sizeunits, 0) / + msInchesPerUnit(map->units, 0)) / + geo_cellsize; + else if (layer->symbolscaledenom > 0 && map->scaledenom > 0) + lstyle->scalefactor = layer->symbolscaledenom / map->scaledenom * + map->resolution / map->defresolution; + else + lstyle->scalefactor = map->resolution / map->defresolution; + } + } +} + /* msPrepareImage() * * Returns a new imageObj ready for rendering the current map. @@ -154,19 +239,7 @@ imageObj *msPrepareImage(mapObj *map, int allow_nonsquare) { if (map->gt.need_geotransform) msMapSetFakedExtent(map); - /* We will need a cellsize that represents a real georeferenced */ - /* coordinate cellsize here, so compute it from saved extents. */ - - geo_cellsize = map->cellsize; - if (map->gt.need_geotransform == MS_TRUE) { - double cellsize_x = - (map->saved_extent.maxx - map->saved_extent.minx) / map->width; - double cellsize_y = - (map->saved_extent.maxy - map->saved_extent.miny) / map->height; - - geo_cellsize = - sqrt(cellsize_x * cellsize_x + cellsize_y * cellsize_y) / sqrt(2.0); - } + geo_cellsize = msGetGeoCellSize(map); /* compute layer/class/style/label scale factors now */ for (int lid = 0; lid < map->numlayers; lid++) { @@ -182,59 +255,7 @@ imageObj *msPrepareImage(mapObj *map, int allow_nonsquare) { layer->scalefactor = map->resolution / map->defresolution; for (int cid = 0; cid < layer->numclasses; cid++) { classObj *class = GET_CLASS(map, lid, cid); - if (class->sizeunits == MS_INHERIT) - class->scalefactor = layer->scalefactor; - else if (class->sizeunits != MS_PIXELS) - class->scalefactor = (msInchesPerUnit(class->sizeunits, 0) / - msInchesPerUnit(map->units, 0)) / - geo_cellsize; - else if (layer->symbolscaledenom > 0 && map->scaledenom > 0) - class->scalefactor = layer->symbolscaledenom / map->scaledenom * - map->resolution / map->defresolution; - else - class->scalefactor = map->resolution / map->defresolution; - for (int sid = 0; sid < class->numstyles; sid++) { - styleObj *style = class->styles[sid]; - if (style->sizeunits == MS_INHERIT) - style->scalefactor = class->scalefactor; - else if (style->sizeunits != MS_PIXELS) - style->scalefactor = (msInchesPerUnit(style->sizeunits, 0) / - msInchesPerUnit(map->units, 0)) / - geo_cellsize; - else if (layer->symbolscaledenom > 0 && map->scaledenom > 0) - style->scalefactor = layer->symbolscaledenom / map->scaledenom * - map->resolution / map->defresolution; - else - style->scalefactor = map->resolution / map->defresolution; - } - for (int sid = 0; sid < class->numlabels; sid++) { - labelObj *label = class->labels[sid]; - if (label->sizeunits == MS_INHERIT) - label->scalefactor = class->scalefactor; - else if (label->sizeunits != MS_PIXELS) - label->scalefactor = (msInchesPerUnit(label->sizeunits, 0) / - msInchesPerUnit(map->units, 0)) / - geo_cellsize; - else if (layer->symbolscaledenom > 0 && map->scaledenom > 0) - label->scalefactor = layer->symbolscaledenom / map->scaledenom * - map->resolution / map->defresolution; - else - label->scalefactor = map->resolution / map->defresolution; - for (int lsid = 0; lsid < label->numstyles; lsid++) { - styleObj *lstyle = label->styles[lsid]; - if (lstyle->sizeunits == MS_INHERIT) - lstyle->scalefactor = label->scalefactor; - else if (lstyle->sizeunits != MS_PIXELS) - lstyle->scalefactor = (msInchesPerUnit(lstyle->sizeunits, 0) / - msInchesPerUnit(map->units, 0)) / - geo_cellsize; - else if (layer->symbolscaledenom > 0 && map->scaledenom > 0) - lstyle->scalefactor = layer->symbolscaledenom / map->scaledenom * - map->resolution / map->defresolution; - else - lstyle->scalefactor = map->resolution / map->defresolution; - } - } + msUpdateClassScaleFactor(geo_cellsize, map, layer, class); } } diff --git a/src/maplayer.c b/src/maplayer.c index c7add51faf..512df12075 100644 --- a/src/maplayer.c +++ b/src/maplayer.c @@ -1395,6 +1395,9 @@ int msLayerGetFeatureStyle(mapObj *map, layerObj *layer, classObj *c, } msUpdateStyleFromString(c->styles[0], stylestring); + double geo_cellsize = msGetGeoCellSize(map); + msUpdateClassScaleFactor(geo_cellsize, map, layer, c); + if (c->styles[0]->symbolname) { if ((c->styles[0]->symbol = msGetSymbolIndex( &(map->symbolset), c->styles[0]->symbolname, MS_TRUE)) == -1) { @@ -1412,6 +1415,8 @@ int msLayerGetFeatureStyle(mapObj *map, layerObj *layer, classObj *c, c->layer = layer; } msUpdateClassFromString(c, stylestring); + double geo_cellsize = msGetGeoCellSize(map); + msUpdateClassScaleFactor(geo_cellsize, map, layer, c); } else if (strncasecmp(stylestring, "pen", 3) == 0 || strncasecmp(stylestring, "brush", 5) == 0 || strncasecmp(stylestring, "symbol", 6) == 0 || diff --git a/src/mapserver.h b/src/mapserver.h index cb84d89262..73098f7a22 100644 --- a/src/mapserver.h +++ b/src/mapserver.h @@ -3278,6 +3278,10 @@ rectObj msUVRASTERGetSearchRect(layerObj *layer, mapObj *map); /* Prototypes for functions in mapdraw.c */ /* ==================================================================== */ +MS_DLL_EXPORT double msGetGeoCellSize(const mapObj *map); +MS_DLL_EXPORT void msUpdateClassScaleFactor(double geo_cellsize, + const mapObj *map, + const layerObj *layer, classObj *c); MS_DLL_EXPORT imageObj *msPrepareImage(mapObj *map, int allow_nonsquare); MS_DLL_EXPORT imageObj *msDrawMap(mapObj *map, int querymap); MS_DLL_EXPORT int msLayerIsVisible(mapObj *map, layerObj *layer); From 2341aa4d45d7a0acdfe002974cf058d928b03714 Mon Sep 17 00:00:00 2001 From: Howard Butler Date: Wed, 7 Aug 2024 12:04:40 -0500 Subject: [PATCH 33/53] allow explicit override of MapScript output folder via CMake variable --- src/mapscript/python/CMakeLists.txt | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/mapscript/python/CMakeLists.txt b/src/mapscript/python/CMakeLists.txt index 529fdd82b9..19645635f6 100644 --- a/src/mapscript/python/CMakeLists.txt +++ b/src/mapscript/python/CMakeLists.txt @@ -42,18 +42,20 @@ file(READ ${SETUP_PY_TEMP} SETUP_CONTENT) file(GENERATE OUTPUT $/setup.py INPUT ${SETUP_PY_TEMP}) -if(MSVC) - set(OUTPUT_FOLDER ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}) -else() - # for non-Windows builds there are no build type subfolders (e.g. Release, Debug etc.) - set(OUTPUT_FOLDER ${CMAKE_CURRENT_BINARY_DIR}) -endif() +IF (NOT DEFINED MAPSCRIPT_WORKING_DIR) + if(MSVC) + set(MAPSCRIPT_WORKING_DIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}) + else() + # for non-Windows builds there are no build type subfolders (e.g. Release, Debug etc.) + set(MAPSCRIPT_WORKING_DIR ${CMAKE_CURRENT_BINARY_DIR}) + endif() +ENDIF (NOT DEFINED MAPSCRIPT_WORKING_DIR) if(WIN32) # Windows venv binaries are in a different location than Linux - set(Python_VENV_SCRIPTS ${OUTPUT_FOLDER}/mapscriptvenv/Scripts) + set(Python_VENV_SCRIPTS ${MAPSCRIPT_WORKING_DIR}/mapscriptvenv/Scripts) else() - set(Python_VENV_SCRIPTS ${OUTPUT_FOLDER}/mapscriptvenv/bin) + set(Python_VENV_SCRIPTS ${MAPSCRIPT_WORKING_DIR}/mapscriptvenv/bin) endif() add_custom_target( @@ -64,7 +66,7 @@ add_custom_target( add_custom_command( DEPENDS ${SWIG_MODULE_pythonmapscript_REAL_NAME} OUTPUT mapscriptvenv.stamp - WORKING_DIRECTORY ${OUTPUT_FOLDER} + WORKING_DIRECTORY ${MAPSCRIPT_WORKING_DIR} COMMAND ${Python_EXECUTABLE} -m pip install pip --upgrade COMMAND ${Python_EXECUTABLE} -m pip install virtualenv COMMAND ${Python_EXECUTABLE} -m virtualenv mapscriptvenv @@ -75,7 +77,7 @@ add_custom_command( add_custom_command( DEPENDS mapscriptvenv.stamp OUTPUT mapscriptwheel.stamp - WORKING_DIRECTORY ${OUTPUT_FOLDER} + WORKING_DIRECTORY ${MAPSCRIPT_WORKING_DIR} COMMAND ${Python_VENV_SCRIPTS}/python -m build --wheel > wheel_build.log COMMENT "Building the mapscript Python wheel" ) @@ -84,7 +86,7 @@ add_custom_command( WORKING_DIRECTORY ${Python_VENV_SCRIPTS} # make sure scripts aren't run when from the same folder as mapscript.py DEPENDS mapscriptwheel.stamp OUTPUT mapscripttests.stamp - COMMAND ${Python_VENV_SCRIPTS}/pip install --no-index --find-links=${OUTPUT_FOLDER}/dist mapscript + COMMAND ${Python_VENV_SCRIPTS}/pip install --no-index --find-links=${MAPSCRIPT_WORKING_DIR}/dist mapscript # ERROR: file or package not found: mapscript.tests (missing __init__.py?) is caused by # ImportError: DLL load failed while importing _mapscript: The specified module could not be found. COMMAND ${Python_VENV_SCRIPTS}/python -m pytest --pyargs mapscript.tests @@ -124,14 +126,14 @@ install( execute_process( COMMAND ${Python_EXECUTABLE} -m pip install \${PYTHON_ROOT} \${PYTHON_PREFIX} . - WORKING_DIRECTORY ${OUTPUT_FOLDER} + WORKING_DIRECTORY ${MAPSCRIPT_WORKING_DIR} ) " ) message(STATUS "CMake Version: ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}") message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}") -message(STATUS "Python MapScript output directory: ${OUTPUT_FOLDER}") +message(STATUS "Python MapScript output directory: ${MAPSCRIPT_WORKING_DIR}") message(STATUS "Python Executable: ${Python_EXECUTABLE}") message(STATUS "Python Version: ${Python_VERSION}") message(STATUS "Python site packages: ${Python_SITELIB}") From 0ffa3a7c1d76d367b3c399f9413b00b844cafc67 Mon Sep 17 00:00:00 2001 From: Roel Arents Date: Thu, 22 Aug 2024 12:46:08 +0200 Subject: [PATCH 34/53] fix proj epsgaxis= stripping to also work for +epsgaxis= related to #7121 --- src/mapproject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapproject.c b/src/mapproject.c index 9c42fc0705..31b848988b 100644 --- a/src/mapproject.c +++ b/src/mapproject.c @@ -762,7 +762,7 @@ int msProcessProjection(projectionObj *p) { // PROJ doesn't like extraneous parameters that it doesn't recognize // when initializing a CRS from a +init=epsg:xxxx string // Cf https://github.com/OSGeo/PROJ/issues/4203 - if (strncmp(p->args[i], "epsgaxis=", strlen("epsgaxis=")) != 0) { + if (strstr(p->args[i], "epsgaxis=") == NULL) { args[numargs] = p->args[i]; ++numargs; } From a10c2ed5dc50173700149e31fd5a727007d61b42 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 25 Aug 2024 15:50:23 +0200 Subject: [PATCH 35/53] [Backport branch-8-2] fix stripping epsgaxis= before importing OSR projection (#7145) * strip epsgaxis= before importing OSR projection fixes #6966 * Update expected files --------- Co-authored-by: Roel Arents Co-authored-by: Even Rouault --- .../expected/wcs11_post_getcov_grd_4326.dat | 2 +- .../wxs/expected/wcs_20_getcov_outputcrs.tif | Bin 1619 -> 1618 bytes .../wxs/expected/wcs_20_getcov_reproj.tif | Bin 540 -> 539 bytes ...ov_reproj_scaling_resolution_trim_both.tif | Bin 1419 -> 1418 bytes ...0_getcov_reproj_scaling_size_trim_both.tif | Bin 1619 -> 1618 bytes .../expected/wcs_20_getcov_subsettingcrs.tif | Bin 540 -> 539 bytes .../expected/wcs_20_post_getcov_reproj.tif | Bin 540 -> 539 bytes ...ov_reproj_scaling_resolution_trim_both.tif | Bin 1419 -> 1418 bytes ...t_getcov_reproj_scaling_size_trim_both.tif | Bin 1619 -> 1618 bytes ...20_post_getcov_subsettingcrs_outputcrs.tif | Bin 444 -> 443 bytes .../wxs/expected/wcs_getcov_grd_11_4326.dat | 2 +- .../expected/wcs_mask_20_getcov_reproj.tif | Bin 540 -> 539 bytes ...ov_reproj_scaling_resolution_trim_both.tif | Bin 1419 -> 1418 bytes ...0_getcov_reproj_scaling_size_trim_both.tif | Bin 1619 -> 1618 bytes .../expected/wcs_mask_getcov_grd_11_4326.dat | 2 +- ..._netcdf_input_output_wcs20_get_coverage.nc | Bin 3116 -> 3164 bytes msautotest/wxs/expected/wfs2_query_cache.json | 1 + .../wfs2_query_cache_no_default_extent.json | 1 + msautotest/wxs/expected/wms_raster_query.json | 1 + src/mapgdal.cpp | 4 +++- 20 files changed, 9 insertions(+), 4 deletions(-) diff --git a/msautotest/wxs/expected/wcs11_post_getcov_grd_4326.dat b/msautotest/wxs/expected/wcs11_post_getcov_grd_4326.dat index 28a6d9974e..c26ad93677 100644 --- a/msautotest/wxs/expected/wcs11_post_getcov_grd_4326.dat +++ b/msautotest/wxs/expected/wcs11_post_getcov_grd_4326.dat @@ -63,5 +63,5 @@ Content-Transfer-Encoding: binary Content-ID: coverage/out.prj Content-Disposition: INLINE -GEOGCS["GCS_unknown",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]] +GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]] --wcs-- diff --git a/msautotest/wxs/expected/wcs_20_getcov_outputcrs.tif b/msautotest/wxs/expected/wcs_20_getcov_outputcrs.tif index 386e923f8661be4912408fb3dbc1f978aac2ae0e..1f3ccb6e5c48687b518425e1ac92b90e5a0fd44e 100644 GIT binary patch delta 34 qcmcc2bBSkyALF8l{?i#bCO&UxWS^YRsLdAc9;{$tvUwrnCKdqM0Skfv delta 35 rcmcb_bD3v?ALHVQ{?i#bCq8dyJNLs|-H? diff --git a/msautotest/wxs/expected/wcs_20_getcov_reproj_scaling_resolution_trim_both.tif b/msautotest/wxs/expected/wcs_20_getcov_reproj_scaling_resolution_trim_both.tif index 9442dff92cc0302e84eab98e34cf7cdc20289a31..cf583834a898293fe235b1983f385491f375a55e 100644 GIT binary patch delta 34 qcmeC??&6-{$GB*s|8z!JNLs|-H? diff --git a/msautotest/wxs/expected/wcs_20_post_getcov_reproj.tif b/msautotest/wxs/expected/wcs_20_post_getcov_reproj.tif index 6f09681836a69d1225526a855fee6439d74af415..6d6dee636c82041af6a0643641143aeb765bc1fa 100644 GIT binary patch delta 33 pcmbQkGMiJNLs|-H? diff --git a/msautotest/wxs/expected/wcs_20_post_getcov_reproj_scaling_resolution_trim_both.tif b/msautotest/wxs/expected/wcs_20_post_getcov_reproj_scaling_resolution_trim_both.tif index e4b12894d15c0b14d562c3a376f61cfed3453915..dd71be7d41d751a108d652dec21011f6125ef840 100644 GIT binary patch delta 34 qcmeC??&6-{$GB*s|8z!JNLs|-H? diff --git a/msautotest/wxs/expected/wcs_mask_20_getcov_reproj_scaling_resolution_trim_both.tif b/msautotest/wxs/expected/wcs_mask_20_getcov_reproj_scaling_resolution_trim_both.tif index f8f08129960b1796d3b137307754c76359913450..1c7d71e1aee645b55d00697950a220d414048b70 100644 GIT binary patch delta 34 qcmeC??&6-{$GB*s|8z!{w0|Nyk10xeF1$P%m9|h;4)Wnih=lp_7 z4F&y@+yZ?wv*aYBG!v8fG)pt1&74fKEKEEKn>E;&8Ts|xUH#pigQJzg-Gdb@OeR~i zKj2F&$t)>NNmbJE^A8H~m~6)>HF+_IAghV7k(ttD2M%%4HRW(RG4W_j-oV+##G^CW UhO3{^X7d>?WkyDy$sf3F04ZfVYXATM delta 193 zcmca3u|{IU8AjWX(o_Yn(mVx269q#vD=F>0iGhI;pO(pUIUSj}e@uSB*~P^DXL1f#KO@iP OKU~U;j53oIcx(W@4L2A7 diff --git a/msautotest/wxs/expected/wfs2_query_cache.json b/msautotest/wxs/expected/wfs2_query_cache.json index 5f5421268e..f5a04cd05d 100644 --- a/msautotest/wxs/expected/wfs2_query_cache.json +++ b/msautotest/wxs/expected/wfs2_query_cache.json @@ -4,6 +4,7 @@ Content-Type: application/json; subtype=geojson; charset=utf-8 { "type": "FeatureCollection", "name": "province", +"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, "features": [ { "type": "Feature", "properties": { "NAME_E": "Quebec" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -61.5105, 47.7742 ], [ -61.5089, 47.7886 ], [ -61.4927, 47.7964 ], [ -61.4576, 47.7874 ], [ -61.46, 47.7679 ], [ -61.4835, 47.7696 ], [ -61.5105, 47.7742 ] ] ] } }, { "type": "Feature", "properties": { "NAME_E": "Nova Scotia" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -60.2049, 47.1664 ], [ -60.2117, 47.1799 ], [ -60.1944, 47.1927 ], [ -60.1734, 47.1876 ], [ -60.1688, 47.175 ], [ -60.2049, 47.1664 ] ] ] } }, diff --git a/msautotest/wxs/expected/wfs2_query_cache_no_default_extent.json b/msautotest/wxs/expected/wfs2_query_cache_no_default_extent.json index 13fa0cba10..6b458a1170 100644 --- a/msautotest/wxs/expected/wfs2_query_cache_no_default_extent.json +++ b/msautotest/wxs/expected/wfs2_query_cache_no_default_extent.json @@ -4,6 +4,7 @@ Content-Type: application/json; subtype=geojson; charset=utf-8 { "type": "FeatureCollection", "name": "province2", +"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, "features": [ { "type": "Feature", "properties": { "NAME_E": "Quebec" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -61.5105, 47.7742 ], [ -61.5089, 47.7886 ], [ -61.4927, 47.7964 ], [ -61.4576, 47.7874 ], [ -61.46, 47.7679 ], [ -61.4835, 47.7696 ], [ -61.5105, 47.7742 ] ] ] } }, { "type": "Feature", "properties": { "NAME_E": "Nova Scotia" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -60.2049, 47.1664 ], [ -60.2117, 47.1799 ], [ -60.1944, 47.1927 ], [ -60.1734, 47.1876 ], [ -60.1688, 47.175 ], [ -60.2049, 47.1664 ] ] ] } }, diff --git a/msautotest/wxs/expected/wms_raster_query.json b/msautotest/wxs/expected/wms_raster_query.json index bd6efebd2d..9b0f0c58b9 100644 --- a/msautotest/wxs/expected/wms_raster_query.json +++ b/msautotest/wxs/expected/wms_raster_query.json @@ -4,6 +4,7 @@ Content-Type: application/json; subtype=geojson; charset=utf-8 { "type": "FeatureCollection", "name": "raster", +"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, "features": [ { "type": "Feature", "properties": { "x": "15.937198", "y": "48.99088", "value_0": "141", "value_1": "69", "value_2": "144", "value_3": "106", "value_4": "55", "value_5": "99", "value_6": "127", "value_7": "38", "value_8": "43", "value_list": "141,69,144,106,55,99,127,38,43", "red": "141", "green": "69", "blue": "144" }, "geometry": { "type": "Point", "coordinates": [ 15.937197681359713, 48.990879590043257 ] } } ] diff --git a/src/mapgdal.cpp b/src/mapgdal.cpp index b4544f36d2..b1484dc40f 100644 --- a/src/mapgdal.cpp +++ b/src/mapgdal.cpp @@ -634,7 +634,9 @@ char *msProjectionObj2OGCWKT(projectionObj *projection) /* -------------------------------------------------------------------- */ /* Look for an EPSG-like projection argument */ /* -------------------------------------------------------------------- */ - if (projection->numargs == 1 && + if ((projection->numargs == 1 || + (projection->numargs == 2 && + strstr(projection->args[1], "epsgaxis=") != NULL)) && (pszInitEpsg = strcasestr(projection->args[0], "init=epsg:"))) { int nEpsgCode = atoi(pszInitEpsg + strlen("init=epsg:")); eErr = OSRImportFromEPSG(hSRS, nEpsgCode); From eaa1aad269436bb18fbd061b2dadea731b10998d Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 25 Aug 2024 15:32:11 +0200 Subject: [PATCH 36/53] Fix compilation error against FreeType 2.13.3 Fixes #7142 --- src/mapagg.cpp | 11 +++++------ src/renderers/agg/src/agg_font_freetype.cpp | 9 ++++----- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/mapagg.cpp b/src/mapagg.cpp index ba7243c0bf..3f4ea7204b 100644 --- a/src/mapagg.cpp +++ b/src/mapagg.cpp @@ -291,15 +291,14 @@ bool decompose_ft_outline(const FT_Outline &outline, bool flip_y, FT_Vector *point; FT_Vector *limit; - char *tags; - int n; // index of contour in outline - int first; // index of first point in contour - char tag; // current point's state + unsigned n; // index of contour in outline + unsigned first; // index of first point in contour + char tag; // current point's state first = 0; - for (n = 0; n < outline.n_contours; n++) { + for (n = 0; n < (unsigned)outline.n_contours; n++) { int last; // index of last point in contour last = outline.contours[n]; @@ -310,7 +309,7 @@ bool decompose_ft_outline(const FT_Outline &outline, bool flip_y, FT_Vector v_control = v_start; point = outline.points + first; - tags = outline.tags + first; + auto tags = outline.tags + first; tag = FT_CURVE_TAG(tags[0]); // A contour cannot start with a cubic control point! diff --git a/src/renderers/agg/src/agg_font_freetype.cpp b/src/renderers/agg/src/agg_font_freetype.cpp index 1308869d24..733ad0f424 100644 --- a/src/renderers/agg/src/agg_font_freetype.cpp +++ b/src/renderers/agg/src/agg_font_freetype.cpp @@ -154,15 +154,14 @@ namespace mapserver FT_Vector* point; FT_Vector* limit; - char* tags; - int n; // index of contour in outline - int first; // index of first point in contour + unsigned n; // index of contour in outline + unsigned first; // index of first point in contour char tag; // current point's state first = 0; - for(n = 0; n < outline.n_contours; n++) + for(n = 0; n < (unsigned)outline.n_contours; n++) { int last; // index of last point in contour @@ -174,7 +173,7 @@ namespace mapserver FT_Vector v_control = v_start; point = outline.points + first; - tags = outline.tags + first; + auto tags = outline.tags + first; tag = FT_CURVE_TAG(tags[0]); // A contour cannot start with a cubic control point! From 52381fad8df271c54b4865b1fa610da0640a8b9c Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 1 Sep 2024 20:28:32 +0200 Subject: [PATCH 37/53] msInterpolationDataset(): fix memory leak (Coverity CID 1599443) --- src/interpolation.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/interpolation.c b/src/interpolation.c index f4a3ee8886..be2b2fee25 100644 --- a/src/interpolation.c +++ b/src/interpolation.c @@ -54,7 +54,7 @@ int msInterpolationDataset(mapObj *map, imageObj *image, layerObj *interpolation_layer, void **hDSvoid, void **cleanup_ptr) { - int status, layer_idx, i, nclasses = 0, npoints = 0, length = 0; + int status, layer_idx, i, npoints = 0, length = 0; rectObj searchrect; shapeObj shape; layerObj *layer = NULL; @@ -64,7 +64,6 @@ int msInterpolationDataset(mapObj *map, imageObj *image, unsigned char *iValues; GDALDatasetH hDS; interpolationProcessingParams interpParams; - int *classgroup = NULL; memset(&interpParams, 0, sizeof(interpParams)); @@ -153,6 +152,8 @@ int msInterpolationDataset(mapObj *map, imageObj *image, /* nothing to do */ if (status == MS_SUCCESS) { /* at least one sample may have overlapped */ + int nclasses = 0; + int *classgroup = NULL; if (layer->classgroup && layer->numclasses > 0) classgroup = msAllocateValidClassGroups(layer, &nclasses); @@ -220,6 +221,9 @@ int msInterpolationDataset(mapObj *map, imageObj *image, nextshape: msFreeShape(&shape); } + + msFree(classgroup); + // number of layer points. npoints = length / 3; } else if (status != MS_DONE) { From 0c3bfcbf2a17fa8916db8b06bf6a39fb024c0727 Mon Sep 17 00:00:00 2001 From: Jeff McKenna Date: Mon, 2 Sep 2024 13:21:39 -0300 Subject: [PATCH 38/53] update for 8.2.2 release --- CMakeLists.txt | 2 +- HISTORY.md | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d42e56bf07..79175b0cfc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ include(CheckCSourceCompiles) set (MapServer_VERSION_MAJOR 8) set (MapServer_VERSION_MINOR 2) -set (MapServer_VERSION_REVISION 1) +set (MapServer_VERSION_REVISION 2) set (MapServer_VERSION_SUFFIX "") # Set C++ version diff --git a/HISTORY.md b/HISTORY.md index c79ab891f9..32b8a252ea 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -13,8 +13,15 @@ https://mapserver.org/development/changelog/ The online Migration Guide can be found at https://mapserver.org/MIGRATION_GUIDE.html +8.2.2 release (2024-09-02) +-------------------------- + +- fix build against FreeType 2.13.3 release (#7142) + +see detailed changelog for other fixes + 8.2.1 release (2024-07-21) --------------------------------- +-------------------------- - security: validate tostring() expression function (#7123) From 963366329f86be6d78898e2c0c67e014963bc2c4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 11:43:27 +0200 Subject: [PATCH 39/53] fix links to licenses of FlatGeobuf & FlatBuffers (#7164) Co-authored-by: Marc Jansen --- LICENSE.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index 78a65ccd0a..5ad42611da 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -28,9 +28,9 @@ SOFTWARE. FlatGeobuf ---------- -Refer to the FlatGeobuf license found at [/flatgeobuf/LICENSE](flatgeobuf/LICENSE) +Refer to the FlatGeobuf license found at [/src/flatgeobuf/LICENSE](src/flatgeobuf/LICENSE) FlatBuffers ----------- -Refer to the FlatBuffers license found at [/flatgeobuf/include/flatbuffers/LICENSE](flatgeobuf/include/flatbuffers/LICENSE) \ No newline at end of file +Refer to the FlatBuffers license found at [/src/flatgeobuf/include/flatbuffers/LICENSE](src/flatgeobuf/include/flatbuffers/LICENSE) \ No newline at end of file From bc4b0fb245664ef37f5dea5c775cc69f33c97763 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 29 Sep 2024 14:55:34 +0200 Subject: [PATCH 40/53] MS_LEGEND_KEYSIZE_MAX to 1000 (#7157) See issue 7152: https://github.com/MapServer/MapServer/issues/7152 Co-authored-by: gu-LGB --- src/mapserver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mapserver.h b/src/mapserver.h index 73098f7a22..964112a5a5 100644 --- a/src/mapserver.h +++ b/src/mapserver.h @@ -1927,7 +1927,7 @@ typedef struct { /************************************************************************/ #define MS_LEGEND_KEYSIZE_MIN 5 -#define MS_LEGEND_KEYSIZE_MAX 200 +#define MS_LEGEND_KEYSIZE_MAX 1000 #define MS_LEGEND_KEYSPACING_MIN 0 #define MS_LEGEND_KEYSPACING_MAX 50 From d8e4891d1b87efbbc0db60d6b81e042bfc593650 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 4 Oct 2024 07:37:46 -0300 Subject: [PATCH 41/53] msProjectionContextGetFromPool(): set thread_id to current thread (#7165) Co-authored-by: Even Rouault --- src/mapproject.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mapproject.c b/src/mapproject.c index 31b848988b..19fc78c607 100644 --- a/src/mapproject.c +++ b/src/mapproject.c @@ -2495,6 +2495,7 @@ projectionContext *msProjectionContextGetFromPool() { if (headOfLinkedListOfProjContext) { LinkedListOfProjContext *next = headOfLinkedListOfProjContext->next; context = headOfLinkedListOfProjContext->context; + context->thread_id = msGetThreadId(); msFree(headOfLinkedListOfProjContext); headOfLinkedListOfProjContext = next; } else { From 316995ebfddc126ea238c3cd3b6d657aa8323947 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 23:12:07 +0200 Subject: [PATCH 42/53] Don't call xmlMemoryDump (#7170) Co-authored-by: sethg --- src/mapowscommon.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mapowscommon.c b/src/mapowscommon.c index ce108e7002..692c5dbdaf 100644 --- a/src/mapowscommon.c +++ b/src/mapowscommon.c @@ -869,7 +869,6 @@ int msOWSSchemaValidation(const char *xml_schema, const char *xml) { /* If XML Schema hasn't been rightly loaded */ if (schema == NULL) { - xmlMemoryDump(); xmlCleanupParser(); return ret; } From 402377481de6242f38863e35c3e588919be6660c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 07:01:47 +0200 Subject: [PATCH 43/53] [Backport branch-8-2] Pin Python version for precommit action and update flake8 (#7173) * Fix Python version for precommit * Update flake8 version * Update flake8 config file to new format --------- Co-authored-by: sethg --- .flake8 | 50 ++++++++++++++++++++----------- .github/workflows/code_checks.yml | 2 ++ .pre-commit-config.yaml | 2 +- 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/.flake8 b/.flake8 index 0d1fd1c33b..a570f5e020 100644 --- a/.flake8 +++ b/.flake8 @@ -1,19 +1,35 @@ [flake8] -max_line_length = 88 +max-line-length = 88 ignore = - C408 # Unnecessary dict/list/tuple call - rewrite as a literal - E203 # whitespace before ':' - doesn't work well with black - E225 # missing whitespace around operator - let black worry about that - E262 # inline comment should start with '# ' - E265 # block comment should start with '# ' - E266 # too many leading '#' for block comment - E302 # expected 2 blank lines, found 1 - E402 # module level import not at top of file - E501 # line too long - let black handle that - E711 # comparison to None should be - E712 # comparison to False/True should be - E741 # ambiguous variable name - F405 # may be undefined, or defined from star imports - W291 # trailing - W503 # line break occurred before a binary operator - let black worry about that - W504 # line break occurred adter a binary operator - let black worry about that + # Unnecessary dict/list/tuple call - rewrite as a literal + C408 + # whitespace before ':' - doesn't work well with black + E203 + # missing whitespace around operator - let black worry about that + E225 + # inline comment should start with '# ' + E262 + # block comment should start with '# ' + E265 + # too many leading '#' for block comment + E266 + # expected 2 blank lines, found 1 + E302 + # module level import not at top of file + E402 + # line too long - let black handle that + E501 + # comparison to None should be + E711 + # comparison to False/True should be + E712 + # ambiguous variable name + E741 + # may be undefined, or defined from star imports + F405 + # trailing + W291 + # line break occurred before a binary operator - let black worry about that + W503 + # line break occurred after a binary operator - let black worry about that + W504 diff --git a/.github/workflows/code_checks.yml b/.github/workflows/code_checks.yml index 86cea4d3ab..d3a61b0807 100644 --- a/.github/workflows/code_checks.yml +++ b/.github/workflows/code_checks.yml @@ -16,4 +16,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 + with: + python-version: '3.12' - uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0b991cc649..6465ead931 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: isort args: ["--profile", "black"] - repo: https://github.com/pycqa/flake8 - rev: 3.9.2 + rev: 7.1.1 hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-clang-format From aeed013cfa82c3386f9daf9b07e56a2cf40b9a02 Mon Sep 17 00:00:00 2001 From: sethg Date: Thu, 3 Oct 2024 18:07:36 +0200 Subject: [PATCH 44/53] Store layer count before applying SLD --- src/mapfile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mapfile.c b/src/mapfile.c index 45db899c81..a301a8072a 100644 --- a/src/mapfile.c +++ b/src/mapfile.c @@ -6900,7 +6900,10 @@ static bool msGetCWD(char *szBuffer, size_t nBufferSize, */ static void applyStyleItemToLayer(mapObj *map) { - for (int i = 0; i < map->numlayers; i++) { + // applying SLD can create cloned layers so store the original layer count + int layerCount = map->numlayers; + + for (int i = 0; i < layerCount; i++) { layerObj *layer = GET_LAYER(map, i); if (layer->styleitem && STARTS_WITH_CI(layer->styleitem, "sld://")) { From 30aebfad48d03badf91911ac58d9ee56e3be7c6a Mon Sep 17 00:00:00 2001 From: sethg Date: Thu, 3 Oct 2024 18:39:51 +0200 Subject: [PATCH 45/53] Add 2 more tests for SLD in Mapfile --- .../sld/data/duplicated_namedstyles.sld | 37 ++++++++++++++++++ msautotest/sld/data/nomatch_namedstyles.sld | 20 ++++++++++ .../expected/sld_styleitem_file_duplicate.png | Bin 0 -> 4343 bytes 3 files changed, 57 insertions(+) create mode 100644 msautotest/sld/data/duplicated_namedstyles.sld create mode 100644 msautotest/sld/data/nomatch_namedstyles.sld create mode 100644 msautotest/sld/expected/sld_styleitem_file_duplicate.png diff --git a/msautotest/sld/data/duplicated_namedstyles.sld b/msautotest/sld/data/duplicated_namedstyles.sld new file mode 100644 index 0000000000..6803c9eefb --- /dev/null +++ b/msautotest/sld/data/duplicated_namedstyles.sld @@ -0,0 +1,37 @@ + + + duplicate + + green + true + + + + + 3 + 0.5 + #00FF00 + + + + + + + + duplicate + + blue + + + + + 1 + 0.5 + #0000FF + + + + + + + \ No newline at end of file diff --git a/msautotest/sld/data/nomatch_namedstyles.sld b/msautotest/sld/data/nomatch_namedstyles.sld new file mode 100644 index 0000000000..6005fde389 --- /dev/null +++ b/msautotest/sld/data/nomatch_namedstyles.sld @@ -0,0 +1,20 @@ + + + no_matching_layer + + green + true + + + + + 3 + 0.5 + #00FF00 + + + + + + + \ No newline at end of file diff --git a/msautotest/sld/expected/sld_styleitem_file_duplicate.png b/msautotest/sld/expected/sld_styleitem_file_duplicate.png new file mode 100644 index 0000000000000000000000000000000000000000..c48d782640ce716f7e691c07ae23e8c972981d2e GIT binary patch literal 4343 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 W`lYL$I*bDiCQH-HCa;a$V*dw=6D9)y literal 0 HcmV?d00001 From a9b0138dc29d675740d3285e64dca371c1f452e9 Mon Sep 17 00:00:00 2001 From: sethg Date: Thu, 3 Oct 2024 21:58:18 +0200 Subject: [PATCH 46/53] Add 2 new tests --- msautotest/sld/sld_styleitem_file.map | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/msautotest/sld/sld_styleitem_file.map b/msautotest/sld/sld_styleitem_file.map index 839eca0586..acb2fbb9f0 100644 --- a/msautotest/sld/sld_styleitem_file.map +++ b/msautotest/sld/sld_styleitem_file.map @@ -23,6 +23,12 @@ # if the SLD path file is missing an empty image will be returned unless a fallback CLASS has been set. An error will be written to the log. # RUN_PARMS: sld_styleitem_file_missing.png [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.3&REQUEST=GetMap&CRS=EPSG:4326&BBOX=42,-5,52,9&FORMAT=image/png&WIDTH=200&HEIGHT=200&LAYERS=missing&STYLES=" > [RESULT_DEMIME] +# test for when no matching NamedLayer is found in the SLD file - an empty image will be output +# RUN_PARMS: sld_styleitem_file_no_match.png [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.3&REQUEST=GetMap&CRS=EPSG:4326&BBOX=42,-5,52,9&FORMAT=image/png&WIDTH=200&HEIGHT=200&LAYERS=no_match&STYLES=" > [RESULT_DEMIME] + +# test for two NamedLayers with the same name in the SLD file +# RUN_PARMS: sld_styleitem_file_duplicate.png [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.3&REQUEST=GetMap&CRS=EPSG:4326&BBOX=42,-5,52,9&FORMAT=image/png&WIDTH=200&HEIGHT=200&LAYERS=duplicate&STYLES=" > [RESULT_DEMIME] + # test applying SLD to a raster LAYER # RUN_PARMS: sld_styleitem_file_raster.png [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WMS&VERSION=1.3&REQUEST=GetMap&CRS=EPSG:4326&BBOX=40,7,50,31&FORMAT=image/png&WIDTH=200&HEIGHT=200&LAYERS=rgb&STYLES=" > [RESULT_DEMIME] @@ -87,6 +93,21 @@ MAP END END END + LAYER + NAME "duplicate" + DATA "hexagon" + TYPE LINE + STYLEITEM "sld://data/duplicated_namedstyles.sld" + END + LAYER + NAME "no_match" + DATA "hexagon" + TYPE LINE + METADATA + "SLD_USE_FIRST_NAMEDLAYER" "false" + END + STYLEITEM "sld://data/nomatch_namedstyles.sld" + END LAYER NAME rgb TYPE raster From 65f4cb46eeefa8ab79af92cb9346dbe3392f9e76 Mon Sep 17 00:00:00 2001 From: sethg Date: Thu, 3 Oct 2024 22:21:12 +0200 Subject: [PATCH 47/53] Add test result from vagrant --- .../sld/expected/sld_styleitem_file_no_match.png | Bin 0 -> 586 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 msautotest/sld/expected/sld_styleitem_file_no_match.png diff --git a/msautotest/sld/expected/sld_styleitem_file_no_match.png b/msautotest/sld/expected/sld_styleitem_file_no_match.png new file mode 100644 index 0000000000000000000000000000000000000000..a9f7e05deb917da551dacdb2eeaebfc7f75062b9 GIT binary patch literal 586 zcmeAS@N?(olHy`uVBq!ia0vp^CqS5k2}mkgS)OEIU=s9naSW-L^Y)S>CxZdcfdgH0 z>v=;3*`E42%FSeN{3(0D_n1 Date: Thu, 17 Oct 2024 14:57:44 +0200 Subject: [PATCH 48/53] SLD: fix having a TextSymbolizer rule after a PolygonSymbolizer one Currently if we have a SLD like: ```xml ... default ... ... ``` the PolygonSymbolizer rule is no applied, only the TextSymolizer one. This is due to the logic in msSLDParseRule() that inappropriately overrides the layerObj::type member. --- msautotest/sld/label.map | 2 +- src/mapogcsld.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/msautotest/sld/label.map b/msautotest/sld/label.map index 6e986e6abe..8ceb325bee 100644 --- a/msautotest/sld/label.map +++ b/msautotest/sld/label.map @@ -5,7 +5,7 @@ # # ---