[Git][debian-gis-team/osmium-tool][master] 7 commits: Ignore test failures on riscv64.
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Tue Mar 18 04:41:13 GMT 2025
Bas Couwenberg pushed to branch master at Debian GIS Project / osmium-tool
Commits:
76e2826f by Bas Couwenberg at 2025-01-18T19:52:34+01:00
Ignore test failures on riscv64.
- - - - -
d857d064 by Bas Couwenberg at 2025-01-21T11:44:19+01:00
Revert "Ignore test failures on riscv64."
This reverts commit 76e2826f70b4b8a074cb76b799ac40fd18ac0020.
- - - - -
56a64b84 by Bas Couwenberg at 2025-03-18T05:26:05+01:00
New upstream version 1.18.0
- - - - -
01721115 by Bas Couwenberg at 2025-03-18T05:26:06+01:00
Update upstream source from tag 'upstream/1.18.0'
Update to upstream version '1.18.0'
with Debian dir ddaa0be0f9d3488389ebcfdc26994a5efbe8a1a4
- - - - -
f05419b4 by Bas Couwenberg at 2025-03-18T05:26:18+01:00
New upstream release.
- - - - -
a197147e by Bas Couwenberg at 2025-03-18T05:36:28+01:00
Bump minimum required libosmium2-dev to 2.22.0 for extract*64 tests.
- - - - -
9988a79f by Bas Couwenberg at 2025-03-18T05:36:28+01:00
Set distribution to unstable.
- - - - -
26 changed files:
- CHANGELOG.md
- CMakeLists.txt
- debian/changelog
- debian/control
- man/osmium-time-filter.md
- src/command_time_filter.cpp
- src/export/export_format_json.cpp
- src/extract/geojson_file_parser.cpp
- src/extract/geojson_file_parser.hpp
- test/export/CMakeLists.txt
- + test/export/input-chars.osm
- + test/export/input-mp.osm
- + test/export/output-attr.geojson
- + test/export/output-chars.geojson
- + test/export/output-cnt.geojsonseq
- + test/export/output-mp.geojson
- + test/export/output-uid.geojsonseq
- test/extract/CMakeLists.txt
- + test/extract/input64.osm
- + test/extract/output-clean64.osm
- + test/extract/output-complete-ways-norels64.osm
- + test/extract/output-complete-ways64.osm
- + test/extract/output-simple64.osm
- + test/extract/output-smart-nonmp64.osm
- + test/extract/output-smart64.osm
- + test/extract/polygon-us-alaska-no-feature.geojson
Changes:
=====================================
CHANGELOG.md
=====================================
@@ -13,6 +13,22 @@ This project adheres to [Semantic Versioning](https://semver.org/).
### Fixed
+## [1.18.0] - 2025-03-17
+
+### Changed
+
+- If the newest libosmium is used, the `extract` command will now work with
+ relation ids that do not fit into 32bit.
+- Set header timestamp in `time-filter` output file in some situations.
+- Allow GeoJSON extract boundary with only geometry in `extract` command
+ instead of a complete feature in the GeoJSON.
+
+### Fixed
+
+- Fixed various issues introduced in 1.17.0 when using the `export` command
+ to create GeoJSON files.
+
+
## [1.17.0] - 2025-01-14
### Added
@@ -737,7 +753,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
- Minor updates to documentation and build system
-[unreleased]: https://github.com/osmcode/osmium-tool/compare/v1.17.0...HEAD
+[unreleased]: https://github.com/osmcode/osmium-tool/compare/v1.18.0...HEAD
+[1.18.0]: https://github.com/osmcode/osmium-tool/compare/v1.17.0...v1.18.0
[1.17.0]: https://github.com/osmcode/osmium-tool/compare/v1.16.0...v1.17.0
[1.16.0]: https://github.com/osmcode/osmium-tool/compare/v1.15.0...v1.16.0
[1.15.0]: https://github.com/osmcode/osmium-tool/compare/v1.14.0...v1.15.0
=====================================
CMakeLists.txt
=====================================
@@ -8,7 +8,7 @@
cmake_minimum_required(VERSION 3.10)
-project(osmium VERSION 1.17.0 LANGUAGES CXX C)
+project(osmium VERSION 1.18.0 LANGUAGES CXX C)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+osmium-tool (1.18.0-1) unstable; urgency=medium
+
+ * New upstream release.
+ * Bump minimum required libosmium2-dev to 2.22.0 for extract*64 tests.
+
+ -- Bas Couwenberg <sebastic at debian.org> Tue, 18 Mar 2025 05:27:24 +0100
+
osmium-tool (1.17.0-1) unstable; urgency=medium
* New upstream release.
=====================================
debian/control
=====================================
@@ -10,7 +10,7 @@ Build-Depends: architecture-is-little-endian,
libboost-program-options-dev,
libbz2-dev,
libexpat1-dev,
- libosmium2-dev (>= 2.20.0),
+ libosmium2-dev (>= 2.22.0),
nlohmann-json3-dev,
pandoc,
zlib1g-dev
=====================================
man/osmium-time-filter.md
=====================================
@@ -29,6 +29,10 @@ This commands reads its input file only once and writes its output file
in one go so it can be streamed, ie. it can read from STDIN and write to
STDOUT.
+If the input file has a timestamp set in the header and the specified *TO-TIME*
+is before that timestamp in the header, the header of the output file will have
+the timestamp set to the *TO-TIME* (or *TO-TIME* minus one second if a
+*FROM-TIME* was also set).
@MAN_COMMON_OPTIONS@
@MAN_PROGRESS_OPTIONS@
=====================================
src/command_time_filter.cpp
=====================================
@@ -134,6 +134,19 @@ bool CommandTimeFilter::run() {
m_vout << "Opening output file...\n";
osmium::io::Header header{reader.header()};
+ try {
+ osmium::Timestamp const input_timestamp{header.get("osmosis_replication_timestamp")};
+ if (input_timestamp.valid() && input_timestamp >= m_to) {
+ auto ts = m_to;
+ if (m_from != m_to) {
+ ts -= 1;
+ }
+ m_vout << "Set output timestamp to " << ts.to_iso() << "\n";
+ header.set("osmosis_replication_timestamp", ts.to_iso());
+ }
+ } catch (const std::invalid_argument&) { // NOLINT(bugprone-empty-catch)
+ // Ignore unset or invalid timestamp from input file
+ }
setup_header(header);
osmium::io::Writer writer{m_output_file, header, m_output_overwrite, m_fsync};
=====================================
src/export/export_format_json.cpp
=====================================
@@ -87,15 +87,15 @@ void ExportFormatJSON::start_feature(const std::string& prefix, osmium::object_i
m_buffer += R"(,"id":)";
m_buffer += std::to_string(m_count + 1);
} else if (options().unique_id == unique_id_type::type_id) {
- m_buffer += R"(,"id":)";
+ m_buffer += R"(,"id":")";
m_buffer += prefix;
m_buffer += std::to_string(id);
+ m_buffer += '"';
}
}
void ExportFormatJSON::add_option(const std::string& name) {
const nlohmann::json j = name;
- m_buffer += ',';
m_buffer += j.dump();
m_buffer += ':';
}
@@ -104,38 +104,47 @@ void ExportFormatJSON::add_attributes(const osmium::OSMObject& object) {
if (!options().type.empty()) {
add_option(options().type);
+ m_buffer += '"';
m_buffer += object_type_as_string(object);
+ m_buffer += '"';
+ m_buffer += ',';
}
if (!options().id.empty()) {
add_option(options().id);
m_buffer += std::to_string(object.type() == osmium::item_type::area ? osmium::area_id_to_object_id(object.id()) : object.id());
+ m_buffer += ',';
}
if (!options().version.empty()) {
add_option(options().version);
m_buffer += std::to_string(object.version());
+ m_buffer += ',';
}
if (!options().changeset.empty()) {
add_option(options().changeset);
m_buffer += std::to_string(object.changeset());
+ m_buffer += ',';
}
if (!options().uid.empty()) {
add_option(options().uid);
m_buffer += std::to_string(object.uid());
+ m_buffer += ',';
}
if (!options().user.empty()) {
add_option(options().user);
const nlohmann::json j = object.user();
- m_buffer += j.template get<std::string>();
+ m_buffer += j.dump();
+ m_buffer += ',';
}
if (!options().timestamp.empty()) {
add_option(options().timestamp);
m_buffer += std::to_string(object.timestamp().seconds_since_epoch());
+ m_buffer += ',';
}
if (!options().way_nodes.empty() && object.type() == osmium::item_type::way) {
@@ -151,6 +160,7 @@ void ExportFormatJSON::add_attributes(const osmium::OSMObject& object) {
} else {
m_buffer += ']';
}
+ m_buffer += ',';
}
}
@@ -240,19 +250,18 @@ void ExportFormatJSON::create_linestring(const osmium::Way& way) {
void ExportFormatJSON::create_multipolygon(const osmium::Area& area) {
m_buffer += R"(,"geometry":{"type":"MultiPolygon","coordinates":)";
+ m_buffer += '[';
for (const auto &outer_ring : area.outer_rings()) {
- m_buffer += "[[";
+ m_buffer += '[';
create_coordinate_list(outer_ring);
- m_buffer += ']';
for (const auto &inner_ring : area.inner_rings(outer_ring)) {
- m_buffer += ",[";
+ m_buffer += ",";
create_coordinate_list(inner_ring);
- m_buffer += ']';
}
m_buffer += "],";
}
-
- m_buffer.back() = '}';
+ m_buffer.pop_back(); // remove trailing comma
+ m_buffer += "]}";
}
void ExportFormatJSON::node(const osmium::Node& node) {
=====================================
src/extract/geojson_file_parser.cpp
=====================================
@@ -179,6 +179,19 @@ GeoJSONFileParser::GeoJSONFileParser(osmium::memory::Buffer& buffer, std::string
}
}
+const nlohmann::json& GeoJSONFileParser::get_coordinates(const nlohmann::json& json_geometry) {
+ const auto json_coordinates = json_geometry.find("coordinates");
+ if (json_coordinates == json_geometry.end()) {
+ error("Missing 'coordinates' name in 'geometry' object.");
+ }
+
+ if (!json_coordinates->is_array()) {
+ error("Expected 'geometry.coordinates' value to be an array.");
+ }
+
+ return *json_coordinates;
+}
+
std::size_t GeoJSONFileParser::parse_top(const nlohmann::json& top) {
const auto json_geometry = top.find("geometry");
if (json_geometry == top.end()) {
@@ -197,20 +210,13 @@ std::size_t GeoJSONFileParser::parse_top(const nlohmann::json& top) {
error("Expected 'geometry.type' value to be 'Polygon' or 'MultiPolygon'.");
}
- const auto json_coordinates = json_geometry->find("coordinates");
- if (json_coordinates == json_geometry->end()) {
- error("Missing 'coordinates' name in 'geometry' object.");
- }
-
- if (!json_coordinates->is_array()) {
- error("Expected 'geometry.coordinates' value to be an array.");
- }
+ const auto json_coordinates = get_coordinates(*json_geometry);
if (geometry_type == "Polygon") {
- return parse_polygon_array(*json_coordinates, &m_buffer);
+ return parse_polygon_array(json_coordinates, &m_buffer);
}
- return parse_multipolygon_array(*json_coordinates, &m_buffer);
+ return parse_multipolygon_array(json_coordinates, &m_buffer);
}
std::size_t GeoJSONFileParser::operator()() {
@@ -223,7 +229,17 @@ std::size_t GeoJSONFileParser::operator()() {
const std::string type{get_value_as_string(doc, "type")};
if (type.empty()) {
- error("Expected 'type' name with the value 'Feature' or 'FeatureCollection'.");
+ error("Expected 'type' name with the value 'Feature', 'FeatureCollection', 'Polygon', or 'MultiPolygon'.");
+ }
+
+ if (type == "Polygon") {
+ const auto json_coordinates = get_coordinates(doc);
+ return parse_polygon_array(json_coordinates, &m_buffer);
+ }
+
+ if (type == "MultiPolygon") {
+ const auto json_coordinates = get_coordinates(doc);
+ return parse_multipolygon_array(json_coordinates, &m_buffer);
}
if (type == "Feature") {
=====================================
src/extract/geojson_file_parser.hpp
=====================================
@@ -45,6 +45,8 @@ class GeoJSONFileParser {
[[noreturn]] void error(const std::string& message);
+ const nlohmann::json& get_coordinates(const nlohmann::json& json_geometry);
+
std::size_t parse_top(const nlohmann::json& top);
public:
=====================================
test/export/CMakeLists.txt
=====================================
@@ -11,7 +11,13 @@ function(check_export _name _options _input _output)
endfunction()
check_export(geojson "-f geojson" input.osm output.geojson)
+check_export(geojsonmp "-f geojson -u type_id" input-mp.osm output-mp.geojson)
check_export(geojsonseq "-f geojsonseq -x print_record_separator=false" input.osm output.geojsonseq)
+check_export(geojsonuid "-f geojsonseq -u type_id" input.osm output-uid.geojsonseq)
+check_export(geojsoncnt "-f geojsonseq -u counter" input.osm output-cnt.geojsonseq)
+check_export(geojsonattr "-f geojson -n -a type,id,version,changeset,timestamp,uid,user,way_nodes" input.osm output-attr.geojson)
+check_export(geojsonchar "-f geojson -n -a type,id,version,changeset,timestamp,uid,user,way_nodes" input-chars.osm output-chars.geojson)
+
check_export(pg "-f pg" input.osm output.pg)
check_export(missing-node "-f geojson" input-missing-node.osm output-missing-node.geojson)
=====================================
test/export/input-chars.osm
=====================================
@@ -0,0 +1,8 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<osm version="0.6" upload="false" generator="testdata">
+ <node id="10" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="te'st" changeset="1" lat="3" lon="1"/>
+ <node id="11" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user='te"st' changeset="1" lat="1" lon="1"/>
+ <node id="12" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="2" lon="1">
+ <tag k="ame'nity" v='post"_box'/>
+ </node>
+</osm>
=====================================
test/export/input-mp.osm
=====================================
@@ -0,0 +1,55 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<osm version="0.6" upload="false" generator="testdata">
+ <node id="10" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="1" lon="1"/>
+ <node id="11" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="1" lon="2"/>
+ <node id="12" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="2" lon="2"/>
+ <node id="13" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="2" lon="1"/>
+ <node id="14" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="0" lon="0"/>
+ <node id="15" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="0" lon="3"/>
+ <node id="16" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="3" lon="3"/>
+ <node id="17" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="3" lon="0"/>
+ <node id="18" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="4" lon="0"/>
+ <node id="19" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="4" lon="1"/>
+ <node id="20" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="5" lon="1"/>
+ <node id="21" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="5" lon="0"/>
+ <way id="80" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <nd ref="10"/>
+ <nd ref="11"/>
+ <nd ref="12"/>
+ <nd ref="13"/>
+ <nd ref="10"/>
+ </way>
+ <way id="81" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <nd ref="14"/>
+ <nd ref="15"/>
+ <nd ref="16"/>
+ <nd ref="17"/>
+ <nd ref="14"/>
+ </way>
+ <way id="82" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <nd ref="18"/>
+ <nd ref="19"/>
+ <nd ref="20"/>
+ <nd ref="21"/>
+ <nd ref="18"/>
+ </way>
+ <relation id="90" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="way" ref="80" role="inner"/>
+ <member type="way" ref="81" role="outer"/>
+ <member type="way" ref="82" role="outer"/>
+ <tag k="type" v="multipolygon"/>
+ <tag k="landuse" v="forest"/>
+ </relation>
+ <relation id="91" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="way" ref="81" role="outer"/>
+ <member type="way" ref="82" role="outer"/>
+ <tag k="type" v="multipolygon"/>
+ <tag k="landuse" v="forest"/>
+ </relation>
+ <relation id="92" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="way" ref="80" role="inner"/>
+ <member type="way" ref="81" role="outer"/>
+ <tag k="type" v="multipolygon"/>
+ <tag k="landuse" v="forest"/>
+ </relation>
+</osm>
=====================================
test/export/output-attr.geojson
=====================================
@@ -0,0 +1,11 @@
+{"type":"FeatureCollection","features":[
+{"type":"Feature","geometry":{"type":"Point","coordinates":[1.0,1.0]},"properties":{"@type":"node","@id":10,"@version":1,"@changeset":1,"@uid":1,"@user":"test","@timestamp":1420074000}},
+{"type":"Feature","geometry":{"type":"Point","coordinates":[1.0,2.0]},"properties":{"@type":"node","@id":11,"@version":1,"@changeset":1,"@uid":1,"@user":"test","@timestamp":1420074000}},
+{"type":"Feature","geometry":{"type":"Point","coordinates":[1.0,3.0]},"properties":{"@type":"node","@id":12,"@version":1,"@changeset":1,"@uid":1,"@user":"test","@timestamp":1420074000}},
+{"type":"Feature","geometry":{"type":"Point","coordinates":[1.0,4.0]},"properties":{"@type":"node","@id":13,"@version":1,"@changeset":1,"@uid":1,"@user":"test","@timestamp":1420074000}},
+{"type":"Feature","geometry":{"type":"Point","coordinates":[2.0,1.5]},"properties":{"@type":"node","@id":14,"@version":1,"@changeset":1,"@uid":1,"@user":"test","@timestamp":1420074000,"amenity":"post_box"}},
+{"type":"Feature","geometry":{"type":"LineString","coordinates":[[1.0,1.0],[1.0,2.0],[1.0,3.0]]},"properties":{"@type":"way","@id":20,"@version":1,"@changeset":1,"@uid":1,"@user":"test","@timestamp":1420074000,"@way_nodes":[10,11,12],"highway":"track"}},
+{"type":"Feature","geometry":{"type":"LineString","coordinates":[[1.0,1.0],[1.0,2.0],[2.0,1.5]]},"properties":{"@type":"way","@id":21,"@version":1,"@changeset":1,"@uid":1,"@user":"test","@timestamp":1420074000,"@way_nodes":[10,11,14],"barrier":"fence"}},
+{"type":"Feature","geometry":{"type":"LineString","coordinates":[[2.0,1.5],[1.0,1.0]]},"properties":{"@type":"way","@id":22,"@version":1,"@changeset":1,"@uid":1,"@user":"test","@timestamp":1420074000,"@way_nodes":[14,10]}},
+{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[1.0,1.0],[2.0,1.5],[1.0,2.0],[1.0,1.0]]]]},"properties":{"@type":"relation","@id":30,"@version":1,"@changeset":1,"@uid":1,"@user":"test","@timestamp":1420074000,"landuse":"forest"}}
+]}
=====================================
test/export/output-chars.geojson
=====================================
@@ -0,0 +1,5 @@
+{"type":"FeatureCollection","features":[
+{"type":"Feature","geometry":{"type":"Point","coordinates":[1.0,3.0]},"properties":{"@type":"node","@id":10,"@version":1,"@changeset":1,"@uid":1,"@user":"te'st","@timestamp":1420074000}},
+{"type":"Feature","geometry":{"type":"Point","coordinates":[1.0,1.0]},"properties":{"@type":"node","@id":11,"@version":1,"@changeset":1,"@uid":1,"@user":"te\"st","@timestamp":1420074000}},
+{"type":"Feature","geometry":{"type":"Point","coordinates":[1.0,2.0]},"properties":{"@type":"node","@id":12,"@version":1,"@changeset":1,"@uid":1,"@user":"test","@timestamp":1420074000,"ame'nity":"post\"_box"}}
+]}
=====================================
test/export/output-cnt.geojsonseq
=====================================
@@ -0,0 +1,4 @@
+
{"type":"Feature","id":1,"geometry":{"type":"Point","coordinates":[2.0,1.5]},"properties":{"amenity":"post_box"}}
+
{"type":"Feature","id":2,"geometry":{"type":"LineString","coordinates":[[1.0,1.0],[1.0,2.0],[1.0,3.0]]},"properties":{"highway":"track"}}
+
{"type":"Feature","id":3,"geometry":{"type":"LineString","coordinates":[[1.0,1.0],[1.0,2.0],[2.0,1.5]]},"properties":{"barrier":"fence"}}
+
{"type":"Feature","id":4,"geometry":{"type":"MultiPolygon","coordinates":[[[[1.0,1.0],[2.0,1.5],[1.0,2.0],[1.0,1.0]]]]},"properties":{"landuse":"forest"}}
=====================================
test/export/output-mp.geojson
=====================================
@@ -0,0 +1,5 @@
+{"type":"FeatureCollection","features":[
+{"type":"Feature","id":"a185","geometry":{"type":"MultiPolygon","coordinates":[[[[0.0,0.0],[3.0,0.0],[3.0,3.0],[0.0,3.0],[0.0,0.0]],[[1.0,1.0],[1.0,2.0],[2.0,2.0],[2.0,1.0],[1.0,1.0]]]]},"properties":{"landuse":"forest"}},
+{"type":"Feature","id":"a183","geometry":{"type":"MultiPolygon","coordinates":[[[[0.0,0.0],[3.0,0.0],[3.0,3.0],[0.0,3.0],[0.0,0.0]]],[[[0.0,4.0],[1.0,4.0],[1.0,5.0],[0.0,5.0],[0.0,4.0]]]]},"properties":{"landuse":"forest"}},
+{"type":"Feature","id":"a181","geometry":{"type":"MultiPolygon","coordinates":[[[[0.0,0.0],[3.0,0.0],[3.0,3.0],[0.0,3.0],[0.0,0.0]],[[1.0,1.0],[1.0,2.0],[2.0,2.0],[2.0,1.0],[1.0,1.0]]],[[[0.0,4.0],[1.0,4.0],[1.0,5.0],[0.0,5.0],[0.0,4.0]]]]},"properties":{"landuse":"forest"}}
+]}
=====================================
test/export/output-uid.geojsonseq
=====================================
@@ -0,0 +1,4 @@
+
{"type":"Feature","id":"n14","geometry":{"type":"Point","coordinates":[2.0,1.5]},"properties":{"amenity":"post_box"}}
+
{"type":"Feature","id":"w20","geometry":{"type":"LineString","coordinates":[[1.0,1.0],[1.0,2.0],[1.0,3.0]]},"properties":{"highway":"track"}}
+
{"type":"Feature","id":"w21","geometry":{"type":"LineString","coordinates":[[1.0,1.0],[1.0,2.0],[2.0,1.5]]},"properties":{"barrier":"fence"}}
+
{"type":"Feature","id":"a61","geometry":{"type":"MultiPolygon","coordinates":[[[[1.0,1.0],[2.0,1.5],[1.0,2.0],[1.0,1.0]]]]},"properties":{"landuse":"forest"}}
=====================================
test/extract/CMakeLists.txt
=====================================
@@ -35,6 +35,20 @@ check_extract_cfg(simple input1.osm output-simple.osm "-s simple --out
#-----------------------------------------------------------------------------
+check_extract(clean64 input64.osm output-clean64.osm "--clean version --clean uid")
+
+check_extract(simple64 input64.osm output-simple64.osm "-s simple --output-header=xml_josm_upload!")
+check_extract(complete_ways64 input64.osm output-complete-ways64.osm "-s complete_ways")
+check_extract(complete_ways_norels64 input64.osm output-complete-ways-norels64.osm "-s complete_ways -S relations=false")
+check_extract(smart_default64 input64.osm output-smart64.osm "-s smart")
+check_extract(smart_mp64 input64.osm output-smart64.osm "-s smart -S types=multipolygon")
+check_extract(smart_any64 input64.osm output-smart64.osm "-s smart -S types=any")
+check_extract(smart_nonmp64 input64.osm output-smart-nonmp64.osm "-s smart -S types=x")
+
+check_extract_cfg(simple64 input64.osm output-simple64.osm "-s simple --output-header=xml_josm_upload=false")
+
+#-----------------------------------------------------------------------------
+
check_extract_opl(antimeridian-east-bbox antimeridian.opl output-antimeridian-east.opl "--bbox=160,60,180,80")
check_extract_opl(antimeridian-west-bbox antimeridian.opl output-antimeridian-west.opl "--bbox=-180,60,-160,80")
check_extract_opl(antimeridian-east-poly antimeridian.opl output-antimeridian-east.opl "--polygon=extract/polygon-russia-east.geojson")
@@ -47,4 +61,6 @@ check_extract_opl(antimeridian-alaska-west-json w46113981.osm w46113981.opl "--p
check_extract_opl(antimeridian-alaska-east-poly w42394837.osm w42394837.opl "--polygon=extract/polygon-us-alaska.poly")
check_extract_opl(antimeridian-alaska-west-poly w46113981.osm w46113981.opl "--polygon=extract/polygon-us-alaska.poly")
+check_extract_opl(antimeridian-alaska-east-json-no-feature w42394837.osm w42394837.opl "--polygon=extract/polygon-us-alaska-no-feature.geojson")
+
#-----------------------------------------------------------------------------
=====================================
test/extract/input64.osm
=====================================
@@ -0,0 +1,41 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<osm version="0.6" upload="false" generator="testdata">
+ <node id="5000000010" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="0" lon="1"/>
+ <node id="5000000011" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="1" lon="1"/>
+ <node id="5000000012" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="2" lon="1"/>
+ <node id="5000000013" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="3" lon="2"/>
+ <node id="5000000014" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="4" lon="2"/>
+ <node id="5000000015" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="5" lon="2"/>
+ <node id="5000000016" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="6" lon="2"/>
+ <way id="5000000020" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <nd ref="5000000011"/>
+ <nd ref="5000000012"/>
+ <nd ref="5000000013"/>
+ <tag k="foo" v="bar"/>
+ </way>
+ <way id="5000000021" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <nd ref="5000000014"/>
+ <nd ref="5000000015"/>
+ <tag k="xyz" v="abc"/>
+ </way>
+ <relation id="5000000031" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="node" ref="5000000010" role=""/>
+ </relation>
+ <relation id="5000000032" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="node" ref="5000000013" role=""/>
+ </relation>
+ <relation id="5000000033" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="way" ref="5000000020" role=""/>
+ </relation>
+ <relation id="5000000034" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="way" ref="5000000020" role=""/>
+ <member type="way" ref="5000000021" role=""/>
+ <tag k="type" v="multipolygon"/>
+ </relation>
+ <relation id="5000000035" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="relation" ref="5000000031" role=""/>
+ </relation>
+ <relation id="5000000036" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="relation" ref="5000000035" role=""/>
+ </relation>
+</osm>
=====================================
test/extract/output-clean64.osm
=====================================
@@ -0,0 +1,30 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<osm version="0.6" generator="test">
+ <node id="5000000010" timestamp="2015-01-01T01:00:00Z" user="test" changeset="1" lat="0" lon="1"/>
+ <node id="5000000011" timestamp="2015-01-01T01:00:00Z" user="test" changeset="1" lat="1" lon="1"/>
+ <node id="5000000012" timestamp="2015-01-01T01:00:00Z" user="test" changeset="1" lat="2" lon="1"/>
+ <node id="5000000013" timestamp="2015-01-01T01:00:00Z" user="test" changeset="1" lat="3" lon="2"/>
+ <way id="5000000020" timestamp="2015-01-01T01:00:00Z" user="test" changeset="1">
+ <nd ref="5000000011"/>
+ <nd ref="5000000012"/>
+ <nd ref="5000000013"/>
+ <tag k="foo" v="bar"/>
+ </way>
+ <relation id="5000000031" timestamp="2015-01-01T01:00:00Z" user="test" changeset="1">
+ <member type="node" ref="5000000010" role=""/>
+ </relation>
+ <relation id="5000000033" timestamp="2015-01-01T01:00:00Z" user="test" changeset="1">
+ <member type="way" ref="5000000020" role=""/>
+ </relation>
+ <relation id="5000000034" timestamp="2015-01-01T01:00:00Z" user="test" changeset="1">
+ <member type="way" ref="5000000020" role=""/>
+ <member type="way" ref="5000000021" role=""/>
+ <tag k="type" v="multipolygon"/>
+ </relation>
+ <relation id="5000000035" timestamp="2015-01-01T01:00:00Z" user="test" changeset="1">
+ <member type="relation" ref="5000000031" role=""/>
+ </relation>
+ <relation id="5000000036" timestamp="2015-01-01T01:00:00Z" user="test" changeset="1">
+ <member type="relation" ref="5000000035" role=""/>
+ </relation>
+</osm>
=====================================
test/extract/output-complete-ways-norels64.osm
=====================================
@@ -0,0 +1,13 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<osm version="0.6" generator="test">
+ <node id="5000000010" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="0" lon="1"/>
+ <node id="5000000011" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="1" lon="1"/>
+ <node id="5000000012" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="2" lon="1"/>
+ <node id="5000000013" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="3" lon="2"/>
+ <way id="5000000020" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <nd ref="5000000011"/>
+ <nd ref="5000000012"/>
+ <nd ref="5000000013"/>
+ <tag k="foo" v="bar"/>
+ </way>
+</osm>
=====================================
test/extract/output-complete-ways64.osm
=====================================
@@ -0,0 +1,30 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<osm version="0.6" generator="test">
+ <node id="5000000010" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="0" lon="1"/>
+ <node id="5000000011" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="1" lon="1"/>
+ <node id="5000000012" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="2" lon="1"/>
+ <node id="5000000013" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="3" lon="2"/>
+ <way id="5000000020" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <nd ref="5000000011"/>
+ <nd ref="5000000012"/>
+ <nd ref="5000000013"/>
+ <tag k="foo" v="bar"/>
+ </way>
+ <relation id="5000000031" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="node" ref="5000000010" role=""/>
+ </relation>
+ <relation id="5000000033" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="way" ref="5000000020" role=""/>
+ </relation>
+ <relation id="5000000034" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="way" ref="5000000020" role=""/>
+ <member type="way" ref="5000000021" role=""/>
+ <tag k="type" v="multipolygon"/>
+ </relation>
+ <relation id="5000000035" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="relation" ref="5000000031" role=""/>
+ </relation>
+ <relation id="5000000036" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="relation" ref="5000000035" role=""/>
+ </relation>
+</osm>
=====================================
test/extract/output-simple64.osm
=====================================
@@ -0,0 +1,23 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<osm version="0.6" upload="false" generator="test">
+ <node id="5000000010" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="0" lon="1"/>
+ <node id="5000000011" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="1" lon="1"/>
+ <node id="5000000012" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="2" lon="1"/>
+ <way id="5000000020" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <nd ref="5000000011"/>
+ <nd ref="5000000012"/>
+ <nd ref="5000000013"/>
+ <tag k="foo" v="bar"/>
+ </way>
+ <relation id="5000000031" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="node" ref="5000000010" role=""/>
+ </relation>
+ <relation id="5000000033" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="way" ref="5000000020" role=""/>
+ </relation>
+ <relation id="5000000034" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="way" ref="5000000020" role=""/>
+ <member type="way" ref="5000000021" role=""/>
+ <tag k="type" v="multipolygon"/>
+ </relation>
+</osm>
=====================================
test/extract/output-smart-nonmp64.osm
=====================================
@@ -0,0 +1,30 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<osm version="0.6" generator="test">
+ <node id="5000000010" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="0" lon="1"/>
+ <node id="5000000011" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="1" lon="1"/>
+ <node id="5000000012" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="2" lon="1"/>
+ <node id="5000000013" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="3" lon="2"/>
+ <way id="5000000020" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <nd ref="5000000011"/>
+ <nd ref="5000000012"/>
+ <nd ref="5000000013"/>
+ <tag k="foo" v="bar"/>
+ </way>
+ <relation id="5000000031" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="node" ref="5000000010" role=""/>
+ </relation>
+ <relation id="5000000033" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="way" ref="5000000020" role=""/>
+ </relation>
+ <relation id="5000000034" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="way" ref="5000000020" role=""/>
+ <member type="way" ref="5000000021" role=""/>
+ <tag k="type" v="multipolygon"/>
+ </relation>
+ <relation id="5000000035" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="relation" ref="5000000031" role=""/>
+ </relation>
+ <relation id="5000000036" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="relation" ref="5000000035" role=""/>
+ </relation>
+</osm>
=====================================
test/extract/output-smart64.osm
=====================================
@@ -0,0 +1,37 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<osm version="0.6" generator="test">
+ <node id="5000000010" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="0" lon="1"/>
+ <node id="5000000011" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="1" lon="1"/>
+ <node id="5000000012" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="2" lon="1"/>
+ <node id="5000000013" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="3" lon="2"/>
+ <node id="5000000014" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="4" lon="2"/>
+ <node id="5000000015" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="5" lon="2"/>
+ <way id="5000000020" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <nd ref="5000000011"/>
+ <nd ref="5000000012"/>
+ <nd ref="5000000013"/>
+ <tag k="foo" v="bar"/>
+ </way>
+ <way id="5000000021" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <nd ref="5000000014"/>
+ <nd ref="5000000015"/>
+ <tag k="xyz" v="abc"/>
+ </way>
+ <relation id="5000000031" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="node" ref="5000000010" role=""/>
+ </relation>
+ <relation id="5000000033" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="way" ref="5000000020" role=""/>
+ </relation>
+ <relation id="5000000034" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="way" ref="5000000020" role=""/>
+ <member type="way" ref="5000000021" role=""/>
+ <tag k="type" v="multipolygon"/>
+ </relation>
+ <relation id="5000000035" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="relation" ref="5000000031" role=""/>
+ </relation>
+ <relation id="5000000036" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
+ <member type="relation" ref="5000000035" role=""/>
+ </relation>
+</osm>
=====================================
test/extract/polygon-us-alaska-no-feature.geojson
=====================================
@@ -0,0 +1,149 @@
+{
+ "type": "MultiPolygon",
+ "coordinates": [
+ [
+ [
+ [
+ 180,
+ 54.19453
+ ],
+ [
+ 180,
+ 51.11044
+ ],
+ [
+ 171.7602,
+ 51.13801
+ ],
+ [
+ 171.8152,
+ 54.08518
+ ],
+ [
+ 180,
+ 54.19453
+ ]
+ ]
+ ],
+ [
+ [
+ [
+ -180,
+ 49.80942
+ ],
+ [
+ -180,
+ 60.09775
+ ],
+ [
+ -169.0686,
+ 65.40802
+ ],
+ [
+ -168.9478,
+ 66.01132
+ ],
+ [
+ -169.1147,
+ 71.19564
+ ],
+ [
+ -140.9715,
+ 72.98845
+ ],
+ [
+ -140.9775,
+ 60.31064
+ ],
+ [
+ -139.0488,
+ 60.36127
+ ],
+ [
+ -139.1508,
+ 60.10438
+ ],
+ [
+ -138.6734,
+ 59.9144
+ ],
+ [
+ -138.6363,
+ 59.81201
+ ],
+ [
+ -137.5517,
+ 59.23372
+ ],
+ [
+ -137.4664,
+ 58.94576
+ ],
+ [
+ -136.7081,
+ 59.21237
+ ],
+ [
+ -136.3698,
+ 59.61097
+ ],
+ [
+ -135.3911,
+ 59.82867
+ ],
+ [
+ -134.7243,
+ 59.3922
+ ],
+ [
+ -134.4972,
+ 59.15539
+ ],
+ [
+ -133.3385,
+ 58.42044
+ ],
+ [
+ -131.6441,
+ 56.6537
+ ],
+ [
+ -129.7998,
+ 56.04294
+ ],
+ [
+ -130.1171,
+ 55.74696
+ ],
+ [
+ -129.8715,
+ 55.26134
+ ],
+ [
+ -130.5575,
+ 54.64634
+ ],
+ [
+ -131.6262,
+ 54.4781
+ ],
+ [
+ -132.6944,
+ 54.45706
+ ],
+ [
+ -133.7018,
+ 54.51622
+ ],
+ [
+ -133.5648,
+ 53.42951
+ ],
+ [
+ -180,
+ 49.80942
+ ]
+ ]
+ ]
+ ]
+}
View it on GitLab: https://salsa.debian.org/debian-gis-team/osmium-tool/-/compare/2b73b3b0450100f1328c6f7f8470491f5fc2e8b8...9988a79f292db84e9f2da4779a8e324600718b81
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/osmium-tool/-/compare/2b73b3b0450100f1328c6f7f8470491f5fc2e8b8...9988a79f292db84e9f2da4779a8e324600718b81
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20250318/b10f503e/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list