[Git][debian-gis-team/mapserver][upstream] New upstream version 8.2.2
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Mon Sep 2 18:02:02 BST 2024
Bas Couwenberg pushed to branch upstream at Debian GIS Project / mapserver
Commits:
17353793 by Bas Couwenberg at 2024-09-02T18:39:27+02:00
New upstream version 8.2.2
- - - - -
13 changed files:
- CMakeLists.txt
- HISTORY.md
- src/interpolation.c
- src/mapagg.cpp
- src/mapcluster.c
- src/mapdraw.c
- src/mapgdal.cpp
- src/maplayer.c
- src/mappostgis.cpp
- src/mapproject.c
- src/mapscript/python/CMakeLists.txt
- src/mapserver.h
- src/renderers/agg/src/agg_font_freetype.cpp
Changes:
=====================================
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
=====================================
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)
=====================================
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) {
=====================================
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!
=====================================
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;
=====================================
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);
}
}
=====================================
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);
=====================================
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 ||
=====================================
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) {
=====================================
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;
}
=====================================
src/mapscript/python/CMakeLists.txt
=====================================
@@ -42,18 +42,20 @@ file(READ ${SETUP_PY_TEMP} SETUP_CONTENT)
file(GENERATE OUTPUT $<TARGET_FILE_DIR:${SWIG_MODULE_pythonmapscript_REAL_NAME}>/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}")
=====================================
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);
=====================================
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!
View it on GitLab: https://salsa.debian.org/debian-gis-team/mapserver/-/commit/1735379331c083b7cdbefc6691533d078f824599
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/mapserver/-/commit/1735379331c083b7cdbefc6691533d078f824599
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20240902/69577723/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list