Closed brianellin closed 3 years ago
I have an alternate proposal that goes a little further, an API for Jurisdiction. I will be submitting it in the next week or so.
@brianellin have you had a chance to review the Jurisdiction spec? PR #492
@brianellin Do you think PR #492 addresses your municipal boundary definition concerns?
Moving this to 1.1.0. Let me know if you think this should be in 1.0.0 instead with your #492 PR.
Thanks @karcass and @schnuerle. I've read PR #492 and have a clarifying question:
Is the intention that each jurisdiction implicitly represents a municipality boundary, as referenced in the provider and policy specs? If so, I feel that relationship should be made more explicit.
@brianellin Yes, we'll clarify the wording.
@brianellin It is one of the use cases of jurisdictions that it represents a municipal boundary. More broadly though, various governing agencies that are not necessarily cities (ex In the San Francisco Bay Area, Caltrans, VTA, BART) have jurisdictions that can overlap with municipal boundaries.
@brianngca thanks, that's helpful to know! In that case, how do you know - at a programmatic level, without a human having to read and understand the textual names of each Jurisdiction - which Jurisdiction is a city's municipality boundary and which Jurisdictions aren't? I've read https://github.com/openmobilityfoundation/mobility-data-specification/blob/6c6aac648fbf04e35ee9d9af186bd6050bb781f0/jurisdiction/README.md a few times and don't see this topic directly addressed there, but it's possible that I'm missing something!
@jrheard For the purposes of the spec, the proposal was to just define the boundaries of the agency's jurisdiction, be it a city or another agency. As currently proposed, there isn't a non-human way to identify if the jurisdiction is specifically that of a city. I suppose the introduction of an agency_type
could be a solution (off the top of my head).
The end use cases we were thinking about were: a person granting permissions to others/systems for data access; or for an analyst who needs to cut data by the view of the agency.
Happy to get your take on programmatic use case that need to be supported!
Cool, that makes sense, thanks again for that clarification. It sounds to me like the Jurisdiction API wouldn't actually be a direct solution to this particular github issue (although perhaps it is and I just haven't been able to figure out how to connect the dots!)
An example programmatic use case that comes to mind is one where you want to write a program that consumes an operator's MDS Provider feed for Exampletown, and you also have access to Exampletown's Geographies API, and you want to be able to write some code that automatically detects/filters any status changes that a) appear in the operator's feed, but b) aren't located within Exampletown's municipality boundary, eg because the feed might mistakenly contain data from two adjacent cities.
Right now it's certainly possible to implement this program, but only with human intervention - you need a human being to look through Exampletown's set of published Geographies, figure out which one actually represents the Exampletown municipality boundary, and amend your program to use that specific Geography.
This is just a single contrived example, but as @brianellin points out in the issue description, the MDS spec refers to the concept of the "municipality boundary" in various places, and so I think that it would be a good idea for the spec to clearly represent this concept at a level that can be understood by code.
Here are a couple of ideas that have come to mind:
"municipality_boundary": true
in its properties
sectionmunicipality_boundary: a_geography_id
key/value pairI don't really like the first idea; IMO it would be very easy for a buggy /geographies implementation to return a list where zero or multiple Geographies have that key/value pair. The second idea seems workable to me, though!
I've put together a PR for that second approach, and would be curious to hear what the community thinks of it: https://github.com/openmobilityfoundation/mobility-data-specification/pull/545
Alternatively, is there some third approach that people would prefer?
Thanks for writing out the use case @jrheard. That makes sense.
Thinking more broadly, what if we thought about this as a type
of agency. That could be represented in the jurisdictions API. I like the idea of keeping /geographies relatively agnostic so that many services could easily use it. Wondering what you think of this approach?
Types of jurisdictions could potentially include:
city_boundary
MPO
transportation_agency
etc.
Note that with the merged PR #582 the new Geography API is now available in the 'dev' branch. Please take a look and see how it may impact this Issue.
@brianngca Does the new Jurisdiction proposal and the geography API solve for this issue now?
Jurisdictions should cover this as a solution. While it's in beta we can figure out what may need to change and create a new issue then. Thanks!
Is your feature request related to a problem? Please describe.
Several parts of MDS depend on a precise definition of the municipality boundary, however the spec doesn't offer guidance on where exactly to define or discover this important geography.
Here's the current language from the provider spec:
This can lead to inefficiencies and confusion when communicating the boundary details from agencies to providers and vice-versa. Additionally, the Policy spec states that:
For both those reasons, formalizing the discovery of the municipality boundary seems desirable.
Describe the solution you'd like
Since the MDS Policy API already does the job of communicating important geography definitions from agencies to providers, that seems like a natural home for the municipality boundary.
Below is a proposal to represent the boundary within the existing
/geographies
REST endpoint andgeographies.json
flat file:An alternate approach might be to include the
municipality_boundary
in thegeographies
dictionary directly. Would welcome other ideas/suggestions for how to formally define.Is this a breaking change
Impacted Spec
For which spec is this feature being requested?
policy
Describe alternatives you've considered
n/a
Additional context
n/a