[Git][debian-gis-team/mapnik][master] 5 commits: New upstream version 4.1.4+ds
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Thu Nov 6 14:45:04 GMT 2025
Bas Couwenberg pushed to branch master at Debian GIS Project / mapnik
Commits:
e7a3c0d2 by Bas Couwenberg at 2025-11-06T15:26:54+01:00
New upstream version 4.1.4+ds
- - - - -
ec08779f by Bas Couwenberg at 2025-11-06T15:27:00+01:00
Update upstream source from tag 'upstream/4.1.4+ds'
Update to upstream version '4.1.4+ds'
with Debian dir 1cefbbf8c5a85ff0396fc3eb8729ad594b579e94
- - - - -
0505c4af by Bas Couwenberg at 2025-11-06T15:33:59+01:00
New upstream release.
- - - - -
a86db2e6 by Bas Couwenberg at 2025-11-06T15:33:59+01:00
Drop gdal-3.12.patch, applied upstream.
- - - - -
f5c66c6f by Bas Couwenberg at 2025-11-06T15:34:46+01:00
Set distribution to unstable.
- - - - -
19 changed files:
- CHANGELOG.md
- debian/changelog
- − debian/patches/gdal-3.12.patch
- − debian/patches/series
- include/mapnik/feature_style_processor_impl.hpp
- include/mapnik/json/properties_generator_grammar_impl.hpp
- include/mapnik/layer.hpp
- include/mapnik/util/featureset_buffer.hpp
- + include/mapnik/util/sort_by.hpp
- include/mapnik/version.hpp
- plugins/input/ogr/ogr_datasource.cpp
- plugins/input/tiles/CMakeLists.txt
- plugins/input/tiles/build.py
- plugins/input/tiles/pmtiles_source.hpp
- plugins/input/tiles/vector_tiles_featureset.cpp
- src/image_util.cpp
- src/layer.cpp
- src/load_map.cpp
- src/save_map.cpp
Changes:
=====================================
CHANGELOG.md
=====================================
@@ -6,6 +6,20 @@ Developers: Please commit along with changes.
For a complete change history, see the git log.
+## Mapnik 4.1.4
+
+Released November 6th, 2025
+
+(Packaged from [82a684d80](https://github.com/mapnik/mapnik/commit/82a684d80))
+
+- Re-apply 32-bits warning fixes via @hummeltech
+- tiles.input - don't abort fetching remote tiles on an empty results (e.g HTTP 204)
+- Implement sort-by clause parser `<field-name>, [DESC | ASC]` e.g "name DESC" (default to ASC)
+- ogr.input - no need for version check via @rouault (ref #4531)
+- Fix boost warnings (‘#pragma message: This header is deprecated. Use <boost/phoenix.hpp> instead.’)
+- Layer - `sort-by` parameter (#4532)
+- tiles.input - link to zlib (ref #4535)
+
## Mapnik 4.1.3
Released October 1st, 2025
=====================================
debian/changelog
=====================================
@@ -1,8 +1,10 @@
-mapnik (4.1.3+ds-3) UNRELEASED; urgency=medium
+mapnik (4.1.4+ds-1) unstable; urgency=medium
+ * New upstream release.
* Use test-build-validate-cleanup instead of test-build-twice.
+ * Drop gdal-3.12.patch, applied upstream.
- -- Bas Couwenberg <sebastic at debian.org> Sat, 25 Oct 2025 12:59:41 +0200
+ -- Bas Couwenberg <sebastic at debian.org> Thu, 06 Nov 2025 15:34:30 +0100
mapnik (4.1.3+ds-2) unstable; urgency=medium
=====================================
debian/patches/gdal-3.12.patch deleted
=====================================
@@ -1,17 +0,0 @@
-Description: Fix FTBFS with GDAL 3.12.0.
-Author: Bas Couwenberg <sebastic at debian.org>
-Forwarded: https://github.com/mapnik/mapnik/pull/4531
-Applied-Upstream: https://github.com/mapnik/mapnik/commit/ca60dda74671cb373419b8a8f91b0f730c16f161
-Origin: https://github.com/mapnik/mapnik/commit/4188a8d4e847902537c05dc76e98c974723e270a
-
---- a/plugins/input/ogr/ogr_datasource.cpp
-+++ b/plugins/input/ogr/ogr_datasource.cpp
-@@ -378,7 +378,7 @@ void ogr_datasource::init(mapnik::parame
- }
- }
- mapnik::parameters& extra_params = desc_.get_extra_parameters();
-- OGRSpatialReference* srs_ref = layer->GetSpatialRef();
-+ OGRSpatialReference const* srs_ref = layer->GetSpatialRef();
- char* srs_output = nullptr;
- if (srs_ref && srs_ref->exportToProj4(&srs_output) == OGRERR_NONE)
- {
=====================================
debian/patches/series deleted
=====================================
@@ -1 +0,0 @@
-gdal-3.12.patch
=====================================
include/mapnik/feature_style_processor_impl.hpp
=====================================
@@ -418,12 +418,17 @@ void feature_style_processor<Processor>::prepare_layer(layer_rendering_material&
}
q.set_filter_factor(collector.get_filter_factor());
- // Also query the group by attribute
+ // Also query the group-by and sort-by attribute
std::string const& group_by = lay.group_by();
if (!group_by.empty())
{
q.add_property_name(group_by);
}
+ auto sort_by = lay.sort_by();
+ if (sort_by)
+ {
+ q.add_property_name((*sort_by).first);
+ }
bool cache_features = lay.cache_features() && active_styles.size() > 1;
@@ -482,11 +487,34 @@ void feature_style_processor<Processor>::render_material(layer_rendering_materia
bool cache_features = lay.cache_features() && active_styles.size() > 1;
datasource_ptr ds = lay.datasource();
+
+ auto sort_by = lay.sort_by();
std::string group_by = lay.group_by();
- // Render incrementally when the column that we group by changes value.
- if (!group_by.empty())
+ if (sort_by) // sort features
+ {
+ featureset_ptr features = *featureset_ptr_list.begin();
+ if (features)
+ {
+ std::shared_ptr<featureset_buffer> cache = std::make_shared<featureset_buffer>();
+ feature_ptr feature;
+ while ((feature = features->next()))
+ {
+ cache->push(feature);
+ }
+ cache->sort_by((*sort_by).first, (*sort_by).second);
+ std::size_t i = 0;
+ for (feature_type_style const* style : active_styles)
+ {
+ cache->prepare();
+ render_style(p, style, rule_caches[i++], cache, *proj_trans_ptr);
+ }
+ // cache->clear();
+ }
+ }
+ else if (!group_by.empty())
{
+ // Render incrementally when the column that we group by changes value.
featureset_ptr features = *featureset_ptr_list.begin();
if (features)
{
=====================================
include/mapnik/json/properties_generator_grammar_impl.hpp
=====================================
@@ -25,7 +25,7 @@
#include <mapnik/warning.hpp>
MAPNIK_DISABLE_WARNING_PUSH
#include <mapnik/warning_ignore.hpp>
-#include <boost/spirit/include/phoenix.hpp>
+#include <boost/phoenix.hpp>
#include <boost/fusion/adapted/std_tuple.hpp>
MAPNIK_DISABLE_WARNING_POP
=====================================
include/mapnik/layer.hpp
=====================================
@@ -27,10 +27,11 @@
#include <mapnik/well_known_srs.hpp>
#include <mapnik/geometry/box2d.hpp>
#include <mapnik/image_compositing.hpp>
-
+#include <mapnik/util/sort_by.hpp>
// stl
#include <vector>
#include <memory>
+#include <tuple>
namespace mapnik {
@@ -191,6 +192,16 @@ class MAPNIK_DECL layer
*/
std::string const& group_by() const;
+ /*!
+ * @param column Set the field rendering of this layer is sorted by.
+ */
+ void set_sort_by(std::string const& column, bool desc = false);
+
+ /*!
+ * @return optional field (+order) rendering of this layer is sorted by.
+ */
+ std::optional<sort_by_type> const& sort_by() const;
+
/*!
* @brief Attach a datasource for this layer.
*
@@ -232,6 +243,7 @@ class MAPNIK_DECL layer
bool clear_label_cache_;
bool cache_features_;
std::string group_by_;
+ std::optional<sort_by_type> sort_by_;
std::vector<std::string> styles_;
std::vector<layer> layers_;
datasource_ptr ds_;
=====================================
include/mapnik/util/featureset_buffer.hpp
=====================================
@@ -59,6 +59,21 @@ class featureset_buffer : public Featureset
}
void clear() { features_.clear(); }
+ void sort_by(std::string const& name, bool desc = false)
+ {
+ if (desc)
+ {
+ std::sort(features_.begin(), features_.end(), [&name](feature_ptr const& lhs, feature_ptr const& rhs) {
+ return lhs->get(name) > rhs->get(name);
+ });
+ }
+ else
+ {
+ std::sort(features_.begin(), features_.end(), [&name](feature_ptr const& lhs, feature_ptr const& rhs) {
+ return lhs->get(name) < rhs->get(name);
+ });
+ }
+ }
private:
std::vector<feature_ptr> features_;
=====================================
include/mapnik/util/sort_by.hpp
=====================================
@@ -0,0 +1,58 @@
+/*****************************************************************************
+ *
+ * This file is part of Mapnik (c++ mapping toolkit)
+ *
+ * Copyright (C) 2025 Artem Pavlenko
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *****************************************************************************/
+
+#ifndef MAPNIK_SORT_BY_HPP
+#define MAPNIK_SORT_BY_HPP
+
+#include <boost/spirit/home/x3.hpp>
+#include <boost/fusion/include/std_pair.hpp>
+
+namespace mapnik {
+
+using sort_by_type = std::pair<std::string, bool>;
+
+inline bool parse_sort_by(std::string const& str, sort_by_type& result)
+{
+ namespace x3 = boost::spirit::x3;
+ auto itr = str.begin();
+ auto end = str.end();
+ auto apply_sort_by = [&](auto const& ctx) {
+ result.first = _attr(ctx);
+ };
+ auto apply_desc = [&](auto const& ctx) {
+ result.second = true;
+ };
+ if (!x3::phrase_parse(itr,
+ end,
+ x3::no_skip[(+x3::char_("a-zA-Z_0-9-"))][apply_sort_by] >
+ -(x3::no_case[x3::lit("DESC")][apply_desc] | x3::no_case[x3::lit("ASC")]),
+ // ASC is a default
+ x3::space) ||
+ (itr != end))
+ {
+ return false;
+ }
+ return true;
+}
+
+} // namespace mapnik
+#endif // MAPNIK_SORT_BY_HPP
=====================================
include/mapnik/version.hpp
=====================================
@@ -27,7 +27,7 @@
#define MAPNIK_MAJOR_VERSION 4
#define MAPNIK_MINOR_VERSION 1
-#define MAPNIK_PATCH_VERSION 3
+#define MAPNIK_PATCH_VERSION 4
#define MAPNIK_VERSION MAPNIK_VERSION_ENCODE(MAPNIK_MAJOR_VERSION, MAPNIK_MINOR_VERSION, MAPNIK_PATCH_VERSION)
=====================================
plugins/input/ogr/ogr_datasource.cpp
=====================================
@@ -378,7 +378,7 @@ void ogr_datasource::init(mapnik::parameters const& params)
}
}
mapnik::parameters& extra_params = desc_.get_extra_parameters();
- OGRSpatialReference* srs_ref = layer->GetSpatialRef();
+ OGRSpatialReference const* srs_ref = layer->GetSpatialRef();
char* srs_output = nullptr;
if (srs_ref && srs_ref->exportToProj4(&srs_output) == OGRERR_NONE)
{
=====================================
plugins/input/tiles/CMakeLists.txt
=====================================
@@ -29,6 +29,7 @@ target_include_directories(input-tiles ${_plugin_visibility} "${PROJECT_SOURCE_D
target_link_libraries(input-tiles ${_plugin_visibility}
mapnik::mapnik
+ ZLIB::ZLIB
SQLite::SQLite3
Boost::url
Boost::context
=====================================
plugins/input/tiles/build.py
=====================================
@@ -49,7 +49,7 @@ plugin_sources = Split(
boost_url = 'boost_url%s' % env['BOOST_APPEND']
boost_context = 'boost_context%s' % env['BOOST_APPEND']
-libraries = ['sqlite3', boost_url, boost_context]
+libraries = ['sqlite3', 'z', boost_url, boost_context]
if env['TILES_INPUT_SSL'] and env['HAS_OPENSSL']:
plugin_env.Append(CPPDEFINES = 'MAPNIK_HAS_OPENSSL')
=====================================
plugins/input/tiles/pmtiles_source.hpp
=====================================
@@ -470,7 +470,7 @@ class pmtiles_source : public tiles_source,
{
std::string decompressed_dir;
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
- std::string_view buffer{file_.buffer().first + dir_offset, dir_length};
+ std::string_view buffer{file_.buffer().first + dir_offset, static_cast<std::size_t>(dir_length)};
#else
std::string buffer;
buffer.resize(dir_length);
@@ -559,7 +559,7 @@ class pmtiles_source : public tiles_source,
{
std::string metadata;
#if defined(MAPNIK_MEMORY_MAPPED_FILE)
- std::string_view buffer{file_.buffer().first + metadata_offset_, metadata_length_};
+ std::string_view buffer{file_.buffer().first + metadata_offset_, static_cast<std::size_t>(metadata_length_)};
#else
std::string buffer;
buffer.resize(metadata_length_);
=====================================
plugins/input/tiles/vector_tiles_featureset.cpp
=====================================
@@ -190,7 +190,6 @@ bool vector_tiles_featureset::next_tile()
workers_.emplace_back([this] { ioc_.run(); });
}
// consume tiles from the queue
- bool status = false;
while (!done_.load())
{
tile_data tile;
@@ -204,24 +203,19 @@ bool vector_tiles_featureset::next_tile()
{
auto buffer = itr->second;
vector_tile_.reset(new mvt_io(std::move(buffer), context_, tile.x, tile.y, zoom_, layer_));
- status = true;
+ return true;
}
- else if (tile.data)
+ else if (tile.data && !tile.data->empty())
{
- if ((*tile.data).empty())
- continue;
std::string decompressed;
mapnik::vector_tile_impl::zlib_decompress((*tile.data).data(), (*tile.data).size(), decompressed);
tiles_cache_.emplace(datasource_key, decompressed);
vector_tile_.reset(new mvt_io(std::move(decompressed), context_, tile.x, tile.y, zoom_, layer_));
- status = true;
+ return true;
}
- if (consumed_count_ == QUEUE_SIZE_)
- done_.store(true);
- break;
}
if (consumed_count_ == num_tiles_)
done_.store(true);
}
- return status;
+ return false;
}
=====================================
src/image_util.cpp
=====================================
@@ -54,9 +54,9 @@ MAPNIK_DISABLE_WARNING_POP
#include <sstream>
#include <algorithm>
-#if __cpp_lib_execution >= 201603
-#include <execution>
-#endif
+// #if __cpp_lib_execution >= 201603
+// #include <execution>
+// #endif
namespace mapnik {
=====================================
src/layer.cpp
=====================================
@@ -40,6 +40,7 @@ layer::layer(std::string const& _name, std::string const& _srs)
clear_label_cache_(false),
cache_features_(false),
group_by_(),
+ sort_by_(),
styles_(),
layers_(),
ds_(),
@@ -59,6 +60,7 @@ layer::layer(layer const& rhs)
clear_label_cache_(rhs.clear_label_cache_),
cache_features_(rhs.cache_features_),
group_by_(rhs.group_by_),
+ sort_by_(rhs.sort_by_),
styles_(rhs.styles_),
layers_(rhs.layers_),
ds_(rhs.ds_),
@@ -78,6 +80,7 @@ layer::layer(layer&& rhs)
clear_label_cache_(std::move(rhs.clear_label_cache_)),
cache_features_(std::move(rhs.cache_features_)),
group_by_(std::move(rhs.group_by_)),
+ sort_by_(std::move(rhs.sort_by_)),
styles_(std::move(rhs.styles_)),
layers_(std::move(rhs.layers_)),
ds_(std::move(rhs.ds_)),
@@ -99,6 +102,7 @@ layer& layer::operator=(layer rhs)
std::swap(this->clear_label_cache_, rhs.clear_label_cache_);
std::swap(this->cache_features_, rhs.cache_features_);
std::swap(this->group_by_, rhs.group_by_);
+ std::swap(this->sort_by_, rhs.sort_by_);
std::swap(this->styles_, rhs.styles_);
std::swap(this->ds_, rhs.ds_);
std::swap(this->buffer_size_, rhs.buffer_size_);
@@ -113,9 +117,10 @@ bool layer::operator==(layer const& rhs) const
return (name_ == rhs.name_) && (srs_ == rhs.srs_) && (minimum_scale_denom_ == rhs.minimum_scale_denom_) &&
(maximum_scale_denom_ == rhs.maximum_scale_denom_) && (active_ == rhs.active_) &&
(queryable_ == rhs.queryable_) && (clear_label_cache_ == rhs.clear_label_cache_) &&
- (cache_features_ == rhs.cache_features_) && (group_by_ == rhs.group_by_) && (styles_ == rhs.styles_) &&
- ((ds_ && rhs.ds_) ? *ds_ == *rhs.ds_ : ds_ == rhs.ds_) && (buffer_size_ == rhs.buffer_size_) &&
- (maximum_extent_ == rhs.maximum_extent_) && (comp_op_ == rhs.comp_op_) && (opacity_ == rhs.opacity_);
+ (cache_features_ == rhs.cache_features_) && (group_by_ == rhs.group_by_) && (sort_by_ == rhs.sort_by_) &&
+ (styles_ == rhs.styles_) && ((ds_ && rhs.ds_) ? *ds_ == *rhs.ds_ : ds_ == rhs.ds_) &&
+ (buffer_size_ == rhs.buffer_size_) && (maximum_extent_ == rhs.maximum_extent_) &&
+ (comp_op_ == rhs.comp_op_) && (opacity_ == rhs.opacity_);
}
layer::~layer() {}
@@ -292,6 +297,16 @@ std::string const& layer::group_by() const
return group_by_;
}
+void layer::set_sort_by(std::string const& column, bool desc)
+{
+ sort_by_ = {column, desc};
+}
+
+std::optional<sort_by_type> const& layer::sort_by() const
+{
+ return sort_by_;
+}
+
void layer::set_comp_op(composite_mode_e comp_op)
{
comp_op_ = comp_op;
=====================================
src/load_map.cpp
=====================================
@@ -49,6 +49,7 @@
#include <mapnik/util/dasharray_parser.hpp>
#include <mapnik/util/conversions.hpp>
#include <mapnik/util/trim.hpp>
+#include <mapnik/util/sort_by.hpp>
#include <mapnik/marker_cache.hpp>
#include <mapnik/util/noncopyable.hpp>
#include <mapnik/util/fs.hpp>
@@ -751,6 +752,25 @@ void map_parser::parse_layer(Parent& parent, xml_node const& node)
lyr.set_group_by(*group_by);
}
+ optional<std::string> str = node.get_opt_attr<std::string>("sort-by");
+ if (str)
+ {
+ mapnik::sort_by_type result;
+ if (!mapnik::parse_sort_by(*str, result))
+ {
+ std::string s_err("failed to parse Layer sort-by clause \"" + *str + "\"");
+ if (strict_)
+ {
+ throw config_error(s_err);
+ }
+ else
+ {
+ MAPNIK_LOG_ERROR(load_map) << "map_parser: " << s_err;
+ }
+ }
+ lyr.set_sort_by(result.first, result.second);
+ }
+
optional<int> buffer_size = node.get_opt_attr<int>("buffer-size");
if (buffer_size)
{
=====================================
src/save_map.cpp
=====================================
@@ -547,6 +547,15 @@ void serialize_layer(ptree& map_node, layer const& lyr, bool explicit_defaults)
set_attr(layer_node, "group-by", lyr.group_by());
}
+ if (lyr.sort_by() || explicit_defaults)
+ {
+ auto sort_by = *lyr.sort_by();
+ std::string str = sort_by.first;
+ if (sort_by.second)
+ str += " DESC";
+ set_attr(layer_node, "sort-by", str);
+ }
+
auto&& buffer_size = lyr.buffer_size();
if (buffer_size || explicit_defaults)
{
View it on GitLab: https://salsa.debian.org/debian-gis-team/mapnik/-/compare/420f310202390fc698cc2ad2456778ad755d4bfe...f5c66c6f6174cfbb680759a5ffb8475b1d8190c2
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/mapnik/-/compare/420f310202390fc698cc2ad2456778ad755d4bfe...f5c66c6f6174cfbb680759a5ffb8475b1d8190c2
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/20251106/3e6e09b5/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list