Regulations external to or within curb Zones #16
Replies: 7 comments 4 replies
-
Comments from the document: Tomas Carranza LADOT Comment: Curb zones are defined as GeoJSON polygons with “regulations” and other metadata embedded into the GeoJSON properties object, including optional LinearReferencing attributes. Keeping curb zones and regulations separated into different objects and endpoints would be better for many reasons - one being the very different life cycles of those objects (i.e., curb zones change rarely, regulations change frequently). Jascha Franklin-Hodge At scale, separating regulations and areas (and referring to regulations by ID in a CurbZone) offers a much cleaner data model. For example, the regulation for a taxi zone may be the same citywide, but embedding the regulation in the CurbZone object requires repeating the same regulation definition over and over again. Jacob Baskin oh that's a very different approach! Where would the time-based config live (i.e., is a regulation ID "this is a taxi zone 9am-5pm and parking otherwise", or is a regulation ID "this is a taxi zone" and then the area is a map from time periods to regulation IDs? I would rather have things go the other way, and have a regulations API that refers to areas by ID... Michael Schnuerle I was thinking regulations API could reference curb API by (one or more) curb IDs, and curb API could reference regulations API by (one or more) regulations IDs. Jacob Baskin We should have the references go one way but not both Jascha Franklin-Hodge Agree that we shouldn't do it both ways. In the MDS Policy API, a rule can reference one or more geographies where it is applicable (essentially the direction you're suggesting, @jacob@coord.co). Would probably argue for consistency in design with Policy, though I'm open to the idea that it's totally overkill for curb zones and we should just implement as originally suggested for now. Jacob Baskin OK that sounds like a plan. Jacob Baskin One wrinkle: if people want to query by location x regulation ("show me all the loading zones in the given bounding box") separating areas from regulations could be problematic Jascha Franklin-Hodge Couldn't we just develop the appropriate query endpoint that returns the matching array of CurbZones? It doesn't seem like there is any data model that will make it easy to implement the full potential set of queries. But backend systems can re-factor the data to support various query schemes. Jacob Baskin Yeah but this breaks separations of concerns between APIs, since it means a single API knows both the regulations and the geometries. So if it knows both, it might as well return both? Neil Goldader I've had similar thoughts in the past regarding endpoint-separation purity, but I think the complexity needs to land somewhere, and it should not be on the backs of the API consumers. Oftentimes, within the backend is the best place to reconstruct the graph of the data model when you have referential entities, because you can do efficient query tricks within the db. Separation of concerns doesn't mean they can't eventually come back together, I think it's reasonably common practice to have high-level endpoints which allow querying across & combination of multiple entities a-la GraphQL. As long as we maintain a pointer in one way (like how MDS Policy refers to geographies), it should be reasonably trivial to derive the relationship in the other direction if needed at query-time! Jacob Baskin Yes I tend to agree with you -- I think the Curb Zone object we have in the doc right now is a decent balance of this, we include regulations but not like every possible event and metric that you might want. Definitely on the side of putting complexity "behind" the API rather than "in front" of it. Neil Goldader I think the things that's tricky is that the Curb Zone object we have now is defining these entities inside of itself, as opposed to being built by them. I suggest that we should define these as fully qualified separate logical entities, that can be joined together by a higher level abstraction. |
Beta Was this translation helpful? Give feedback.
-
If zones are going to be limited to a single block face, I'd support having the regulation separate and referenced since we have so many blocks with the same regulations. If, on the other hand, a zone can encompass multiple blocks, embedding the policy would be simpler. |
Beta Was this translation helpful? Give feedback.
-
+1 to @HenryEspinosa's comments. Just to reiterate that human-readability is important even if it's not the driving factor - we should try to do this when possible. It also seems like less work - both for cities and third parties - if regulations + locations were treated the same way consistently across data standards. Is there a meaningful reason that CDS and MDS should differ in this? |
Beta Was this translation helpful? Give feedback.
-
I think that we should strive to keep MDS & CDS aligned as much as possible, and one key decision that was made in MDS was to split Policy & Geography. While for some views it may be beneficial to see both things in one payload, I think that shouldn't mean that we have CDS only present the 'joined' view. Managing geospatial definitions separate from policy definitions is hugely beneficial in a lot of cases, it enables things such as:
If we go with the approach of having them as separate entities, we can also design an endpoint which serves both simultaneously (because there are obviously some benefits to API consumers in some cases). It's easy to join the two entities together through an additional endpoint, but it's very hard to separate them if they aren't defined as separate entities within the spec. |
Beta Was this translation helpful? Give feedback.
-
My $0.02 - curb zone geometries and regulations have relatively different lifecycles (regulations change more frequently than curb zone geometries), therefore it makes sense to allow curb zones and regulations to be fetched separately. If curb zones and regulations can only be fetched together, CDS may not scale as well with increasing numbers of curb zones, increasing complexity of curb zone geometries, and/or increasing frequency of regulation changes. |
Beta Was this translation helpful? Give feedback.
-
One thing I like about having separate regulation and geometry entities is that it's easy to have a "default" policy that applies in many places. I imagine that in many cities the number of curb policies is an order of magnitude or more less than the number of curb zones, so being able to reference out to them will save tons of space. I'm fine with the idea of putting zones and regulations in the same API response as separate arrays or objects, but do think it's better to have them separate. |
Beta Was this translation helpful? Give feedback.
-
Lacuna feedback doc attached: |
Beta Was this translation helpful? Give feedback.
-
Should regulations details be separated from curb Zones and referenced by a regulation ID (allows defining a regulation and applying that to multiple Zones), or should they just be embedded in the Zone object (reduces complexity and improves readability, but could have more repetitive data with larger file sizes).
Example could be a city that has 30 blocks of Zones that all have the same regulations: it would be easier to specify the regulations once and apply that regulation ID to each zone, making updates easier too. But is this an edge case and worth splitting this out?
Beta Was this translation helpful? Give feedback.
All reactions