Skip to main content

parse_gnss_geojson

Function parse_gnss_geojson 

Source
pub fn parse_gnss_geojson(
    path: &str,
    crs: &str,
) -> Result<Vec<GnssPosition>, ProjectionError>
Expand description

Parse GNSS positions from GeoJSON file

Expects a FeatureCollection with Point geometries and properties:

  • timestamp: RFC3339 timestamp with timezone
  • Optional: other properties will be stored as metadata

§Arguments

  • path - Path to GeoJSON file
  • crs - Expected CRS of the coordinates (e.g., “EPSG:4326”)

§Returns

Vector of GnssPosition structs

§Example GeoJSON

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [4.3517, 50.8503]
      },
      "properties": {
        "timestamp": "2025-12-09T14:30:00+01:00",
        "vehicle_id": "TRAIN_001"
      }
    }
  ]
}