Skip to content

[Archived] Routeify Design Proposal

Eddy Ionescu edited this page Jul 8, 2018 · 1 revision

Requirements

Routeify is a library that will be part of Tryn-API. It'll do stuff related to routes.

Given coordinates and a route defined in a geoJSON file: https://github.com/trynmaps/tryn-react/blob/master/src/res/muniRoutes.geo.json

  1. "Snap" coordinates onto a route.
  2. Measure the distance between coordinates along a route.
  3. Sort coordinates based on how close they are along to the route's starting point.
  4. Combine overlapping edges (an edge would be treated as a line), where for any overlap between any two edges, a new edge with the average value of the two is created.

Implementation

Turf.JS - http://turfjs.org https://github.com/Turfjs/turf

TODO - Describe how these functions will be used

  1. http://turfjs.org/Docs#nearestPointOnLine
  2. http://turfjs.org/Docs#lineSlice
  3. http://turfjs.org/Docs#lineSlice and http://turfjs.org/Docs#distance
  4. http://turfjs.org/Docs#lineOverlap

Integration

[TBD] Routeify will be directly required by Tryn-API. Tryn-API's Readme will be updated to specify that Routeify has to be cloned in the same parent directory. It could also live in a folder inside Tryn-API.

Stack

  • Node.JS

Reviewers

(add your name with relevant comments and whether it should move forward)