Skip to content

Commit d2a89ef

Browse files
kucukaslanjoto
authored andcommitted
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
1 parent 9d62af2 commit d2a89ef

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

src/extract/strategy_simple.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ namespace strategy_simple {
7777
if (e->node_ids.get(nr.positive_ref())) {
7878
e->write(way);
7979
e->way_ids.set(way.positive_id());
80+
return;
8081
}
81-
return;
8282
}
8383
}
8484

test/extract/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,5 @@ check_extract_opl(antimeridian-alaska-west-poly w46113981.osm w46113981.opl "--p
6464
check_extract_opl(antimeridian-alaska-east-json-no-feature w42394837.osm w42394837.opl "--polygon=extract/polygon-us-alaska-no-feature.geojson")
6565

6666
#-----------------------------------------------------------------------------
67+
check_extract(simple_way_starts_outside input-way-starts-outside.osm output-simple-way-starts-outside.osm "-s simple")
68+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<osm version="0.6" upload="false" generator="testdata">
3+
<node id="100" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="1" lon="5"/>
4+
<node id="101" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="2" lon="1"/>
5+
<node id="102" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="3" lon="1"/>
6+
<way id="200" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
7+
<nd ref="100"/>
8+
<nd ref="101"/>
9+
<nd ref="102"/>
10+
<tag k="highway" v="residential"/>
11+
</way>
12+
</osm>
13+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<osm version="0.6" generator="test">
3+
<node id="101" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="2" lon="1"/>
4+
<node id="102" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1" lat="3" lon="1"/>
5+
<way id="200" version="1" timestamp="2015-01-01T01:00:00Z" uid="1" user="test" changeset="1">
6+
<nd ref="100"/>
7+
<nd ref="101"/>
8+
<nd ref="102"/>
9+
<tag k="highway" v="residential"/>
10+
</way>
11+
</osm>

0 commit comments

Comments
 (0)