sharedstreets/mobility-metrics

Map visualizations over an arbitrary date range

Closed this issue · 2 comments

We've spoken to cities who are interested in the generated maps (Trip Volumes, Flow, Availability, etc) for longer term planning objectives. Currently the maps are generated for a days worth of data at a time. For the planning use case, it would be great if the data could be visualized over an arbitrary number of days. This would allow it to produce maps for the length of pilot program, a month, or some other time interval of interest.

One workaround for the time being (please correct me if there is an issue with this approach) is to run the mobility-metrics aggregator for each day in the interval of interest with the privacyMinimum set to 0, combine the data, and then apply a privacy minimum.

I've been working through the refactor design issues on this ticket and have made some progress. My proposal is the following:

  • add a --days flag that lets mobility-metrics know how many days of data to include before the specified report day (--day)
  • add date range to the top of the report
  • go back to one summary per report with the summary covering whatever the specified date range happens to be (currently there is a 1 day, 7 days, and 30 days summary)
  • For maps, use all data within the query range and modify the format to eliminate the day keys; hours and minutes bins will group data across days

I'm still working on a PR for this, so let me know if there are objections or other ideas for how this should be designed. I will have a testable branch out early next week.

Addressed in v4.0 release. I changed the initial designs here a bit. The --day flag was deprecated in favor of:

  • startDay
    • first day of aggregation window
  • endDay
    • last day of aggregation window
  • reportDay
    • date used for listing the report; created date

Additionally, you can now add a "lost" property to your config specifying a number of days before a vehicle is considered lost in action, so that it will no longer affect availability or onstreet metrics after going silent. The raw data cache will use the lost property to pull data from before your aggregation window, but this data will not factor into metrics, other than detecting deployed vehicles. Defaults to 2 days.