Re: [OSRM-talk] Blocking zones in OSM
Hi Julien, Frederik. We really appreciate your comments. Are very useful guides to plan the first steps of a potential POC. We will definitely report the findings we can get to help others with similar issues and/or ask you for further guidance on this or other topics. Thanks in advance. Alex Valencia On Wed, Aug 26, 2020 at 4:34 AM Frederik Ramm wrote: > Or, what Julien said ;) > > On 26.08.20 10:31, Frederik Ramm wrote: > > Hi, > > > > On 26.08.20 03:29, Alex Valencia wrote: > >> So I was thinking if there is a proper way to achieve this goal. We > >> are considering separating the matrix calculation over the map in a > >> separate function and feeding it with a decorated version of the > >> original map where we can remove these regions on the fly prior to the > >> calculation. But I'm also not sure if this is a realistic way either. > > > > The only routing package I know that does polygonal avoid areas out of > > the box is OpenRouteService which internally is powered by a modified > > version of GraphHopper. However, only the simple route request supports > > avoid areas, not the matrix request, and it's only available if you use > > basic A*. > > > > Using avoid areas with Contraction Hierarchies is impossible unless the > > avoid areas are baked into the graph (i.e. known at graph building > > time). If your avoid areas *are* known at graph building time then > > actually removing edges from the OSM data (or doing so while reading it > > into OSRM) is certainly option that gives you the fastest routing speed. > > > > If you want to use OSRM, and if you want to use dynamic avoid areas, > > then this *might* be possible with a MLD routing graph which has the > > option of changing the weighting of certain edges without re-generating > > the graph; this was implemented to allow for live traffic (search for > > "osrm traffic" and you'll find some stuff about it, using > > osrm-customize). However this still requires you to identify the edges > > you wish to cut off (by giving them a zero rating), and it is only > > possible globally and not on a per-request basis (unlike > > OpenRouteService which lets you set avoid areas per-request). > > > > If you have a number of pre-defined avoid areas and want to determine > > dynamically which of these should be avoided then it might be possible > > to abuse a feature that was built to avoid certain road classes (i.e. > > avoid motorways, avoid ferries); potentially you could use that to > > define a specific road class for all roads in your avoid area A, a > > different class for avoid area B etc., and then make a routing request > > that "avoids class A". This feature is documented here > > https://github.com/Project-OSRM/osrm-backend/issues/4006 > > > > Bye > > Frederik > > > > -- > Frederik Ramm ## eMail frede...@remote.org ## N49°00'09" E008°23'33" > > ___ > OSRM-talk mailing list > OSRM-talk@openstreetmap.org > https://lists.openstreetmap.org/listinfo/osrm-talk > ___ OSRM-talk mailing list OSRM-talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/osrm-talk
Re: [OSRM-talk] Blocking zones in OSM
Or, what Julien said ;) On 26.08.20 10:31, Frederik Ramm wrote: > Hi, > > On 26.08.20 03:29, Alex Valencia wrote: >> So I was thinking if there is a proper way to achieve this goal. We >> are considering separating the matrix calculation over the map in a >> separate function and feeding it with a decorated version of the >> original map where we can remove these regions on the fly prior to the >> calculation. But I'm also not sure if this is a realistic way either. > > The only routing package I know that does polygonal avoid areas out of > the box is OpenRouteService which internally is powered by a modified > version of GraphHopper. However, only the simple route request supports > avoid areas, not the matrix request, and it's only available if you use > basic A*. > > Using avoid areas with Contraction Hierarchies is impossible unless the > avoid areas are baked into the graph (i.e. known at graph building > time). If your avoid areas *are* known at graph building time then > actually removing edges from the OSM data (or doing so while reading it > into OSRM) is certainly option that gives you the fastest routing speed. > > If you want to use OSRM, and if you want to use dynamic avoid areas, > then this *might* be possible with a MLD routing graph which has the > option of changing the weighting of certain edges without re-generating > the graph; this was implemented to allow for live traffic (search for > "osrm traffic" and you'll find some stuff about it, using > osrm-customize). However this still requires you to identify the edges > you wish to cut off (by giving them a zero rating), and it is only > possible globally and not on a per-request basis (unlike > OpenRouteService which lets you set avoid areas per-request). > > If you have a number of pre-defined avoid areas and want to determine > dynamically which of these should be avoided then it might be possible > to abuse a feature that was built to avoid certain road classes (i.e. > avoid motorways, avoid ferries); potentially you could use that to > define a specific road class for all roads in your avoid area A, a > different class for avoid area B etc., and then make a routing request > that "avoids class A". This feature is documented here > https://github.com/Project-OSRM/osrm-backend/issues/4006 > > Bye > Frederik > -- Frederik Ramm ## eMail frede...@remote.org ## N49°00'09" E008°23'33" ___ OSRM-talk mailing list OSRM-talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/osrm-talk
Re: [OSRM-talk] Blocking zones in OSM
Hi, On 26.08.20 03:29, Alex Valencia wrote: > So I was thinking if there is a proper way to achieve this goal. We > are considering separating the matrix calculation over the map in a > separate function and feeding it with a decorated version of the > original map where we can remove these regions on the fly prior to the > calculation. But I'm also not sure if this is a realistic way either. The only routing package I know that does polygonal avoid areas out of the box is OpenRouteService which internally is powered by a modified version of GraphHopper. However, only the simple route request supports avoid areas, not the matrix request, and it's only available if you use basic A*. Using avoid areas with Contraction Hierarchies is impossible unless the avoid areas are baked into the graph (i.e. known at graph building time). If your avoid areas *are* known at graph building time then actually removing edges from the OSM data (or doing so while reading it into OSRM) is certainly option that gives you the fastest routing speed. If you want to use OSRM, and if you want to use dynamic avoid areas, then this *might* be possible with a MLD routing graph which has the option of changing the weighting of certain edges without re-generating the graph; this was implemented to allow for live traffic (search for "osrm traffic" and you'll find some stuff about it, using osrm-customize). However this still requires you to identify the edges you wish to cut off (by giving them a zero rating), and it is only possible globally and not on a per-request basis (unlike OpenRouteService which lets you set avoid areas per-request). If you have a number of pre-defined avoid areas and want to determine dynamically which of these should be avoided then it might be possible to abuse a feature that was built to avoid certain road classes (i.e. avoid motorways, avoid ferries); potentially you could use that to define a specific road class for all roads in your avoid area A, a different class for avoid area B etc., and then make a routing request that "avoids class A". This feature is documented here https://github.com/Project-OSRM/osrm-backend/issues/4006 Bye Frederik -- Frederik Ramm ## eMail frede...@remote.org ## N49°00'09" E008°23'33" ___ OSRM-talk mailing list OSRM-talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/osrm-talk
Re: [OSRM-talk] Blocking zones in OSM
Hi Alex There is probably no easy approach for this in OSRM, because the whole speedup-through-precomputation pipeline is at the opposite of dynamic adjustments. Removing the regions on the fly *per request* does not seem realistic because you'd have to go through the data treatment pipeline again. On the other hand, if the excluded regions are not decided per request but based on the overall situation throughout the day, then you might want to try the MLD pipeline that allow for fast updates to the graph. Another option may be worth a try if the area is small enough **and** the excluded regions can be grouped into a small subset of classes. Then the `exclude` parameter[1] would be a way to turn off some region classes at query-time. Note that having multiple exclude classes will highly impact memory requirements. HTH Julien [1] https://github.com/Project-OSRM/osrm-backend/blob/master/docs/http.md#general-options On 26/08/2020 03:29, Alex Valencia wrote: Hi All!. I'm using OSRM V5 in my company and we are currently thinking how we can work with OSRM ignoring zones in a map in some sort of dynamic way. For example I want my travel time matrix to be calculated without considering some zones in the map modeled as polylines regions. Currently the only way we can think of is to remove those regions directly from OSM, but this is clearly not a very scalable way (especially if the underlying OSM is big). So I was thinking if there is a proper way to achieve this goal. We are considering separating the matrix calculation over the map in a separate function and feeding it with a decorated version of the original map where we can remove these regions on the fly prior to the calculation. But I'm also not sure if this is a realistic way either. Our requirement is to solve VRP instances usually over regions no bigger than a city, for example Mexico City, Your advice would be much appreciated. Thanks. Alex Valencia ___ OSRM-talk mailing list OSRM-talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/osrm-talk ___ OSRM-talk mailing list OSRM-talk@openstreetmap.org https://lists.openstreetmap.org/listinfo/osrm-talk