[pyosmium] 01/04: New upstream version 2.11.3
Bas Couwenberg
sebastic at debian.org
Sat Aug 26 15:40:15 UTC 2017
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch stretch
in repository pyosmium.
commit 1e45b0eea2f08c88a05884cd64e0b2ad939db29d
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Sat Aug 26 15:07:40 2017 +0200
New upstream version 2.11.3
---
CHANGELOG.md | 21 +++++++++++++++++++++
lib/generic_handler.hpp | 23 +++++++++++++++--------
lib/merged_input.hpp | 1 +
lib/osmium.cc | 6 ++++++
osmium/version.py | 4 ++--
5 files changed, 45 insertions(+), 10 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0a3fffe..a8f58c7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,27 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
+## [2.11.3] - 2017-08-20
+
+### Added
+
+### Changed
+
+- updated to latest libosmium 2.11 bugfix release
+
+### Fixed
+
+- handler functions not called when using Reader instead of file
+
+## [2.11.2] - 2017-05-25
+
+### Added
+
+### Changed
+
+### Fixed
+
+- handler functions not called when using replication service (#38)
## [2.11.1] - 2017-05-04
diff --git a/lib/generic_handler.hpp b/lib/generic_handler.hpp
index 778d87f..60390fe 100644
--- a/lib/generic_handler.hpp
+++ b/lib/generic_handler.hpp
@@ -25,6 +25,7 @@ protected:
};
public:
+virtual void apply_start() {};
// handler functions
virtual void node(const osmium::Node&) const = 0;
virtual void way(const osmium::Way&) const = 0;
@@ -163,14 +164,7 @@ struct SimpleHandlerWrap: BaseHandler, wrapper<BaseHandler> {
apply_object(osmium::io::File(cbuf, len, cfmt), locations, idx);
}
-private:
- void apply_object(osmium::io::File file, bool locations, const std::string &idx)
- {
- osmium::osm_entity_bits::type entities = osmium::osm_entity_bits::nothing;
- BaseHandler::pre_handler handler = locations?
- BaseHandler::location_handler
- :BaseHandler::no_handler;
-
+ void apply_start() override {
m_callbacks = osmium::osm_entity_bits::nothing;
if (hasfunc("node"))
m_callbacks |= osmium::osm_entity_bits::node;
@@ -182,6 +176,18 @@ private:
m_callbacks |= osmium::osm_entity_bits::area;
if (hasfunc("changeset"))
m_callbacks |= osmium::osm_entity_bits::changeset;
+ }
+
+
+private:
+ void apply_object(osmium::io::File file, bool locations, const std::string &idx)
+ {
+ osmium::osm_entity_bits::type entities = osmium::osm_entity_bits::nothing;
+ BaseHandler::pre_handler handler = locations?
+ BaseHandler::location_handler
+ :BaseHandler::no_handler;
+
+ apply_start();
if (m_callbacks & osmium::osm_entity_bits::area)
{
@@ -202,6 +208,7 @@ private:
apply(file, entities, handler, idx);
}
+
bool hasfunc(char const *name) {
reference_existing_object::apply<SimpleHandlerWrap*>::type converter;
PyObject* obj = converter( this );
diff --git a/lib/merged_input.hpp b/lib/merged_input.hpp
index cffd70d..56da7e2 100644
--- a/lib/merged_input.hpp
+++ b/lib/merged_input.hpp
@@ -16,6 +16,7 @@ namespace pyosmium {
class MergeInputReader {
public:
void apply(BaseHandler& handler, bool simplify = true) {
+ handler.apply_start();
if (simplify) {
objects.sort(osmium::object_order_type_id_reverse_version());
osmium::item_type prev_type = osmium::item_type::undefined;
diff --git a/lib/osmium.cc b/lib/osmium.cc
index c598424..1f134bb 100644
--- a/lib/osmium.cc
+++ b/lib/osmium.cc
@@ -13,11 +13,17 @@ void apply_reader_simple(osmium::io::Reader &rd, T &h) {
osmium::apply(rd, h);
}
+template <>
+void apply_reader_simple(osmium::io::Reader &rd, BaseHandler &h) {
+ h.apply_start();
+ osmium::apply(rd, h);
+}
template <typename T>
void apply_reader_simple_with_location(osmium::io::Reader &rd,
osmium::handler::NodeLocationsForWays<T> &l,
BaseHandler &h) {
+ h.apply_start();
osmium::apply(rd, l, h);
}
diff --git a/osmium/version.py b/osmium/version.py
index 7644885..b1fa13a 100644
--- a/osmium/version.py
+++ b/osmium/version.py
@@ -5,7 +5,7 @@ Version information.
# the major version
pyosmium_major = '2.11'
# current release (Pip version)
-pyosmium_release = '2.11.1'
+pyosmium_release = '2.11.3'
# libosmium version shipped with the Pip release
-libosmium_version = '2.11.3'
+libosmium_version = '2.11.4'
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pyosmium.git
More information about the Pkg-grass-devel
mailing list