Crates.io | osm-is-area |
lib.rs | osm-is-area |
version | 1.0.0 |
source | src |
created_at | 2020-10-24 08:20:18.427776 |
updated_at | 2021-04-08 03:24:18.699171 |
description | Is this OpenStreetMap element an area or not? |
homepage | https://github.com/okdistribute/osm-is-area.rs |
repository | https://github.com/okdistribute/osm-is-area.rs |
max_upload_size | |
id | 304937 |
size | 14,826 |
An OpenSreetMap area must be a way or a relation. But not just any way or relation.
If you are not so fortunate that all your elements are nodes, look further...
osm_is_area::way
According to Overpass turbo, a way is considered an area if
area=no
use osm_is_area;
let tags = vec![
(r"waterway", r"riverbank")
];
let refs = vec![1, 3, 2, 1];
let is_area = osm_is_area::way(&tags, &refs);
assert_eq!(true, is_area);
osm_is_area::relation
A relation is an area when it has a tag "type" with value "multipolygon".
use osm_is_area;
let tags = vec![
(r"type", r"multipolygon")
];
let members = vec![1, 3, 2, 1];
let is_area = osm_is_area::relation(&tags, &members);
assert_eq!(true, is_area);
MIT