Skip to content

Releases: osmcode/pyosmium

Version 4.0.2

20 Oct 08:03
Compare
Choose a tag to compare

Fixed

  • set proper default 'osc.gz' for prefixes on replication servers

Added

  • add documentation for writing custom objects and replication module

Version 4.0.1

27 Sep 17:52
Compare
Choose a tag to compare

Fixed

  • correctly package py.typed file
  • typing: correctly report inheritance of SimpleWriter and NodeLocationsForWays

Version 4.0.0

20 Sep 12:22
Compare
Choose a tag to compare

This release introduces iterative processing of OSM files. It also adds filtering of irrelevant data to speed up processing, so that pyosmium may now be used even with planet-sized files. Have a look at the completely overhauled user manual to learn about the new features.

Added

  • support for Python 3.13
  • iterative processing of OSM files (see FileProcessor)
  • new flush() callback for handlers
  • FileBuffer for reading from a Python buffer instead of a file
  • bit operators for entity bit enum
  • filter mode for handlers (return False to stop processing)
  • various C++-implementations of filters (for tags, keys, ids, etc.)
  • convenience functions to determine object types
  • binary wheels for MAcOS and Intel ARM architecture
  • haversine functions for two point
  • direct access to lat/lon for nodes
  • expose osmium's IdSet
  • new IdTracker for efficient tracking of dependent objects
  • new writers for adding forward and backward references to output
  • new parameter for server file type for pyosmium_get_updates
  • new filter to add __geo_interface__ attribute

Fixed

  • consistently use namespaces everywhere
  • deprecation warnings around utc_now (thanks @mtmail)

Changed

  • SimpleHandler is now a Python class
  • make NodeLocationForWays a generic BaseHandler
  • apply() and MergeInputReader can take an arbitrary number of handlers
  • accept Python class as handler, no inheritance from SimpleHandler necessary
  • new minimum requirements: pybind 2.7, Python 3.7, C++17 compatible compiler, cmake 3.8
  • AreaManager is now part of the Python interface
  • consistently allow str, Path, File and FileBuffer, where OSM files are expected
  • objects stay alive through handler chain allowing to carry over extra attributes
  • switch SimpleWriter to use keyword arguments
  • make Reader and SimpleWriter context managers
  • new overwrite parameter for writers
  • remove GIL release, only slows down processing
  • move documentation of C++ interface into pyi files
  • complete rewrite of documentation using mkdocs
  • update pybind to 2.13.6
  • use maximum parallelization when building (thanks @Mathiasdm)
  • move build configuration to pyproject.toml as far as possible

Version 3.7.0

19 Nov 11:06
Compare
Choose a tag to compare

Added

  • transparently retry download on transient HTTP errors

Fixed

  • catch non-200 status for HTTP responses

Changed

  • switch unit tests for replication to use pytest-httpserver
  • update to pybind 2.11.1
  • update to libosmium 2.20.0

This is the last version to support overwriting ReplicationServer.open_url(). Use new ReplicationServer.set_request_parameter() function instead.

Version 3.6.0

21 Jan 09:28
Compare
Choose a tag to compare

This release brings a major rewrite of the libosmium wrapper code. Access to libosmium objects and functions now goes through thin proxy objects which make sure that the underlying data buffers are still accessible. This replaces the check for reference counters which has caused a lot of cryptic errors. Users are still not allowed to keep references to data received in the handler callbacks. However, this will only be checked when data is accessed. Just keeping a reference around will not raise exceptions anymore. str() and repr() are guaranteed to never throw, even when the reference is invalid. That should make it easier to debug your code. These changes are all internal. The user-facing library interface and behaviour hasn't changed. Your code should just work with this new version.

Added

  • new example for creating geojson from a OSM file

Changed

  • complete internal rewrite of the bindings for OSM data types
  • invalid buffers are now checked on access time, no more reference count checks on leaving the handler callback
  • update to pybind 2.10.3
  • update to libosmium 2.19.0
  • change minimum required version of Cmake to 3.0

Version 3.5.0

09 Nov 13:54
Compare
Choose a tag to compare

Added

  • type annotations for the public interface
  • new ReplicationServer.set_request_parameter() function to specify additional parameters to give to requests.get()

Fixed

  • writer now rolls back data buffer after exceptions (fixes #212)
  • off-by-one error in computation of change ID from a start date
  • socket timeout in pyosmium-get-changes/pyosmium-up-to-date was ignored falling back to waiting forever on requests

Changed

  • use format strings instead of format() where possible
  • pyosmium-get-changes now prints an error message when there is a HTTP error
    during download
  • overwriting ReplicationServer.open_url() is no longer recommended, use new ReplicationServer.set_request_parameter() function instead
  • cookies for pyosmium-get-changes/pyosmium-up-to-date are now set via request parameters, removing the last use-case where urllib was used
  • update bundled pybind11 to 2.10.1

Version 3.4.1

28 Jul 07:35
Compare
Choose a tag to compare

Fixed

  • allow building docs from built sources in PYTHONPATH again

Version 3.4.0

27 Jul 21:22
Compare
Choose a tag to compare

Fixed

  • finding the build directory when newer versions of setuptools are used

Changed

  • improve error message when writing to a writer that is already closed
  • update to pybind 2.10.0
  • drop support for Python 3.5

Version 3.3.0

22 Mar 20:11
Compare
Choose a tag to compare

With this release the recommended way of using ReplicationServer changes: use it now as a context manager with the with statement:

with rserv.ReplicationServer('https://planet.osm.org/replication/hour/', 'osc.gz') as svr:
    print(svr.get_state_info())

The old way of simply calling the constructor still works but it won't make use of requests.Sessions. Downloads will be a bit slower.

This is the last version to support Python 3.5.

Added

  • add_box() for osmium.osm.Header for setting the bbox in a OSM file
  • SimpleWriter now can receive a customized header in its constructor
  • SimpleWriter now accepts a list of RelationMember in then member parameter
    of add_relation()
  • more tests for replication server and osm base types

Fixed

  • AttributeError when using pyosmium-get-changes with cookies (thanks @wiktorn)
  • avoid memory leak in apply_buffer() functions in
    SimpleHandler and MergeInputReader
  • maek sure close() is called for requests.Session and requests.Response
  • documentation for open_url() now reflects its new behaviour
  • build issue with raw ssize_t on Windows since Python 3.10

Changed

  • ReplicationServer is now a context manager
  • allow any string-like object for apply_file()
  • switch tests from nose to pytest
  • use Python libraries instead of wget for downloading contrib packages
  • update to libosmium 2.18.0 (requires now C++14)
  • update to pybind11 2.9.1

Release 3.2.0

10 Aug 09:38
Compare
Choose a tag to compare

Please note that this release adds a dependency to the requests library.

Fixed

  • merge change files correctly so that latest applied object comes first

Changed

  • switch to requests library for downloading files (thanks @jocelynj)
  • update to libosmium 2.17.0
  • update to pybind11 2.7.1