Closed billdirks closed 4 years ago
v4.4.0 implements an optional "version" setting that can be set per provider. Setting to "0.3" will use the MDS 0.3 request headers and parameters when performing queries. Leaving version blank will fall back to 0.2 request structure. See docs and changelog for more details.
It would be great to be able to associated an provider in the configuration file with a MDS version number. Examples where this would matter:
Currently, if one uses
mds.js
to download data, there is an implicit assumption that the provider serves MDS 0.2.x. That ismds.js
does not provide a version header, which by default requests version 0.2.X (see https://github.com/CityOfLosAngeles/mobility-data-specification/tree/dev/provider#versioning). Also there is an assumption that the start/end times provided to the API are in seconds. In MDS 0.2.X these times are in float seconds but in 0.3.X this changed to int milliseconds.Currently if one uses
local.js
to import locally downloaded data, there is an implicit assumption that the time in the local files is in milliseconds (for example:change.event_time = change.event_time / 1000;
)So the benefits to specifying the MDS versions are:
1) Sending the correct request headers 2) Having the right units when filtering change/trips data.
This would be really helpful when there is more than 1 provider in a city each supporting different MDS versions.