pub struct OsmAdmin {
pub id: usize,
pub relation_id: u64,
pub name: EncodableString,
pub level: usize,
pub geometry: EncodableGeometry,
}Expand description
A representation of the OpenStreetMap
geojson
geojson::Features for administrative areas.
Fields§
§id: usizeThe index of the OsmAdmin in the global static cache.
This is is not stable across builds or new data sets. It is merely unique during a single build.
relation_id: u64The OSM relation id of the admin area (e.g., 1473947), or 0 if the source boundary was
not relation-backed. Unlike OsmAdmin::id, this is stable across builds and data sets.
name: EncodableStringThe name of the OsmAdmin (e.g., Burkina Faso).
level: usizeThe level of the OsmAdmin (e.g., 3).
geometry: EncodableGeometryThe geometry of the OsmAdmin.
Trait Implementations§
Source§impl CanGetGeoJsonFeaturesFromSource for OsmAdmin
Available on non-target_family=wasm only.
impl CanGetGeoJsonFeaturesFromSource for OsmAdmin
target_family=wasm only.Source§fn get_geojson_features_from_source() -> FeatureCollection
fn get_geojson_features_from_source() -> FeatureCollection
Source§impl CanPerformGeoLookup for OsmAdmin
impl CanPerformGeoLookup for OsmAdmin
Source§fn lookup(xf: Float, yf: Float) -> Vec<&'static Self>
fn lookup(xf: Float, yf: Float) -> Vec<&'static Self>
Source§fn lookup_slow(xf: Float, yf: Float) -> Vec<&'static Self>
fn lookup_slow(xf: Float, yf: Float) -> Vec<&'static Self>
Source§fn memory_data_to_geojson() -> String
fn memory_data_to_geojson() -> String
Source§fn get_lookup_suggestions(
x: RoundDegree,
y: RoundDegree,
) -> Option<Vec<&'static Self>>
fn get_lookup_suggestions( x: RoundDegree, y: RoundDegree, ) -> Option<Vec<&'static Self>>
Source§impl From<&'static OsmAdmin> for OsmAdminResponse1
Available on crate feature admin-osm only.
impl From<&'static OsmAdmin> for OsmAdminResponse1
admin-osm only.Source§fn from(value: &'static OsmAdmin) -> OsmAdminResponse1
fn from(value: &'static OsmAdmin) -> OsmAdminResponse1
Source§impl HasGeometry for OsmAdmin
impl HasGeometry for OsmAdmin
Source§fn reorder(items: ConcreteVec<OsmAdmin>) -> ConcreteVec<OsmAdmin>
fn reorder(items: ConcreteVec<OsmAdmin>) -> ConcreteVec<OsmAdmin>
Order admins broadest-first, so a lookup returns the containment hierarchy in reading order (country, then state, then county, then city) rather than in source-file order.
relation_id breaks ties: levels collide constantly, and without a stable secondary key
the order would shift between regenerations of identical data.
Source§fn id(&self) -> usize
fn id(&self) -> usize
id of the HasGeometry.Source§impl HasItemData for OsmAdmin
impl HasItemData for OsmAdmin
Source§fn get_mem_items() -> &'static ConcreteVec<OsmAdmin>
fn get_mem_items() -> &'static ConcreteVec<OsmAdmin>
Source§impl HasLookupData for OsmAdmin
impl HasLookupData for OsmAdmin
Source§type Lookup = EncodableIds
type Lookup = EncodableIds
Source§fn get_mem_lookup() -> &'static HashMap<RoundLngLat, Self::Lookup>
fn get_mem_lookup() -> &'static HashMap<RoundLngLat, Self::Lookup>
Source§impl HasProperties for OsmAdmin
impl HasProperties for OsmAdmin
Source§fn properties(&self) -> Map<String, Value>
fn properties(&self) -> Map<String, Value>
HasProperties.Auto Trait Implementations§
impl Freeze for OsmAdmin
impl RefUnwindSafe for OsmAdmin
impl Send for OsmAdmin
impl Sync for OsmAdmin
impl Unpin for OsmAdmin
impl UnsafeUnpin for OsmAdmin
impl UnwindSafe for OsmAdmin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> Erased for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more