Skip to content

Commit 04b7c71

Browse files
authored
Merge pull request #157 from osm-without-borders/add_suburb_node
add suburb node
2 parents 611f260 + 9d299bb commit 04b7c71

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/workflows/test-and-publish.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Test and Publish crate
22

3-
on: [push, pull_request]
3+
on: [pull_request]
44

55
jobs:
66
tests:
@@ -23,7 +23,6 @@ jobs:
2323
components: rustfmt
2424

2525
- run: cargo fmt --all -- --check
26-
- run: cargo test --all
2726
- run: cd cosmogony && cargo test --all
2827

2928
- name: Publish crate

src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub fn get_zones_and_stats(
5858
let mut zones = Vec::with_capacity(1000);
5959

6060
for obj in pbf.values() {
61-
if !is_admin(obj) {
61+
if !is_admin(obj) && !obj.tags().get("place").map_or(false, |v| v == "suburb") {
6262
continue;
6363
}
6464
if let OsmObj::Relation(ref relation) = *obj {
@@ -70,6 +70,13 @@ pub fn get_zones_and_stats(
7070
}
7171
};
7272
}
73+
if let OsmObj::Node(ref node) = *obj {
74+
let next_index = ZoneIndex { index: zones.len() };
75+
if let Some(zone) = Zone::from_osm_node(node, next_index) {
76+
// Ignore zone without boundary polygon for the moment
77+
zones.push(zone);
78+
};
79+
}
7380
}
7481

7582
Ok((zones, stats))

0 commit comments

Comments
 (0)