Fast and flexible C++ library for working with OpenStreetMap data.
BSL-1.0 License
Bot releases are hidden (Show)
posix_fadvise
usage on FreeBSD.GeometryFactory
constructor definition.Published by joto almost 2 years ago
set_thread_name()
on FreeBSD.MembersDatabaseCommon::count_not_removed()
.Published by joto over 2 years ago
system_error
instead of runtime_error
where it fits better.OSMIUM_NORETURN
macro. This hasn't been used in a while.Several parts of libosmium have been marked deprecated, many of them for a very long time. These are now removed:
osmium::index::map::SparseMemTable
as well as the complete file osmium/index/map/sparse_mem_table.hpp
.osmium::memory::Buffer
class. The set_full_callback()
will not be available any more. See the source for replacement options.osmium::builder::build_*
functions in osmium/builder/builder_helper.hpp
. Use osmium::builder::add_*
functions instead. Removes builder_helper.hpp
.osmium::builder::Builder::add_item(const osmium::memory::Item* item)
. Use the function of the same name taking a reference instead.osmium::builder::OSMObject/ChangesetBuilder::add_user()
. Use set_user()
instead.osmium::builder::ChangesetBuilder::bounds()
returning a modifiable reference. Use set_bounds()
instead.osmium::io::OutputIterator
.osmium::Area::inner_ring_cbegin/cend()
, use inner_rings()
instead.osmium::RelationMember::ref()
, use set_ref()
instead.osmium::Timestamp
to std::time_t
. Use seconds_since_epoch()
instead.osmium::string_to_user_id()
, use string_to_uid
instead.osmium::static_cast_with_assert()
helper functions as well as the complete include file osmium/util/cast.hpp
.osmium::util::MemoryMapping
and osmium::util::TypedMemoryMapping
. Use other constructor instead.Published by joto almost 3 years ago
Published by joto almost 3 years ago
std::variant
is available (C++17 and above), libosmium will use that instead of boost::variant
reducing the dependencies a little bit.boost::filter_iterator
and boost::indirect_iterator
. The removes the dependency on Boost Iterator.return
instead of std::exit()
to return an exit code from main
.CheckOrder
handler), the smallest id possible (INTMIN
) wasn't sorted correctly.Several parts of libosmium have been marked deprecated, many of them for a very long time. These will not be part of the next version of libosmium:
osmium::index::map::SparseMemTable
as well as the complete file osmium/index/map/sparse_mem_table.hpp
.osmium::memory::Buffer
class. The set_full_callback()
will not be available any more. See the sourceosmium::builder::build_*
functions in osmium/builder/builder_helper.hpp
. Use osmium::builder::add_*
functions instead. Removes builder_helper.hpp
.osmium::builder::Builder::add_item(const osmium::memory::Item* item)
. Use the function of the same name taking a reference instead.osmium::builder::OSMObject/ChangesetBuilder::add_user()
. Use set_user()
instead.osmium::builder::ChangesetBuilder::bounds()
returning a modifiable reference. Use set_bounds()
instead.osmium::io::OutputIterator
.osmium::Area::inner_ring_cbegin/cend()
, use inner_rings()
instead.osmium::RelationMember::ref()
, use set_ref()
instead.osmium::Timestamp
to std::time_t
. Use seconds_since_epoch()
instead.osmium::string_to_user_id()
, use string_to_uid
instead.osmium::static_cast_with_assert()
helper functions as well as the complete include file osmium/util/cast.hpp
.osmium::util::MemoryMapping
and osmium::util::TypedMemoryMapping
. Use other constructor instead.Published by joto about 3 years ago
osmium_tags_filter
example showing use of tags filter.Writer::set_header()
function to set header after constructing.fadvise
that it can remove pages from the buffer cache that are not needed any more. This is usually beneficial, because the memory can be used for something else. But if you are reading the same OSM file multiple times at the same time or in short succession, it might be better to keep those buffer pages. In that case you can set the environment variable OSMIUM_CLEAN_PAGE_CACHE_AFTER_READ
to no
and Osmium will not call fadvise
. Set it to yes
or anything else (or not set it at all) to get the default behaviour.OSMIUM_DEFINE_EXPORT
is defined, all exception classes used by Osmium will get "tagged as exported" using __declspec(dllexport)
when using MSVC or __attribute__ ((visibility("default")))
on other compilers. This is needed in PyOsmium.Published by joto over 3 years ago
left()
, right()
, top()
, bottom()
to access osmium::Box
boundaries.node_locations_for_ways
handler.osmium::io::buffers_type
for telling the Reader
class whether you want buffers read to only contain a single type of OSM entity.nodes()
, ways()
, and relations()
accessor functions to nwr_array
class.DeltaDecode::value()
accessor function.Buffer::purge_removed()
function which doesn't take a callback parameter.std::fill_n
and std::copy
in object builder for some slight speedups.add_tag_list
on some systems.osmium::util::MemoryMapping::unmap()
in try/catch on Windows also because we call this from a noexcept function.std::forward
s and fixed code that called std::forward
multiple times on the same object.Published by joto almost 4 years ago
pbf_compression
output file format option to lz4
. You have to define OSMIUM_WITH_LZ4
to enable this before including any libosmium includes.osmium::io::supported_pbf_compression_types
can now be used to get a list of all PBF compression types supported.pbf_compression_level
can now be set to an integer. The range depends on the compression type used, 0-9 for zlib compression and 1-65537 for lz4 compression.ptr_begin()
/ptr_end()
functions to ObjectPointerCollection
for accessing the pointers instead of the underlying objects.osmium::io::Writer::close()
function now returns the number of bytes written to an OSM file if it is available (and 0 otherwise).ObjectPointerCollection
.Published by joto over 4 years ago
IdSetSmall::merge_sorted
function.Published by joto over 4 years ago
builder::attr::member_type(_string)
taking char type making it even easier to generate test data.std::string
as argument for builder::attr::_tag
. Must contain key and value separated by the equal sign.builder::attr::_t()
function to set tags from comma-separated string.nwr_array
iterator.Published by joto almost 5 years ago
Published by joto about 5 years ago
, the optional header property
Sort.Type_then_ID` is set on writing to PBF files. When reading PBF files with this header property, the "sorting" header option is set accordingly.Published by joto about 5 years ago
apply
function can now also take lambdas (or objects from classes implementing operator()
).OSMIUM_NORETURN
macro. Use [[noreturn]]
instead.Published by joto over 5 years ago
multimap::dump_as_list()
.MemoryUsage
.Published by joto almost 6 years ago
dump_as_array()
to dump sparse array indexes.xml_josm_upload
header option when reading XML files.OSMObject::remove_tags()
marks tags on OSM objects as removed.TagsFilter
class is now based on the TagsFilterBase
template class which allows setting the result type. This allows the filter to return more data depending on the rule that matched.chunk_bits
in IdSetDense
configurable.%lld
format instead of using <cinttypes>
PRI macro.Published by joto about 6 years ago
Published by joto about 6 years ago
OSMIUM_TEST_CRC_USE_BOOST
before compiling the tests, if you want to run the tests with the boost library code, otherwise it will use the zlib code. Note that to use this you have to change your software slightly, see the documentation of the CRC_zlib
class for details.clear_user()
function to OSMObject and Changeset which allows removing the user name of an entity without re-creating it in a new buffer.to_iso()
function is the empty string. But this is the wrong output for OSM XML files, where a timestamp that's not set should still be output as 1970-01-01T00:00:00Z. This version introduces a new to_is_all()
function which will do this and uses that function in the XML writer.protozero::byteswap_inplace
instead of htonl
/ntohl
. Makes the code simpler and also works on Windows.MultipolygonCollector
class as deprecated. Use the MultipolygonManager
class introduced in 2.13.0 instead.assert
s. Libosmium checks out clean with clang-tidy
now. Some documentation updates.fileno()
is a macro (as in OpenBSD 6.3).Box
output consistent with the output of a single Location
and avoids problems with some locales.Published by joto over 6 years ago
ReaderWithProgressBar
class. This wraps an osmium::io::Reader
and an osmium::ProgressBar
into a nice little package allowing easier use in the common case.osm-testdata
repository. Before this the repository had to be installed externally. Now a submodule update can be used to get the correct version of the osm-testdata repository.strftime
by our own implementation. Uses a specialized implementation for our use case instead the more general strftime
. Benchmarked this to be faster.-1
is now always accepted for all IDs and returned as 0
. This deprecates the string_to_user_id()
function, use string_to_uid()
instead which returns a different type.osmium
namespace and some are in osmium::util
. The osmium::util
namespace is now declared inline
. which allows all util classes and functions to be addressed directly in the osmium
namespace while keeping backwards compatibility.pbf_add_metadata
file format option is used. Use add_metadata
instead.add_metadata
file format option. In addition to allowing the values true
, yes
, false
, and no
, the new values all
and none
are now recognized. The option can also be set to a list of attributes+
sign. Attributes are version
, timestamp
, changeset
, uid
, and user
. All output formats have been updated to only output the specified attributes. This is based on the new osmium::metadata_options
class which stores information about what metadata an OSMObject
has or should have. (Thanks to Michael Reichert.)<
(less than) operator on OSMObject
s now ignores the case when one or both of the timestamps on the objects are not set at all. This allows better handling of OSM data files with reduced metadata.version = -1
and changeset = -1
in PBF input. This value is sometimes used by other programs to denote "no value". Osmium uses the 0
for this.getopt_long
function have been rewritten to work without it. This makes using libosmium on Windows easier, where this function is not available.winsock2
library in Windows by using code from Protozero. (Thanks alex85k.)catch.hpp
to version 1.12.1.clang-tidy
making libosmium more robust.begin()
/end()
of InputIterator<Reader>
.read
and write
system calls for EINTR
.testdata-multipolygon
on Windows was using the wrong executable name.Published by joto about 7 years ago
Pool
to 32. This should still be plenty and might help with test failures on some architectures.core.autocrlf
setting.Item
test on 32 bit platforms.Published by joto about 7 years ago
This is a bugfix-only release for a stable branch.