pub struct OsmAdmin {
pub id: usize,
pub name: EncodableString,
pub level: usize,
pub geometry: EncodableGeometry,
}
Expand description
A representation of the OpenStreetMap
geojson
geojson::Feature
s for administrative areas.
Fields§
§id: usize
The 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.
name: EncodableString
The name
of the OsmAdmin
(e.g., Burkina Faso
).
level: usize
The level
of the OsmAdmin
(e.g., 3
).
geometry: EncodableGeometry
The geometry of the OsmAdmin
.
Trait Implementations§
Source§impl CanGetGeoJsonFeaturesFromSource for OsmAdmin
impl CanGetGeoJsonFeaturesFromSource for OsmAdmin
Source§fn get_geojson_features_from_source() -> FeatureCollection
fn get_geojson_features_from_source() -> FeatureCollection
Get the GeoJSON features from a source.
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>
Get the cache-driven item for a given longitude (x) and latitude (y). Read more
Source§fn lookup_slow(xf: Float, yf: Float) -> Vec<&'static Self>
fn lookup_slow(xf: Float, yf: Float) -> Vec<&'static Self>
Get the exact item for a given longitude (x) and latitude (y).
Source§fn memory_data_to_geojson() -> String
fn memory_data_to_geojson() -> String
Gets the geojson representation of the memory cache.
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>>
Get value from the static memory cache.
Source§impl From<&'static OsmAdmin> for OsmAdminResponse1
impl From<&'static OsmAdmin> for OsmAdminResponse1
Source§fn from(value: &'static OsmAdmin) -> OsmAdminResponse1
fn from(value: &'static OsmAdmin) -> OsmAdminResponse1
Converts to this type from the input type.
Source§impl HasGeometry for OsmAdmin
impl HasGeometry for OsmAdmin
Source§impl HasItemData for OsmAdmin
impl HasItemData for OsmAdmin
Source§fn get_mem_items() -> &'static ConcreteVec<OsmAdmin>
fn get_mem_items() -> &'static ConcreteVec<OsmAdmin>
Gets the items from the in-memory cache for the given type.
Source§impl HasLookupData for OsmAdmin
impl HasLookupData for OsmAdmin
Source§type Lookup = EncodableIds
type Lookup = EncodableIds
The type to which the lookup hash table resolves.
Source§fn get_mem_lookup() -> &'static HashMap<RoundLngLat, Self::Lookup>
fn get_mem_lookup() -> &'static HashMap<RoundLngLat, Self::Lookup>
Gets the lookup hash table from the in-memory cache for the given type.
Source§impl HasProperties for OsmAdmin
impl HasProperties for OsmAdmin
Source§fn properties(&self) -> Map<String, Value>
fn properties(&self) -> Map<String, Value>
Get the properties of the
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 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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToGeoJsonFeature for Twhere
T: HasGeometry + HasProperties,
impl<T> ToGeoJsonFeature for Twhere
T: HasGeometry + HasProperties,
Source§fn to_feature(&self) -> Feature
fn to_feature(&self) -> Feature
Convert the type to GeoJSON.