Skip to content

Simplifying locations.geojson #339

@omar-kabbani

Description

@omar-kabbani

This issue relates to the GTFS-Flex proposal, and is opened following a series of roundtable discussion to resolve the outstanding issues with the proposal. These discussions were hosted by MobilityData and attended by various stakeholders within the GTFS community.

You can find the GTFS-Flex proposal here: https://github.com/MobilityData/gtfs-flex/blob/master/spec/reference.md


The file locations.geojson is based on the geoJSON format defined by RFC 7946.
In the current GTFS-Flex proposal, the file locations.geojson is structured as follows:

  • Type (always set to FeatureCollection)
  • Features
    • type (Always set to Feature)
    • id (Unique ID to describe the location)
    • properties (These properties match how stops are described in stops.txt)
      • stop_name (Text name)
      • stop_desc (Text description)
      • zone_id (In case of Fares v1)
      • stop_url (URL)
    • Geometry
      • Type (Options are: Point, MultiPoint, Linestring, MutiLineString, Polygon, and MultiPolygon)
      • coordinates (Array of coordinates)

It is possible to simplify locations.geojson and to tailor it to GTFS-Flex while remaining compliant with RFC 7946. We propose the following changes:

  • Make the file locations.geojson lighter
    • Remove properties and all fields that fall under it (those will be described in stops.txt)
    • Remove Point, MultiPoint, Linestring, and MutiLineString from the list of options for Geometry.Type since there is no need to define points or lines in locations.geojson
  • Use the file locations.geojson to create the zone (ID and geometry)
  • Use the file stops.txt to associate attributes to the zone (stop_name, stop_desc, zone_id, stop_url, and others)

This means that zones are created in locations.geojson, and then listed with all other stops in stops.txt to associate attributes to the zone (some fields such as stops.stop_lat and stops.stop_lon will be forbidden when a record in stops.txt corresponds to a zone)

The advantages to doing this are:

  1. Stops and zones will be listed in the same file instead of multiple files
  2. Changes to the spec that relate to the attributes of stops and zones will only affect stops.txt (no need to maintain field parity with locations.geojson)

With these changes, the file locations.geojson will be structured as follows:

  • Type (always set to FeatureCollection)
  • Features
    • type (Always set to Feature)
    • id (Unique ID to describe the location)
    • Geometry
      • Type (Polygon, MultiPolygon)
      • coordinates (array of coordinates)

If there is a general consensus on proceeding with this option, we can post a proposal of how to modify the files and fields in stops.txt (and other files like transfers.txt, pathways.txt, levels.txt, and fare_leg_rules.txt) to accommodate GeoJSON locations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    GTFS ScheduleIssues and Pull Requests that focus on GTFS ScheduleGTFS-FlexIssues and Pull Requests that focus on GTFS-Flex ExtensionPull Request CreatedIssues that have been transferred to the Pull Request stage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions