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 provenance, stamped into the powerio_geo member on write.
features: Vec<GeoFeature>Implementations§
Source§impl GeoLayer
impl GeoLayer
Sourcepub fn parse_bytes(bytes: &[u8], name_hint: Option<&str>) -> Result<GeoParsed>
pub fn parse_bytes(bytes: &[u8], name_hint: Option<&str>) -> Result<GeoParsed>
Tolerant read of a geographic sidecar from bytes. 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 extracted_geojson(&self) -> Result<String>
pub fn extracted_geojson(&self) -> Result<String>
to_geojson behind the extraction surfaces’ shared
guard: an empty layer is refused because the written document would not
read back (parse_bytes 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.