Skip to content

Commit f031261

Browse files
authored
Merge pull request #1474 from joto/libosmium-2.17
Update the vendored-in libosmium to version 2.17.0
2 parents ac7e1c3 + d78458d commit f031261

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1171
-582
lines changed

contrib/libosmium/README.contrib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Source: https://github.com/osmcode/libosmium
2-
Revision: v2.16.0
2+
Revision: v2.17.0

contrib/libosmium/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ https://osmcode.org/libosmium
44

55
A fast and flexible C++ library for working with OpenStreetMap data.
66

7-
Libosmium works on Linux, Mac OSX and Windows.
7+
Libosmium works on Linux, macOS and Windows.
88

9-
[![Travis Build Status](https://secure.travis-ci.org/osmcode/libosmium.svg)](https://travis-ci.org/osmcode/libosmium)
9+
[![Github Build Status](https://github.com/osmcode/libosmium/workflows/CI/badge.svg?branch=master)](https://github.com/osmcode/libosmium/actions)
1010
[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/yy099a4vxcb604rn/branch/master?svg=true)](https://ci.appveyor.com/project/lonvia/libosmium-eq41p/branch/master)
1111
[![Coverage Status](https://codecov.io/gh/osmcode/libosmium/branch/master/graph/badge.svg)](https://codecov.io/gh/osmcode/libosmium)
1212
[![Packaging status](https://repology.org/badge/tiny-repos/libosmium.svg)](https://repology.org/metapackage/libosmium)

contrib/libosmium/include/osmium/area/detail/basic_assembler.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ namespace osmium {
408408
return std::find(m_split_locations.cbegin(), m_split_locations.cend(), location) != m_split_locations.cend();
409409
}
410410

411-
uint32_t add_new_ring(slocation& node) {
411+
uint32_t add_new_ring(const slocation& node) {
412412
NodeRefSegment* segment = &m_segment_list[node.item];
413413
assert(!segment->is_done());
414414

@@ -466,7 +466,7 @@ namespace osmium {
466466
return nodes;
467467
}
468468

469-
uint32_t add_new_ring_complex(slocation& node) {
469+
uint32_t add_new_ring_complex(const slocation& node) {
470470
NodeRefSegment* segment = &m_segment_list[node.item];
471471
assert(!segment->is_done());
472472

@@ -869,9 +869,9 @@ namespace osmium {
869869

870870
if (debug()) {
871871
std::cerr << " Found candidates:\n";
872-
for (const auto& cand : candidates) {
873-
std::cerr << " sum=" << cand.sum << "\n";
874-
for (const auto& ring : cand.rings) {
872+
for (const auto& c : candidates) {
873+
std::cerr << " sum=" << c.sum << "\n";
874+
for (const auto& ring : c.rings) {
875875
std::cerr << " " << ring.first.ring() << (ring.second ? " reverse" : "") << "\n";
876876
}
877877
}

contrib/libosmium/include/osmium/area/multipolygon_collector.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ namespace osmium {
172172
}
173173
}
174174

175-
void complete_relation(osmium::relations::RelationMeta& relation_meta) {
175+
void complete_relation(const osmium::relations::RelationMeta& relation_meta) {
176176
const osmium::Relation& relation = this->get_relation(relation_meta);
177177
const osmium::memory::Buffer& buffer = this->members_buffer();
178178

contrib/libosmium/include/osmium/builder/osm_object_builder.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ namespace osmium {
411411
Builder(buffer, parent, sizeof(T) + min_size_for_user) {
412412
new (&item()) T{};
413413
add_size(min_size_for_user);
414-
std::fill_n(object().data() + sizeof(T), min_size_for_user, 0);
414+
std::memset(object().data() + sizeof(T), 0, min_size_for_user);
415415
object().set_user_size(1);
416416
}
417417

@@ -447,13 +447,13 @@ namespace osmium {
447447
const auto size_of_object = sizeof(T) + sizeof(string_size_type);
448448
assert(cobject().user_size() == 1 && (size() <= size_of_object + osmium::memory::padded_length(1))
449449
&& "set_user() must be called at most once and before any sub-builders");
450-
const auto available_space = min_size_for_user - sizeof(string_size_type) - 1;
450+
constexpr const auto available_space = min_size_for_user - sizeof(string_size_type) - 1;
451451
if (length > available_space) {
452452
const auto space_needed = osmium::memory::padded_length(length - available_space);
453-
std::fill_n(reserve_space(space_needed), space_needed, 0);
453+
std::memset(reserve_space(space_needed), 0, space_needed);
454454
add_size(static_cast<uint32_t>(space_needed));
455455
}
456-
std::copy_n(user, length, object().data() + size_of_object);
456+
std::memcpy(object().data() + size_of_object, user, length);
457457
object().set_user_size(length + 1);
458458

459459
return static_cast<TDerived&>(*this);
@@ -608,7 +608,7 @@ namespace osmium {
608608
Builder(buffer, parent, sizeof(Changeset) + min_size_for_user) {
609609
new (&item()) Changeset{};
610610
add_size(min_size_for_user);
611-
std::fill_n(object().data() + sizeof(Changeset), min_size_for_user, 0);
611+
std::memset(object().data() + sizeof(Changeset), 0, min_size_for_user);
612612
object().set_user_size(1);
613613
}
614614

@@ -663,13 +663,13 @@ namespace osmium {
663663
ChangesetBuilder& set_user(const char* user, const string_size_type length) {
664664
assert(cobject().user_size() == 1 && (size() <= sizeof(Changeset) + osmium::memory::padded_length(1))
665665
&& "set_user() must be called at most once and before any sub-builders");
666-
const auto available_space = min_size_for_user - 1;
666+
constexpr const auto available_space = min_size_for_user - 1;
667667
if (length > available_space) {
668668
const auto space_needed = osmium::memory::padded_length(length - available_space);
669-
std::fill_n(reserve_space(space_needed), space_needed, 0);
669+
std::memset(reserve_space(space_needed), 0, space_needed);
670670
add_size(static_cast<uint32_t>(space_needed));
671671
}
672-
std::copy_n(user, length, object().data() + sizeof(Changeset));
672+
std::memcpy(object().data() + sizeof(Changeset), user, length);
673673
object().set_user_size(length + 1);
674674

675675
return *this;

contrib/libosmium/include/osmium/geom/coordinates.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ namespace osmium {
7474
* This constructor is not explicit on purpose allowing use of
7575
* a Location everywhere a Coordinates object is needed.
7676
*/
77+
// cppcheck-suppress noExplicitConstructor
7778
Coordinates(const osmium::Location& location) : // NOLINT(google-explicit-constructor, hicpp-explicit-conversions)
7879
x(location.lon()),
7980
y(location.lat()) {

contrib/libosmium/include/osmium/geom/projection.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ namespace osmium {
122122
*
123123
* @deprecated Only supports the old PROJ API.
124124
*/
125-
// cppcheck-suppress passedByValue (because c is small and we want to change it)
126125
inline OSMIUM_DEPRECATED Coordinates transform(const CRS& src, const CRS& dest, Coordinates c) {
127126
const int result = pj_transform(src.get(), dest.get(), 1, 1, &c.x, &c.y, nullptr);
128127
if (result != 0) {

contrib/libosmium/include/osmium/geom/wkb.hpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,34 @@ namespace osmium {
201201
return data;
202202
}
203203

204+
/* Polygon */
205+
206+
void polygon_start() {
207+
m_data.clear();
208+
set_size(header(m_data, wkbPolygon, true), 1);
209+
m_ring_size_offset = m_data.size();
210+
str_push(m_data, static_cast<uint32_t>(0));
211+
}
212+
213+
void polygon_add_location(const osmium::geom::Coordinates& xy) {
214+
str_push(m_data, xy.x);
215+
str_push(m_data, xy.y);
216+
}
217+
218+
polygon_type polygon_finish(std::size_t num_points) {
219+
set_size(m_ring_size_offset, num_points);
220+
std::string data;
221+
222+
using std::swap;
223+
swap(data, m_data);
224+
225+
if (m_out_type == out_type::hex) {
226+
return convert_to_hex(data);
227+
}
228+
229+
return data;
230+
}
231+
204232
/* MultiPolygon */
205233

206234
void multipolygon_start() {

contrib/libosmium/include/osmium/handler/node_locations_for_ways.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ namespace osmium {
115115
m_ignore_errors = true;
116116
}
117117

118+
TStoragePosIDs& storage_pos() noexcept {
119+
return m_storage_pos;
120+
}
121+
122+
TStorageNegIDs& storage_neg() noexcept {
123+
return m_storage_neg;
124+
}
125+
118126
/**
119127
* Store the location of the node in the storage.
120128
*/

contrib/libosmium/include/osmium/index/detail/vector_multimap.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ namespace osmium {
6161

6262
vector_type m_vector;
6363

64-
static bool is_removed(element_type& element) {
64+
static bool is_removed(const element_type& element) {
6565
return element.second == osmium::index::empty_value<TValue>();
6666
}
6767

0 commit comments

Comments
 (0)