-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Policy-Driven Trip Events #480
Comments
Discussed during WG call:
|
At the City of Austin, we have been hesitant to adopt the policy API because of the required exchange of telemetry data. This approach would provide a needed and welcome alternative. I'm offering our strong support for this change. |
I like this idea! The draft of the PR for #271 is ready for an initial review too: lacuna-tech#7 I still need to update the lacuna-tech repo to be based off 0.4.1 instead of 0.4.0. |
Mentioned on the call for further discussion:
Also note this should be flagged as beta for a release so everyone can try it out. |
I think we would want to be careful about how we declare which geographies would apply. I would want to limit it to e.g. "Geography objects described by in-effect-at-that-moment Policy and Jurisdiction documents". Like, you don't scrape /geography for all of them. |
@Karcass I think that's a good idea. I could see the Geometries gaining a boolean field (default false) that indicates whether entry/leaving events should be emitted. I could also see this being a field on a Policy, but that might make it less flexible and wouldn't cover the jurisdiction case. This proposal is using Geometries in a really new way so it might be a good lens to use in thinking about how Geographies, Policy and Jurisdictions inter-relate. |
@schnuerle I believe the PR addresses multiple areas. As for what to do for quick pings in a geometry or due to GPS bounce, that might warrant a larger discussion at a higher level. I can see that being an issue for existing jurisdiction events (though this PR might make them more common), and of course GPS inaccuracy is going to be an issue for any realtime event-driven system (ie agency). |
In general this makes a lot of sense as a way to track vehicles moving into and out of jurisdictions. The mental model of saying "These events are sent for any geography that currently has a policy related to fleet count" feels very sensible here. For overlapping I think it's simplest to send the geographies as an array, there are many examples where geographies may overlap, for example if the city has an overall vehicle cap, and then minimum distribution requirements. This does introduce an extra degree of freedom, in that if a provider's geographies are out of date or they have an issue with their geospatial querying it could make their data inaccurate. This isn't a reason not to do it, but something to consider in the design. |
Here some notes on using location for determining if a vehicle is in a certain area as we work with them at Spin. Background info: Things to consider regarding GPS receivers
Thus, determination via GPS if a vehicle is in a certain area is not exact science. How can this be improved?
|
I think that there are a few problems that could arise from this, most of which have already been mentioned by others. It may not be necessary to create new events simply to indicate that a vehicle is within a particular geography. The main purpose of spatially-defined events as they are today is simply to indicate when a vehicle has left a regulating entity's boundaries while operating in the PROW (for micromobility, this should logically only occur during a trip). With the new Jurisdictions API, these boundaries are clearly defined. While technically Jurisdictions have their geospatial boundaries defined by a Geography, I think it's a mixture of concerns to try and generalize the enter/leave events to being on a per-Geography basis; anecdotally, having done a lot of work on analyzing data consumed by Agency (particularly around computing Compliance for Policy, which is essentially what this issue is trying to solve), I don't think that it is necessary to create new events for general Geography crossing. My counter proposal, (building off of @bhandzo's comment) would be that there is the option (depending on a city's SLAs, of course) to provide a My proposal, however, does not satisfy the concern that has also been brought up around keeping Providers' definitions of Geography in sync with the Agency's published definitions. These could perhaps be resolved with a set cadence upon when new Geographies/Policies/Jurisdictions should be published (daily, hourly, ...), however there has been interest in having highly dynamic Policies/Geographies for being able to block off streets in the case of natural disasters, immediate closures due to criminal activity, etc. Something which has not been tackled sufficiently in my opinion, though, is a fundamental concept behind Agency: how we can build a truly bidirectional interface. I think that this proposal (applicable to the original proposal as well as my counter proposal) is a perfect example of why having just RESTful APIs is not necessarily sufficient, and we may need to look at something like long polling, websockets, etc... |
A question for city planners, including @schnuerle. In addition to origin-destination location obfuscated to geography, it seems to me that the routes chosen would be helpful in planning slow streets, crossings, special purpose lanes etc. Is the assumption, that street design is done by planners using other information, not MDS trip data? Or is the idea behind this proposal that geographies may be defined in a way to understand street usage? |
@sanjivnanda I don't want to speak for city planners, but I wanted to clarify our intentions for this proposal. The aim of Policy Driven Events is to deliver a way to meet compliance monitoring needs without precise location data. There are a raft of other use cases related to city planning, program evaluation, etc which this proposal intentionally doesn't address. For those use cases, we're imagining cities would turn to a different MDS capability such as the trips endpoint or the upcoming Metrics endpoint (see in particular #556). |
Quick update on this issue since it has been a while. We're working to get a PR ready for it and you can find the most recent change set here: One important note: we've expanded Policy Driven Events to cover events for parked vehicles. This is in recognition of the fact that parking events constitute trip endpoints, and the endpoints of a trip are often more sensitive than the actual route followed. One consideration could be to have provider and agency drop off events continue to provide precise location data, since these events do not reveal trip data and may be of interest for compliance. |
This also came up in #503. I'd like to propose an effort in the future to add the richness of telemetry data to endpoints throughout Provider. |
Is your feature request related to a problem? Please describe.
Cities want to be able to perform Policy compliance monitoring (both real-time and historical) for vehicles in motion. Currently, it is not possible to meet this need without requiring precise trip location data.
Describe the solution you'd like
The idea is that vehicles would emit events whenever they enter or leave a geography defined in the Policy endpoint. Then, instead of sharing the exact vehicle location, these events would simply give the UUID for the geography. This would be accomplished via the following changes:
Rename events for entering and leaving municipal areas so they apply to all Policy geographies.
enter_municipal_area
⇒enter_geography
leave_municipal_area
⇒leave_geography
Add the geography information to the event.
event_geography
field containing the geography UUID toProvider
. This field is required ifevent_location
is not present.event_geography
field containing the geography UUID toAgency
. This field is required iftelemetry
is not present.Remove requirement for precise location data for vehicles during trips.
event_location
in Provider optional in the case ofvehicle_state:in_use
eventstelemetry
in agency optional in the case ofvehicle_state:in_use
eventsIs this a breaking change
Impacted Spec
For which spec is this feature being requested?
agency
provider
Describe alternatives you've considered
None at this time.
Additional context
Note that this proposal assumes/builds on the already proposed changes that unify and simplify Policy and Agency events:
#271
This issue is also related to a proposal to unify the way municipal boundaries and Policy geometries are expressed:
#474
The text was updated successfully, but these errors were encountered: