Giter Site home page Giter Site logo

Transit schedules about all-transit HOT 11 CLOSED

kylebarron avatar kylebarron commented on September 26, 2024
Transit schedules

from all-transit.

Comments (11)

kylebarron avatar kylebarron commented on September 26, 2024

E.g the TripsLayerexample data looks like:

  {
    "vendor": 0,
    "path": [
      [-74.20986, 40.81773],
      [-74.20987, 40.81765],
      [-74.20998, 40.81746],
      [-74.21062, 40.81682],
      [-74.21002, 40.81644],
      [-74.21084, 40.81536],
      [-74.21142, 40.8146],
      [-74.20965, 40.81354],
      [-74.21166, 40.81158],
      [-74.21247, 40.81073],
      [-74.21294, 40.81019],
      [-74.21302, 40.81009],
      [-74.21055, 40.80768],
      [-74.20995, 40.80714],
      [-74.20674, 40.80398],
      [-74.20659, 40.80382],
      [-74.20634, 40.80352],
      [-74.20466, 40.80157]],
    "timestamps": [ 1191, 1193.803, 1205.321, 1249.883, 1277.923, 1333.85, 1373.257, 1451.769, 1527.939, 1560.114, 1579.966, 1583.555, 1660.904, 1678.797, 1779.882, 1784.858, 1793.853, 1868.948]
  }

from all-transit.

kylebarron avatar kylebarron commented on September 26, 2024

Same number of timestamps as stops, so you could recreate something similar with the transit data

from all-transit.

kylebarron avatar kylebarron commented on September 26, 2024

Keep everything in local time? I think the source data in the transit land schedule is local time with time zone included. So instead of dealing with time zones, just keep everything local

from all-transit.

kylebarron avatar kylebarron commented on September 26, 2024

For the ui, have a small div at the bottom with a slider? Width 90% and max width what?

from all-transit.

kylebarron avatar kylebarron commented on September 26, 2024

Have schedule data in a separate set of tiles, then load schedule data in a TileLayer, where each tile renders a sub layer that is a TripsLayer?

from all-transit.

kylebarron avatar kylebarron commented on September 26, 2024

I'm thinking of having the TripsLayer use data from every ScheduleStopPair...

So if I get ScheduleStopPairs...

There's an n:1 correspondence from ScheduleStopPairs to RouteStopPatterns, but luckily it looks like n:1, not n:n, since every ScheduleStopPair apparently only has one route_stop_pattern_onestop_id it's attached to.

But note that you can't just get the origin and destination stop onestop_id from the ScheduleStopPair, since then you'll have a straight line from origin to destination. But also you can't directly use only the RouteStopPatterns, because that doesn't include where along the route the stops are. And also you can't assume the stop location is one of the RouteStopPatterns coordinates, because of line simplification.

So I think the process to get geometric ScheduleStopPairs is:

  1. Get ScheduleStopPair. Call that ssp.
  2. For that ssp, find the RouteStopPattern it's associated with.
  3. For that ssp, find the Point locations of the origin and destination stops
  4. For the origin and destination stops, find the closest point on the RouteStopPattern
  5. Keep the LineString of the RouteStopPattern between the origin and destination coordinate
  6. For each coordinate of the LineString between origin and destination, linearly interpolate the timestamp between the origin timestamp and destination timestamp. Shouldn't have to simplify more because the geometry should already be simplified from transitland.

Now you have data ready for the TripsLayer for every ScheduleStopPair

from all-transit.

kylebarron avatar kylebarron commented on September 26, 2024

Figure out how to get a collection of ordered points with timestamps on the points

Well if you're sticking with tiled geojson, then just put the timestamps as the third value of the geojson

If you get all the line segments that intersect a given box, then there will be segments with one end outside of the box. So you can find segments that intersect, then find segments fully contained. And the segments that are not fully contained you can interpolate to cut at the edge of the box.

I think you did this when you were figuring out using vector tiles in deckgl?

from all-transit.

kylebarron avatar kylebarron commented on September 26, 2024

Look at supermercado burn

supermercado/burntiles.py

from all-transit.

kylebarron avatar kylebarron commented on September 26, 2024

Just use mercantile directly. Try to traverse the tree, I.e should be easy to find tiles at zoom ~8 with no routes, so don't check the children of that tile.

Or even better, start with the tile that encompasses the whole us, it must intersect, then take each of its children, check if each of them intersect, and so on, up to the desired zoom level. Since in this stage you're only searching if any route intersects, should be relatively fast. Once you get to the minzoom level, then it'll be slower to clip geojsons.

Would be nice to have a separate reusable function that clips linestrings by a bounding box (any geometry?) while adding interpolated points on the boundary.

from all-transit.

kylebarron avatar kylebarron commented on September 26, 2024

Within each tile, coalesce each schedule stop pair by route stop pattern so that there are fewer individual linestrings?

from all-transit.

kylebarron avatar kylebarron commented on September 26, 2024

Fixed by #18

from all-transit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.