You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is already an open issue regarding access handling(#1835) but it seems to be more focused on the FlagEncoder/Weighting perspective. Before we can tackle this, we'd need to figure out how we want to store parsed access restrictions for multiple transportation modes in the graph.
Without this we can't properly express truck routing via a CustomModel.
we'd need to figure out how we want to store parsed access restrictions for multiple transportation modes in the graph.
We already store access flags for each vehicle. Do you need other 'access' values than true/false (like destination, private, etc.), or what do you mean with "parsed access restrictions"?
The more fine-grained logic is only used within the FlagEncoders:
The RoadAccess EV only represents the access for TransportationMode.CAR:
Yes, but which 'RoadAccess' values do you think should exist for which transportation mode? Currently we have YES,NO,DESTINATION,CUSTOMERS,DELIVERY,FORESTRY,AGRICULTURAL,PRIVATE,OTHER.
Do we need all of them for e.g. bike and foot? And should something like CarRoadAccess=YES/NO be equivalent to access$car=true/false? Or should we use an encoded value that just represents the tagged OSM value DESTINATION,CUSTOMERS,DELIVERY,FORESTRY,AGRICULTURAL,PRIVATE and YES/NO should only go into the current access flags? And do we need things like access=delivery, but only for truck? This is were this becomes tricky in my opinion and we need to figure out how to deal (or not deal) with access flags in general.
If we store this per transportation mode, we can get away with only a subset of those values. The RoadAccess stored in the graph could be simplified to YES, AVOID and NO.
e.g for car:
OSM access value
RoadAccess
yes
YES
no
NO
private
NO
permissive
YES
permit
NO
destination
AVOID
agricultural
NO
forestry
NO
delivery
NO
designated
YES
customers
AVOID
discouraged
AVOID
Encoding per transportation mode could also help to improve situations like this one:
maxweight=3
maxweight:conditional=none @ delivery
A custom profile for trucks would currently block this road.
If we store this per transportation mode, we can get away with only a subset of those values. The RoadAccess stored in the graph could be simplified to YES, AVOID and NO.
AVOID is like YES but with preferences which should be customizable. So we can or better should only use true/false IMO.
A custom profile for trucks would currently block this road.
Conditional tags are likely a different beast (?) How would a custom_model look like if you had a separate truck_access? Wouldn't you need a separate max_weight in this case?
@otbutz do you have another real world situation, without conditional tags, where the current approach with road_access is problematic for a custom_model for truck?
Apart from very simple cases like the one above...totally
How would a custom_model look like if you had a separate truck_access? Wouldn't you need a separate max_weight in this case?
Currently the road access is derived from the profile used and thus the type of vehicle/flagencoder. So i need to define and register a truck flagencoder in order to do (customizable) truck routing.
My idea would be to move access handling out of the flagencoders and promote them to first class encoded values. We already have RoadAccess which looks like a general purpose EV but it only handles TransportationMode.CAR and should rather be named CarRoadAccess.
But i'm not sure how to properly combine this with our profile approach. Maybe we could let the user define profiles with a more generic transportationmode(e.g TransporationMode.VEHICLE) and allow him to express truck routing in the custom model by targeting e.g TruckRoadAccess
But i'm not sure how to properly combine this with our profile approach. Maybe we could let the user define profiles with a more generic transportationmode(e.g TransporationMode.VEHICLE) and allow him to express truck routing in the custom model by targeting e.g TruckRoadAccess
A new boolean hgv_access EncodedValue could serve the access (or do we only need car_access and our current hgv?). But what we definitely need and currently cannot configure are the turn restrictions for truck. The OSMTurnRelationParser is already configurable in this regard, but we cannot control this in a server-side profile yet (and would need a java FlagEncoder).
I.e. it would be nice to be able to write something like:
profiles:
- name: truckvehicle: car # or: roadsweighting: customtransportation_mode: hgv # or: restrictions: [hgv, motor_vehicle, vehicle, access]custom_model: # makes use of hgv_access, max_weight, max_height, hgv, ...
The problem is that a truck doesn't necessarily translate to "equal or less" in terms of road access compared to car. If the car profile blocks access to delivery, we can't unblock it at runtime.
This is one of the reasons why I specified roads as alternative to car. But IMO the hgv_access shouldn't include delivery as it is a separate property of road_access.
@otbutz I feel like you did not answer my question yet. You said you want to "store parsed access restrictions for multiple transportation modes in the graph." Would it be sufficient to recognize the edges where access is set to no for each transportation mode, like bicycle/motor_vehicle/hgv/...=no, or do you think it is necessary to store the other access values like private/destination/... also per transportation mode? I wonder if we can get away with storing a boolean yes/no for each transportation mode and additionally store one enum with private/destination/delivery/... that is supposed to work for all vehicles. Or in other words: Are there cases where e.g. a way has bicycle=private,motor_vehicle=delivery, and do we need to care?
@easbar interesting thought. Our current implementation is mostly blacklist based which would fit a BooleanEncodedValue. The more fine-grained handling is only necessary for RoadAccess values which roughly translate to "avoid if possible". I think we can reduce all OSM access values to either transportation mode specific blocks or mode independent penalties.
The question is how many gradations of these penalty values we need.
Does anyone know how or where to write in: private = avoid , if public path exists?
Maybe just he Avoid statement does this?
We are wanting to access private spaces, such as private roads and gated communities , but we don't and to select traveling through these spaces if it is the fasted route and not the origin or destination.
Activity
easbar commentedon Nov 19, 2021
We already store access flags for each vehicle. Do you need other 'access' values than
true/false(like destination, private, etc.), or what do you mean with "parsed access restrictions"?otbutz commentedon Nov 19, 2021
The more fine-grained logic is only used within the FlagEncoders:
graphhopper/core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java
Line 86 in 1e5f4e7
The RoadAccess EV only represents the access for
TransportationMode.CAR:graphhopper/core/src/main/java/com/graphhopper/routing/util/EncodingManager.java
Lines 312 to 315 in 1e5f4e7
easbar commentedon Nov 19, 2021
Yes, but which 'RoadAccess' values do you think should exist for which transportation mode? Currently we have
YES,NO,DESTINATION,CUSTOMERS,DELIVERY,FORESTRY,AGRICULTURAL,PRIVATE,OTHER.Do we need all of them for e.g. bike and foot? And should something like
CarRoadAccess=YES/NObe equivalent toaccess$car=true/false? Or should we use an encoded value that just represents the tagged OSM valueDESTINATION,CUSTOMERS,DELIVERY,FORESTRY,AGRICULTURAL,PRIVATEandYES/NOshould only go into the current access flags? And do we need things likeaccess=delivery, but only for truck? This is were this becomes tricky in my opinion and we need to figure out how to deal (or not deal) with access flags in general.otbutz commentedon Dec 1, 2021
If we store this per transportation mode, we can get away with only a subset of those values. The RoadAccess stored in the graph could be simplified to
YES,AVOIDandNO.e.g for car:
Encoding per transportation mode could also help to improve situations like this one:
A custom profile for trucks would currently block this road.
karussell commentedon Jan 16, 2022
AVOID is like YES but with preferences which should be customizable. So we can or better should only use true/false IMO.
karussell commentedon Mar 3, 2022
Conditional tags are likely a different beast (?) How would a custom_model look like if you had a separate truck_access? Wouldn't you need a separate max_weight in this case?
@otbutz do you have another real world situation, without conditional tags, where the current approach with
road_accessis problematic for a custom_model for truck?otbutz commentedon Mar 3, 2022
Apart from very simple cases like the one above...totally
Currently the road access is derived from the profile used and thus the type of vehicle/flagencoder. So i need to define and register a truck flagencoder in order to do (customizable) truck routing.
My idea would be to move access handling out of the flagencoders and promote them to first class encoded values. We already have
RoadAccesswhich looks like a general purpose EV but it only handlesTransportationMode.CARand should rather be namedCarRoadAccess.But i'm not sure how to properly combine this with our profile approach. Maybe we could let the user define profiles with a more generic transportationmode(e.g
TransporationMode.VEHICLE) and allow him to express truck routing in the custom model by targeting e.gTruckRoadAccesskarussell commentedon Mar 3, 2022
A new boolean hgv_access EncodedValue could serve the access (or do we only need
car_accessand our currenthgv?). But what we definitely need and currently cannot configure are the turn restrictions for truck. The OSMTurnRelationParser is already configurable in this regard, but we cannot control this in a server-side profile yet (and would need a java FlagEncoder).I.e. it would be nice to be able to write something like:
otbutz commentedon Mar 3, 2022
The problem is that a truck doesn't necessarily translate to "equal or less" in terms of road access compared to car. If the car profile blocks access to
delivery, we can't unblock it at runtime.karussell commentedon Mar 3, 2022
This is one of the reasons why I specified
roadsas alternative tocar. But IMO thehgv_accessshouldn't includedeliveryas it is a separate property of road_access.easbar commentedon Mar 5, 2022
@otbutz I feel like you did not answer my question yet. You said you want to "store parsed access restrictions for multiple transportation modes in the graph." Would it be sufficient to recognize the edges where access is set to
nofor each transportation mode, likebicycle/motor_vehicle/hgv/...=no, or do you think it is necessary to store the other access values likeprivate/destination/...also per transportation mode? I wonder if we can get away with storing a booleanyes/nofor each transportation mode and additionally store one enum withprivate/destination/delivery/...that is supposed to work for all vehicles. Or in other words: Are there cases where e.g. a way hasbicycle=private,motor_vehicle=delivery, and do we need to care?otbutz commentedon Mar 7, 2022
@easbar interesting thought. Our current implementation is mostly blacklist based which would fit a BooleanEncodedValue. The more fine-grained handling is only necessary for RoadAccess values which roughly translate to "avoid if possible". I think we can reduce all OSM access values to either transportation mode specific blocks or mode independent penalties.
The question is how many gradations of these penalty values we need.
allow configuring turn costs and TransportationMode for RoadsTagParse…
RSPS_673_Matrix_SBI_Algo (#15)
bcrawford39GT commentedon Sep 20, 2023
Does anyone know how or where to write in: private = avoid , if public path exists?
Maybe just he Avoid statement does this?
We are wanting to access private spaces, such as private roads and gated communities , but we don't and to select traveling through these spaces if it is the fasted route and not the origin or destination.
easbar commentedon Sep 20, 2023
@bcrawford39GT please use our forum for usage related questions.