diff --git a/.github/workflows/branch-verify.yml b/.github/workflows/branch-verify.yml index 699f42e..5e701a9 100644 --- a/.github/workflows/branch-verify.yml +++ b/.github/workflows/branch-verify.yml @@ -24,10 +24,10 @@ jobs: run: | target/debug/osm_extract_polygon -f data/suriname-latest.osm.pbf -g echo $(md5sum data/suriname-latest.osm.pbf_polygons/Papaichton.geojson) - md5sum data/suriname-latest.osm.pbf_polygons/Papaichton.geojson | cut -c1-32 | awk '$1!="6554ec55b2f7a05cacb8fbe0df3199f2" {err = 1; exit; } END {exit err}' + md5sum data/suriname-latest.osm.pbf_polygons/Papaichton.geojson | cut -c1-32 | awk '$1!="0dfccf437c98e4f22988466064589ca7" {err = 1; exit; } END {exit err}' md5sum data/suriname-latest.osm.pbf_polygons/Papaichton.poly | cut -c1-32 | awk '$1!="f017f2ca29051e1c9dea687a11f6175e" {err = 1; exit; } END {exit err}' echo $(md5sum data/suriname-latest.osm.pbf_polygons/Maripasoula.geojson) - md5sum data/suriname-latest.osm.pbf_polygons/Maripasoula.geojson | cut -c1-32 | awk '$1!="934f4d585799776d2f10ef608ad2103f" {err = 1; exit; } END {exit err}' + md5sum data/suriname-latest.osm.pbf_polygons/Maripasoula.geojson | cut -c1-32 | awk '$1!="1837993d9e7ca6b16c6fa136a7a98537" {err = 1; exit; } END {exit err}' md5sum data/suriname-latest.osm.pbf_polygons/Maripasoula.poly | cut -c1-32 | awk '$1!="d7608f4bd631237a092b9a5777091340" {err = 1; exit; } END {exit err}' - name: Push to codecov.io env: diff --git a/Cargo.lock b/Cargo.lock index c6d9551..030dfa9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -319,7 +319,7 @@ dependencies = [ [[package]] name = "osm_extract_polygon" -version = "0.5.6" +version = "0.5.7" dependencies = [ "clap", "geo-types", diff --git a/Cargo.toml b/Cargo.toml index 0f32ec3..5d696d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "osm_extract_polygon" -version = "0.5.6" +version = "0.5.7" authors = ["Andreas "] edition = "2018" diff --git a/src/osm_reader.rs b/src/osm_reader.rs index 65bd88e..8bdcf0e 100644 --- a/src/osm_reader.rs +++ b/src/osm_reader.rs @@ -2,7 +2,6 @@ use osmpbfreader::{Node, NodeId, OsmPbfReader, Relation, RelationId, WayId}; use std::collections::{HashMap, HashSet}; use std::fs::File; -use std::i8::MAX; use std::path::Path; use std::time::Instant; @@ -48,7 +47,7 @@ fn has_proper_admin_level(relation: &Relation, min_admin: &i8, max_admin: &i8) - .tags .get("admin_level") .and_then(|v| v.parse::().ok()) - .unwrap_or(MAX); + .unwrap_or(i8::MAX); (*min_admin <= admin_level) && (admin_level <= *max_admin) } diff --git a/src/output/file_writer_geojson.rs b/src/output/file_writer_geojson.rs index 2f3be13..2a166d6 100644 --- a/src/output/file_writer_geojson.rs +++ b/src/output/file_writer_geojson.rs @@ -38,6 +38,7 @@ fn create_properties(polygon: &Polygon) -> Map { let mut properties = Map::new(); properties.insert(String::from("name"), to_value(&polygon.name).unwrap()); properties.insert(String::from("admin_level"), to_value(polygon.admin_level).unwrap()); + properties.insert(String::from("relation_id"), to_value(polygon.relation_id).unwrap()); properties }