Skip to main content

parse_trainpath_geojson

Function parse_trainpath_geojson 

Source
pub fn parse_trainpath_geojson(path: &str) -> Result<TrainPath, ProjectionError>
Expand description

Parse a [TrainPath] from a GeoJSON FeatureCollection file.

Expects the format produced by write_trainpath_geojson: a FeatureCollection where each Feature carries segment properties (netelement_id, probability, start_intrinsic, end_intrinsic, gnss_start_index, gnss_end_index). The FeatureCollection’s properties object (stored in foreign_members) may optionally contain overall_probability (float) and calculated_at (RFC3339).

§Errors

Returns ProjectionError::GeoJsonError when a required property is missing or has an unexpected type, or when the file is not a valid FeatureCollection.