kuanb / peartree

peartree: A library for converting transit data into a directed graph for sketch network analysis.
MIT License
201 stars 23 forks source link

Documentation on ideal reference geojson format for using load_synthetic_network_as_graph? #74

Closed yiyange closed 5 years ago

yiyange commented 6 years ago
# ideal reference geojson format

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "headway": # float, mandatory
        "average_speed": # float, mandatory
        "bidirectional": # boolean, optional
        "stops": # [[x, y], [x, y], ...], optional if `stop_distance_distribution` provided, if provided, take precedence over below
        "stop_distance_distribution": # int, optional if stops provided
       },
      "geometry": {
        "type": "LineString",
        "coordinates": [
          [
            -122.38752365112305,
            37.766915240907736
          ],
          [
            -122.36692428588866,
            37.77600657051945
          ],
          [
            -122.34495162963867,
            37.79554236136536
          ],
          [
            -122.31388092041016,
            37.80286695148153
          ],
          [
            -122.29087829589844,
            37.80286695148153
          ]
        ]
      }
    }
  ]
}
kuanb commented 6 years ago

Broadly, I need to have better documentation to make this tool usable by the general public.

kuanb commented 6 years ago

Here's an example of a correctly formatter "transit JSON:"

{
  "features": [
    {
      "geometry": {
        "coordinates": [
          [
            -82.9988153331223,
            39.9528412292933
          ],
          [
            -82.9937382953071,
            39.9526748544574
          ],
          [
            -82.9340531383986,
            39.8297989047484
          ]
        ],
        "type": "LineString"
      },
      "properties": {
        "average_speed": 16,
        "headway": 600,
        "stops": [
          [
            -82.98288446172978,
            39.94641436183575
          ],
          [
            -82.9336011348894,
            39.83735937084766
          ]
        ]
      },
      "type": "Feature"
    }
  ],
  "type": "FeatureCollection"
}