Could someone share with me some ideas or your experience how to estimate travelling time based on the provided route within pgRouting? The problem is that roads inside and outside cities have the same type (for example "highway=primary") but different max speed allowed. But this max speed attribute is not always set in real OSM data. The only possible solution I see at the moment is to preprocess all roads before calculations and set for each some expected speed. For example, if "highway=primary" and it's inside the city then expected speed is 40km/h, if it's outside then expected speed = 90 km/h. But how to detect that the road is inside some city bounds or not? Any ideas are welcomed!
I don't think you can do this very reliably, since OSM is inherently subject to personal opinion (or at least, local practice).
However I think you could just assume that the expected speed is fixed irrespective of whether you are in a city or not (i.e. just on the highway attribute), if you don't have a more specific detail. Of course, the speed limit might be 60 or 100, but that will be because of the road, not because its in a particular place - could be a bad road out in the country, could be a motorway that goes through a city.
You could do some postgis magic (ST_Within / ST_Contains) if you had city boundaries, and really want to finess it, but I don't think it will really help that much.