pub struct OsmAdmin {
pub id: usize,
pub name: Cow<'static, str>,
pub level: u8,
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.
name: Cow<'static, str>The name of the OsmAdmin (e.g., Burkina Faso).
level: u8The level of the OsmAdmin (e.g., 3).
geometry: EncodableGeometryThe 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§fn id(&self) -> usize
fn id(&self) -> usize
Get the
id of the HasGeometry.source§fn geometry(&self) -> &Geometry<f32>
fn geometry(&self) -> &Geometry<f32>
Get the [
Geometry] 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>
Gets the items from the in-memory cache for the given type.
source§impl HasLookupData for OsmAdmin
impl HasLookupData for OsmAdmin
§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 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>
§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.