deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

How does the trip-routes in the examples load data ?

Open jjdblast opened this issue 9 years ago • 7 comments

Dig into this demo and also read the code for a long time, still can't figure out where the taxi route data is and how does this demo load data. Could anyone explain? Thanks!

jjdblast avatar Jan 24 '17 03:01 jjdblast

@Pessimistress @apercu who have worked most on the demo

ibgreen avatar Jan 24 '17 16:01 ibgreen

All credit goes to @Pessimistress, but I think I can tell you the data comes from this file, is requested in this component and the data decoded in the loadData action. Correct me if I'm wrong ;)

balthazar avatar Jan 24 '17 17:01 balthazar

@Apercu Is the script for creating that file anywhere in the repo?

yocontra avatar Jan 24 '17 17:01 yocontra

Don't think so

balthazar avatar Jan 24 '17 17:01 balthazar

@jjdblast the trips data is loaded from this txt and processed with this worker. The extra effort is mostly for optimizing loading speed (compression), and visual flare (create a seamless loop), but has nothing to do with the data format that the TripsLayer consumes. Eventually the data is an array of trips, each trip containing an array of turn points in the form of [longitude, latitude, timestamp]. It's easier to see if you inspect the vis store state on the demo page.

@contra The raw data went through a pipeline of several scripts that perform routing, aggregation, sampling, and then compress with the encoded polyline format. Some of them use private APIs and are tuned for this specific dataset, so I figure there's little reuse value.

Pessimistress avatar Jan 24 '17 21:01 Pessimistress

@Pessimistress If the scripts have private APIs in them it would still be really helpful to see the process - if the routing portion is a private uber thing I can swap in something that uses the mapbox routing API.

yocontra avatar Jan 24 '17 22:01 yocontra

Cool method and thanks for explanations !

jjdblast avatar Jan 26 '17 16:01 jjdblast