Comments (11)
E.g the TripsLayer
example 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.
Same number of timestamps as stops, so you could recreate something similar with the transit data
from all-transit.
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.
For the ui, have a small div at the bottom with a slider? Width 90% and max width what?
from all-transit.
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.
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:
- Get
ScheduleStopPair
. Call thatssp
. - For that ssp, find the
RouteStopPattern
it's associated with. - For that ssp, find the
Point
locations of the origin and destination stops - For the origin and destination stops, find the closest point on the
RouteStopPattern
- Keep the
LineString
of theRouteStopPattern
between theorigin
anddestination
coordinate - For each coordinate of the
LineString
betweenorigin
anddestination
, 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.
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.
Look at supermercado burn
supermercado/burntiles.py
from all-transit.
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.
Within each tile, coalesce each schedule stop pair by route stop pattern so that there are fewer individual linestrings?
from all-transit.
Fixed by #18
from all-transit.
Related Issues (20)
- Upload data dumps to S3 too share HOT 1
- Generate data for other time slots
- Client side requests to transit.land
- Incorrect matching of ScheduleStopPairs to route geometry
- Binary tiles HOT 2
- Host basemap of Alaska and Hawaii
- Upload for rest of world HOT 1
- Remove operators with bad geometries
- Only update operators list when filter box is open
- Option to hide stops
- Refactor Mapbox layers
- Put route labels above map labels HOT 1
- Have a ? Popup next to highlight routes by stop
- Check if DC metro uses frequency key in schedules
- Add mobile link preview
- Fix route geometries HOT 1
- Attach route information to schedule data HOT 1
- Include frequency-based schedules
- Remove schedule stop pairs with speed above max speed
- All Transit not updated to Transitland v2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from all-transit.