I want to make custom router which while calculating route costs, would take into account additional features.
Here is the use case: Lets imagine paid motorway. Lets suppose there are 2 toll points. When router calculates route, it should, depending on user settings, find another way avoiding toll points, or inform user that his route crosses toll points here and here..
My first idea was to extend EdgeRouter2 class and override calcEdgeCost function, where I could check for given edge id in database and see if it contains toll points and act accordingly, but I want to be able to update my map and it looks like binding toll points table with edges cannot be done reliably neither by segment id nor osm_id (Is OSM_ID also part of osm2po graph?). Now I think it would be better to store toll points using lat,lon coordinates, calculate where those points are road network, and split edges at the given points.
Does this new approach make sense? What osm2po's classes should I use to accomplish this? I have a gut feeling that in this case using DefaultRouter2 instead of EdgeRouter2 would be better as it looks like it's more vertex centric - it doesn't have calcEdgeCost but it has (private) calcVertexCost function..