pub struct GeoLayer {
pub space: CoordinateSpace,
pub kind: Option<CoordsKind>,
pub features: Vec<GeoFeature>,
}Expand description
A standalone geographic document: element points and routes in one coordinate space, keyed by element identity rather than embedded in a case.
Fields§
§space: CoordinateSpaceCoordinate space of every feature.
kind: Option<CoordsKind>Default coordinate origin, stamped into the powerio_geo member on write.
features: Vec<GeoFeature>Implementations§
Source§impl GeoLayer
impl GeoLayer
Sourcepub fn parse(text: &str, name_hint: Option<&str>) -> Result<GeoParsed, Error>
pub fn parse(text: &str, name_hint: Option<&str>) -> Result<GeoParsed, Error>
Tolerant read of a geographic sidecar from UTF-8 text. name_hint (a file
name) picks CSV against JSON when present; otherwise the content is
sniffed. Accepts headerless buscoords CSV (bus,x,y), CSV and JSON
records with aliased field names, and GeoJSON Point/LineString
features. Rejects input carrying no usable coordinates.
Sourcepub fn to_geojson_checked(&self) -> Result<String, Error>
pub fn to_geojson_checked(&self) -> Result<String, Error>
to_geojson behind the extraction surfaces’ shared
guard: an empty layer is refused because the written document would not
read back (parse rejects a document with
no features).
Sourcepub fn to_geojson(&self) -> String
pub fn to_geojson(&self) -> String
Serialize the canonical form: a GeoJSON FeatureCollection with the
powerio_geo foreign member. Valid RFC 7946 GeoJSON when the space is
geographic, so GIS tools open it directly.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GeoLayer
impl<'de> Deserialize<'de> for GeoLayer
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GeoLayer, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GeoLayer, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for GeoLayer
impl JsonSchema for GeoLayer
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more