Zone Behavior
In which rider zones can rides be started?
Rides can be started in any zone where the ride_allowed
rule is set to true
.
In which rider zones can rides be ended?
Rides can be ended in different zones depending on the Region configuration.
Whenever there is designated parking (meaning that the main Region zone has
the station_parking
rule set to true
), rides can only be ended in a Parking
spot with available capacity (this can be obtained via the
/station_information.json
endpoint).
When there is no designated parking, any zone where both the ride_allowed
and
ride_allowed
rules are set to true
allows for ending a ride.
Zone Ordering via Reverse Topological Sorting
To comply with the GBFS priority rule for overlapping zones which states:
In the event of colliding rules within the same polygon, the earlier rule (in order of the JSON file) takes precedence. In the case of overlapping polygons, the combined set of rules associated with the overlapping polygons applies to the union of the polygons. In the event of colliding rules in this set, the earlier rule (in order of the JSON file) also takes precedence.
we use reverse topological sorting when generating the
geofencing_zones.json
file.
This ensures the following:
- Child zones are always listed before their parent zones, so that more specific rules (e.g., local no-ride zones) take precedence over broader, more general rules (e.g., city-level operational areas).
- This ordering aligns with the GBFS spec, which states that the earlier a zone appears in the list, the higher its precedence in overlapping areas.
Ordering Within the Same Level
While reverse topological sorting guarantees that all descendant zones appear before their ancestors, it does not enforce any specific ordering among sibling zones; i.e. zones that reside at the same level of the hierarchy (e.g., children of different subregions ) may appear in any order relative to one another.