Skip to content

Commit 7183a20

Browse files
authored
Merge pull request #2102 from joto/update-libosmium
Update included libosmium to version 2.20.0
2 parents 7a73d05 + 2f0df8d commit 7183a20

31 files changed

+160
-566
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.19.0
2+
Revision: v2.20.0

contrib/libosmium/README.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ A fast and flexible C++ library for working with OpenStreetMap data.
77
Libosmium works on Linux, macOS and Windows.
88

99
[![Github Build Status](https://github.com/osmcode/libosmium/workflows/CI/badge.svg?branch=master)](https://github.com/osmcode/libosmium/actions)
10-
[![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)
11-
[![Coverage Status](https://codecov.io/gh/osmcode/libosmium/branch/master/graph/badge.svg)](https://codecov.io/gh/osmcode/libosmium)
1210
[![Packaging status](https://repology.org/badge/tiny-repos/libosmium.svg)](https://repology.org/metapackage/libosmium)
1311

1412
Please see the [Libosmium manual](https://osmcode.org/libosmium/manual.html)
@@ -17,9 +15,8 @@ for more details than this README can provide.
1715

1816
## Prerequisites
1917

20-
Because Libosmium uses many C++11 features you need a modern compiler and
21-
standard C++ library. Osmium needs at least GCC 4.8 or clang (LLVM) 3.4.
22-
(Some parts may work with older versions.)
18+
You need a C++11 compiler and standard C++ library. Osmium needs at least GCC
19+
4.8 or clang (LLVM) 3.4. (Some parts may work with older versions.)
2320

2421
Different parts of Libosmium (and the applications built on top of it) need
2522
different libraries. You DO NOT NEED to install all of them, just install those
@@ -88,16 +85,9 @@ See the
8885
for instructions.
8986

9087

91-
## Switching from the old Osmium
92-
93-
If you have been using the old version of Osmium at
94-
https://github.com/joto/osmium you might want to read about the [changes
95-
needed](https://osmcode.org/libosmium/manual.html#changes-from-old-versions-of-osmium).
96-
97-
9888
## License
9989

100-
Libosmium is available under the Boost Software License. See LICENSE.txt.
90+
Libosmium is available under the Boost Software License. See LICENSE.
10191

10292

10393
## Authors

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ namespace osmium {
193193

194194
const char* role_name() const noexcept {
195195
static const std::array<const char*, 4> names = {{"unknown", "outer", "inner", "empty"}};
196-
return names[int(m_role)];
196+
return names[static_cast<int>(m_role)];
197197
}
198198

199199
const osmium::Way* way() const noexcept {
@@ -327,9 +327,9 @@ namespace osmium {
327327

328328
if ((d > 0 && na >= 0 && na <= d && nb >= 0 && nb <= d) ||
329329
(d < 0 && na <= 0 && na >= d && nb <= 0 && nb >= d)) {
330-
const double ua = double(na) / double(d);
330+
const double ua = static_cast<double>(na) / static_cast<double>(d);
331331
const vec i = p0 + ua * (p1 - p0);
332-
return osmium::Location{int32_t(i.x), int32_t(i.y)};
332+
return osmium::Location{static_cast<int32_t>(i.x), static_cast<int32_t>(i.y)};
333333
}
334334

335335
return osmium::Location{};

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@ namespace osmium {
8686
int64_t m_num;
8787
#endif
8888

89-
int64_t m_sum;
89+
int64_t m_sum = 0;
9090

9191
public:
9292

9393
explicit ProtoRing(NodeRefSegment* segment) noexcept :
94-
m_min_segment(segment),
94+
m_min_segment(segment)
9595
#ifdef OSMIUM_DEBUG_RING_NO
96-
m_num(next_num()),
96+
, m_num(next_num())
9797
#endif
98-
m_sum(0) {
98+
{
9999
add_segment_back(segment);
100100
}
101101

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ namespace osmium {
8989

9090
// scale vector
9191
constexpr inline vec operator*(double s, const vec& v) noexcept {
92-
return vec{int64_t(s * double(v.x)), int64_t(s * double(v.y))};
92+
return vec{static_cast<int64_t>(s * static_cast<double>(v.x)), static_cast<int64_t>(s * static_cast<double>(v.y))};
9393
}
9494

9595
// scale vector
9696
constexpr inline vec operator*(const vec& v, double s) noexcept {
97-
return vec{int64_t(s * double(v.x)), int64_t(s * double(v.y))};
97+
return vec{static_cast<int64_t>(s * static_cast<double>(v.x)), static_cast<int64_t>(s * static_cast<double>(v.y))};
9898
}
9999

100100
// equality

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ namespace osmium {
7575
void set_object(gdalcpp::Feature& feature) {
7676
const char t[2] = {osmium::item_type_to_char(m_object_type), '\0'};
7777
feature.set_field("obj_type", t);
78-
feature.set_field("obj_id", int32_t(m_object_id));
79-
feature.set_field("nodes", int32_t(m_nodes));
78+
feature.set_field("obj_id", static_cast<int32_t>(m_object_id));
79+
feature.set_field("nodes", static_cast<int32_t>(m_nodes));
8080
}
8181

8282
void write_point(const char* problem_type, osmium::object_id_type id1, osmium::object_id_type id2, osmium::Location location) {
8383
gdalcpp::Feature feature{m_layer_perror, m_ogr_factory.create_point(location)};
8484
set_object(feature);
85-
feature.set_field("id1", double(id1));
86-
feature.set_field("id2", double(id2));
85+
feature.set_field("id1", static_cast<double>(id1));
86+
feature.set_field("id2", static_cast<double>(id2));
8787
feature.set_field("problem", problem_type);
8888
feature.add_to_layer();
8989
}
@@ -176,7 +176,7 @@ namespace osmium {
176176
try {
177177
gdalcpp::Feature feature{m_layer_lerror, m_ogr_factory.create_linestring(way)};
178178
set_object(feature);
179-
feature.set_field("id1", int32_t(way.id()));
179+
feature.set_field("id1", static_cast<int32_t>(way.id()));
180180
feature.set_field("id2", 0);
181181
feature.set_field("problem", "way_in_multiple_rings");
182182
feature.add_to_layer();
@@ -192,7 +192,7 @@ namespace osmium {
192192
try {
193193
gdalcpp::Feature feature{m_layer_lerror, m_ogr_factory.create_linestring(way)};
194194
set_object(feature);
195-
feature.set_field("id1", int32_t(way.id()));
195+
feature.set_field("id1", static_cast<int32_t>(way.id()));
196196
feature.set_field("id2", 0);
197197
feature.set_field("problem", "inner_with_same_tags");
198198
feature.add_to_layer();
@@ -208,7 +208,7 @@ namespace osmium {
208208
try {
209209
gdalcpp::Feature feature{m_layer_lerror, m_ogr_factory.create_linestring(way)};
210210
set_object(feature);
211-
feature.set_field("id1", int32_t(way.id()));
211+
feature.set_field("id1", static_cast<int32_t>(way.id()));
212212
feature.set_field("id2", 0);
213213
feature.set_field("problem", "duplicate_way");
214214
feature.add_to_layer();
@@ -229,7 +229,7 @@ namespace osmium {
229229
try {
230230
gdalcpp::Feature feature{m_layer_ways, m_ogr_factory.create_linestring(way)};
231231
set_object(feature);
232-
feature.set_field("way_id", int32_t(way.id()));
232+
feature.set_field("way_id", static_cast<int32_t>(way.id()));
233233
feature.add_to_layer();
234234
} catch (const osmium::geometry_error&) {
235235
// XXX

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

Lines changed: 0 additions & 120 deletions
This file was deleted.

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ namespace osmium {
125125
if (value_length > osmium::max_osm_string_length) {
126126
throw std::length_error{"OSM tag value is too long"};
127127
}
128-
add_size(append_with_zero(key, osmium::memory::item_size_type(key_length)));
129-
add_size(append_with_zero(value, osmium::memory::item_size_type(value_length)));
128+
add_size(append_with_zero(key, static_cast<osmium::memory::item_size_type>(key_length)));
129+
add_size(append_with_zero(value, static_cast<osmium::memory::item_size_type>(value_length)));
130130
}
131131

132132
/**
@@ -142,8 +142,8 @@ namespace osmium {
142142
if (value.size() > osmium::max_osm_string_length) {
143143
throw std::length_error{"OSM tag value is too long"};
144144
}
145-
add_size(append(key.data(), osmium::memory::item_size_type(key.size()) + 1));
146-
add_size(append(value.data(), osmium::memory::item_size_type(value.size()) + 1));
145+
add_size(append(key.data(), static_cast<osmium::memory::item_size_type>(key.size()) + 1));
146+
add_size(append(value.data(), static_cast<osmium::memory::item_size_type>(value.size()) + 1));
147147
}
148148

149149
/**
@@ -240,8 +240,8 @@ namespace osmium {
240240
if (length > osmium::max_osm_string_length) {
241241
throw std::length_error{"OSM relation member role is too long"};
242242
}
243-
member.set_role_size(osmium::string_size_type(length) + 1);
244-
add_size(append_with_zero(role, osmium::memory::item_size_type(length)));
243+
member.set_role_size(static_cast<osmium::string_size_type>(length) + 1);
244+
add_size(append_with_zero(role, static_cast<osmium::memory::item_size_type>(length)));
245245
add_padding(true);
246246
}
247247

@@ -330,16 +330,16 @@ namespace osmium {
330330
if (length > osmium::max_osm_string_length) {
331331
throw std::length_error{"OSM user name is too long"};
332332
}
333-
comment.set_user_size(osmium::string_size_type(length) + 1);
334-
add_size(append_with_zero(user, osmium::memory::item_size_type(length)));
333+
comment.set_user_size(static_cast<osmium::string_size_type>(length) + 1);
334+
add_size(append_with_zero(user, static_cast<osmium::memory::item_size_type>(length)));
335335
}
336336

337337
void add_text(osmium::ChangesetComment& comment, const char* text, const std::size_t length) {
338338
if (length > std::numeric_limits<osmium::changeset_comment_size_type>::max() - 1) {
339339
throw std::length_error{"OSM changeset comment is too long"};
340340
}
341-
comment.set_text_size(osmium::changeset_comment_size_type(length) + 1);
342-
add_size(append_with_zero(text, osmium::memory::item_size_type(length)));
341+
comment.set_text_size(static_cast<osmium::changeset_comment_size_type>(length) + 1);
342+
add_size(append_with_zero(text, static_cast<osmium::memory::item_size_type>(length)));
343343
add_padding(true);
344344
}
345345

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ namespace osmium {
166166

167167
public:
168168

169-
GeometryFactory<TGeomImpl, TProjection>() :
169+
GeometryFactory() :
170170
m_projection(),
171171
m_impl(m_projection.epsg()) {
172172
}
@@ -175,7 +175,7 @@ namespace osmium {
175175
* Constructor for default initialized projection.
176176
*/
177177
template <typename... TArgs>
178-
explicit GeometryFactory<TGeomImpl, TProjection>(TArgs&&... args) :
178+
explicit GeometryFactory(TArgs&&... args) :
179179
m_projection(),
180180
m_impl(m_projection.epsg(), std::forward<TArgs>(args)...) {
181181
}
@@ -185,7 +185,7 @@ namespace osmium {
185185
* projection is moved into the GeometryFactory.
186186
*/
187187
template <typename... TArgs>
188-
explicit GeometryFactory<TGeomImpl, TProjection>(TProjection&& projection, TArgs&&... args) :
188+
explicit GeometryFactory(TProjection&& projection, TArgs&&... args) :
189189
m_projection(std::move(projection)),
190190
m_impl(m_projection.epsg(), std::forward<TArgs>(args)...) {
191191
}

0 commit comments

Comments
 (0)