Search code examples
pythongpsgisnetworkxosmnx

Using Real-Time Data to Dynamically Adjust Edge "costs" in OSMnx?


My question is largely summarized in the title. I'm wondering if it's possible to weight the specific "edges" of a network by using real-time data feeds in an effort to create a more accurate "time to destination" estimate. If not with OSMnx, how would you suggest doing this?


Solution

  • I'm wondering if it's possible to weight the specific "edges" of a network by using real-time data feeds

    Yes. You'll want to update the edge weights (e.g., length, or travel_time, or your own concoction) by setting those edge attributes. You can do this whenever you like, and then (re-)calculate shortest paths using that weight attribute accordingly.