From 76450091d051109024a780cf8f4dc6a87363b04d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muhammed=20Can=20K=C3=BC=C3=A7=C3=BCkaslan?= Date: Wed, 17 Dec 2025 02:21:34 +0300 Subject: [PATCH] bug-fix: nodes that start with a node outside the region but have a node in the region should be included "All ways that have at least one node inside the region are included" https://osmcode.org/osmium-tool/manual.html#filtering-by-tags:~:text=All%20ways%20that%20have%20at%20least%20one%20node%20inside%20the%20region%20are%20included --- src/extract/strategy_simple.cpp | 2 +- test/extract/CMakeLists.txt | 2 ++ test/extract/input-way-starts-outside.osm | 13 +++++++++++++ test/extract/output-simple-way-starts-outside.osm | 11 +++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 test/extract/input-way-starts-outside.osm create mode 100644 test/extract/output-simple-way-starts-outside.osm diff --git a/src/extract/strategy_simple.cpp b/src/extract/strategy_simple.cpp index 5243b2c4..52725144 100644 --- a/src/extract/strategy_simple.cpp +++ b/src/extract/strategy_simple.cpp @@ -77,8 +77,8 @@ namespace strategy_simple { if (e->node_ids.get(nr.positive_ref())) { e->write(way); e->way_ids.set(way.positive_id()); + return; } - return; } } diff --git a/test/extract/CMakeLists.txt b/test/extract/CMakeLists.txt index a8a710f2..741ec34c 100644 --- a/test/extract/CMakeLists.txt +++ b/test/extract/CMakeLists.txt @@ -64,3 +64,5 @@ check_extract_opl(antimeridian-alaska-west-poly w46113981.osm w46113981.opl "--p check_extract_opl(antimeridian-alaska-east-json-no-feature w42394837.osm w42394837.opl "--polygon=extract/polygon-us-alaska-no-feature.geojson") #----------------------------------------------------------------------------- +check_extract(simple_way_starts_outside input-way-starts-outside.osm output-simple-way-starts-outside.osm "-s simple") + diff --git a/test/extract/input-way-starts-outside.osm b/test/extract/input-way-starts-outside.osm new file mode 100644 index 00000000..5e228468 --- /dev/null +++ b/test/extract/input-way-starts-outside.osm @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/test/extract/output-simple-way-starts-outside.osm b/test/extract/output-simple-way-starts-outside.osm new file mode 100644 index 00000000..6763cf70 --- /dev/null +++ b/test/extract/output-simple-way-starts-outside.osm @@ -0,0 +1,11 @@ + + + + + + + + + + +