I downloaded the nyc osm metro extract from Mapzen. I then used osm2pgrouting to import that data into postgis, pgrouting and now I have all these columns cost and reverse_cost, but I'm not sure how they were computed. I want to do a special form of routing by modifying the cost columns, but first I want to understand how these quantities were computed. Is it based on the length of the streets?

  • Welcome! Please edit your question to include more information. Where did you get the data? What have you done for research? Could you post a sample of your data? Please take the tour here: gis.stackexchange.com/tour
    – MaryBeth
    Commented Jun 13, 2016 at 16:13

1 Answer 1


For osm2pgrouting V2.1:

  • length is length of the segment in degree units
  • cost and reverse_cost is the length in degree units. (include the negative values for wrong way)
  • length_m is in meters (there is no cost_m or reverse_cost_m)
  • cost_s and reverse_cost_s is in time: seconds units (using the maxspeed value that is in km/hr transforming it to meters/second and using the length_m)
  • where did you find what these columns mean?
    – ziggy
    Commented Jun 7, 2022 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.