This specification details the purpose, use cases, and schema for Jurisdictions.
While MDS provides a specification for a machine-readable format to describe a geofence in the Geography specification, a plain Geography is not always enough for all use cases. A Geography is a stand-alone object that intentionally has no additional metadata. A Jurisdiction designates a particular Geography as one that describes some region over which an agency has legal authority. For example, the geographical boundaries of a county might form a Jurisdiction of interest for a county transportation agency.
An Agency might have multiple Jurisdictions that fall within its authority. For example, the city of London is divided into multiple boroughs that could each form a Jurisdiction. This would make it easier to see which boroughs are most popular for trips, and enable data isolation by borough.
Jurisdictions can be served by agencies through the following REST API, or via flat-files.
All response fields must use lower_case_with_underscores
.
Responses must set the Content-Type
header, as specified in the Provider versioning section. They must also specify the current API version being served in the JSON-formatted response body, under the version
key.
Response bodies must be a UTF-8
encoded JSON object.
The response to a client request must include a valid HTTP status code defined in the IANA HTTP Status Code Registry
A Jurisdiction optionally contains a reference to a Geography object. This reference may change over time, e.g. if two
When a Jurisdiction is updated, the old version should remain in the back-end for archival purposes.
An individual Jurisdiction
object is defined by the following fields:
Name | Type | Required / Optional | Description |
---|---|---|---|
jurisdiction_id |
UUID | Required | Unique ID of Jurisdiction |
agency_key |
String | Required | A unique string key for the Jurisdiction. Allows for easier management of Jurisdiction-based access control in JWTs. |
agency_name |
String | Optional | Human-readable agency name for display purposes |
description |
String | Required | Description of Jurisdiction. |
geography_id |
UUID | Optional | The unique ID of the geography covered by this Jurisdiction. |
timestamp |
timestamp | Required | Creation or update time of a Jurisdiction. |
Formatted in JSON, a Jurisdiction object should look like this:
{
jurisdiction_id: UUID
agency_key: string
agency_name: string
geography_id: UUID
timestamp: Timestamp
}
Gets all of an agency's Jurisdictions.
Parameters:
Name | Type | R/O | Description |
---|---|---|---|
effective |
Timestamp | O | See the state of all the Jurisdictions (i.e. which ones are effective) at that point in time. If not supplied, the default is to show only Jurisdictions that are currently in effect. |
Response codes:
- 200 - success
- 403 - unauthorized
- 500 - server error
Gets a single Jurisdictions.
Parameters:
Name | Type | R/O | Description |
---|---|---|---|
effective |
Timestamp | O | See the version of the Jurisdiction that was in effect at that point in time. |
Response codes:
- 200 - Success
- 403 - Unauthorized
- 404 - not found
- 500 - Server error
Flat files To use flat files, Jurisdictions shall be represented in the following file:
jurisdictions.json
geographies.json
The publishing Agency should establish and communicate to interested parties how frequently these files should be polled.
The updated
field in the payload wrapper should be set to the time of publishing a revision, so that it is simple to identify a changed file.
{
"version": "0.4.0",
"updated": "1570035222868",
"end_date": "1570035222868",
"Jurisdictions":
[
{
"jurisdiction_id": "240edf69-9f2b-457c-accf-e8156e78811f",
"agency_key": "miami-dade-county",
"agency_name": "County of Miami-Dade",
"geography_id": "e95cb0f7-41eb-4bdd-8b1d-92b0593a7df1"
},
{
"jurisdiction_id": "3c71f367-7c7d-49c7-94d0-21b9e7259c1b",
"agency_key": "miami",
"agency_name": "City of Miami",
"geography_id": "a3ddc3f6-b476-4784-bae7-f0141bb534f6"
},
{
"jurisdiction_id": "9fc51c56-9ac3-497a-b575-07097aa147cb",
"agency_key": "coral-gables",
"agency_name": "City of Coral Gables",
"geography_id": "ad4b47d3-bb49-4122-ad19-5d517490baa6"
}
]
}
See the Geography spec for a sample geographies.json
.