Struct cosmogony::zone::Zone [−][src]
pub struct Zone { pub id: ZoneIndex, pub osm_id: String, pub admin_level: Option<u32>, pub zone_type: Option<ZoneType>, pub name: String, pub label: String, pub international_labels: BTreeMap<String, String>, pub zip_codes: Vec<String>, pub center: Option<Point<f64>>, pub boundary: Option<MultiPolygon<f64>>, pub bbox: Option<Bbox<f64>>, pub tags: Tags, pub center_tags: Tags, pub parent: Option<ZoneIndex>, pub wikidata: Option<String>, // some fields omitted }
Fields
id: ZoneIndex
osm_id: String
admin_level: Option<u32>
zone_type: Option<ZoneType>
name: String
label: String
international_labels: BTreeMap<String, String>
zip_codes: Vec<String>
center: Option<Point<f64>>
boundary: Option<MultiPolygon<f64>>
bbox: Option<Bbox<f64>>
parent: Option<ZoneIndex>
wikidata: Option<String>
Methods
impl Zone
[src]
impl Zone
pub fn default() -> Self
[src]
pub fn default() -> Self
pub fn is_admin(&self) -> bool
[src]
pub fn is_admin(&self) -> bool
pub fn set_parent(&mut self, idx: Option<ZoneIndex>)
[src]
pub fn set_parent(&mut self, idx: Option<ZoneIndex>)
pub fn from_osm(relation: &Relation, index: ZoneIndex) -> Option<Self>
[src]
pub fn from_osm(relation: &Relation, index: ZoneIndex) -> Option<Self>
pub fn from_osm_with_geom(
relation: &Relation,
objects: &BTreeMap<OsmId, OsmObj>,
index: ZoneIndex
) -> Option<Self>
[src]
pub fn from_osm_with_geom(
relation: &Relation,
objects: &BTreeMap<OsmId, OsmObj>,
index: ZoneIndex
) -> Option<Self>
pub fn contains(&self, other: &Zone) -> bool
[src]
pub fn contains(&self, other: &Zone) -> bool
ⓘImportant traits for HierarchyIterator<'a>pub fn iter_hierarchy<'a>(
&'a self,
all_zones: &'a MutableSlice
) -> HierarchyIterator<'a>
[src]
ⓘImportant traits for HierarchyIterator<'a>
pub fn iter_hierarchy<'a>(
&'a self,
all_zones: &'a MutableSlice
) -> HierarchyIterator<'a>
iter_hierarchy gives an iterator over the whole hierachy including self
pub fn compute_labels(&mut self, all_zones: &MutableSlice)
[src]
pub fn compute_labels(&mut self, all_zones: &MutableSlice)
compute a nice human readable label The label carries the hierarchy of a zone.
This label is inspired from opencage formatting
and from the mimirsbrunn zip code formatting
example of zone's label: Paris (75000-75116), Île-de-France, France
We compute a default label, and a label per language Note: for the moment we use the same format for every language, but in the future we might use opencage's configuration for this
Trait Implementations
impl Debug for Zone
[src]
impl Debug for Zone
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Zone
[src]
impl Clone for Zone