IDEAS home Printed from https://ideas.repec.org/a/gam/jdataj/v5y2020i1p8-d309637.html
   My bibliography  Save this article

A Python Algorithm for Shortest-Path River Network Distance Calculations Considering River Flow Direction

Author

Listed:
  • Nicolas Cadieux

    (Department of Geography, McGill University, Montreal, QC H3A 0B9, Canada)

  • Margaret Kalacska

    (Department of Geography, McGill University, Montreal, QC H3A 0B9, Canada)

  • Oliver T. Coomes

    (Department of Geography, McGill University, Montreal, QC H3A 0B9, Canada)

  • Mari Tanaka

    (Graduate School of Economics, Hitotsubashi University, Tokyo 186-8601, Japan)

  • Yoshito Takasaki

    (Graduate School of Economics, University of Tokyo, Tokyo 113-0033, Japan)

Abstract

Vector based shortest path analysis in geographic information system (GIS) is well established for road networks. Even though these network algorithms can be applied to river layers, they do not generally consider the direction of flow. This paper presents a Python 3.7 program (upstream_downstream_shortests_path_dijkstra.py) that was specifically developed for river networks. It implements multiple single-source (one to one) weighted Dijkstra shortest path calculations, on a list of provided source and target nodes, and returns the route geometry, the total distance between each source and target node, and the total upstream and downstream distances for each shortest path. The end result is similar to what would be obtained by an “all-pairs” weighted Dijkstra shortest path algorithm. Contrary to an “all-pairs” Dijkstra, the algorithm only operates on the source and target nodes that were specified by the user and not on all of the nodes contained within the graph. For efficiency, only the upper distance matrix is returned (e.g., distance from node A to node B), while the lower distance matrix (e.g., distance from nodes B to A) is not. The program is intended to be used in a multiprocessor environment and relies on Python’s multiprocessing package.

Suggested Citation

  • Nicolas Cadieux & Margaret Kalacska & Oliver T. Coomes & Mari Tanaka & Yoshito Takasaki, 2020. "A Python Algorithm for Shortest-Path River Network Distance Calculations Considering River Flow Direction," Data, MDPI, vol. 5(1), pages 1-14, January.
  • Handle: RePEc:gam:jdataj:v:5:y:2020:i:1:p:8-:d:309637
    as

    Download full text from publisher

    File URL: https://www.mdpi.com/2306-5729/5/1/8/pdf
    Download Restriction: no

    File URL: https://www.mdpi.com/2306-5729/5/1/8/
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Coomes, Oliver T. & Takasaki, Yoshito & Abizaid, Christian & Arroyo-Mora, J. Pablo, 2016. "Environmental and market determinants of economic orientation among rain forest communities: Evidence from a large-scale survey in western Amazonia," Ecological Economics, Elsevier, vol. 129(C), pages 260-271.
    2. Boeing, Geoff, 2017. "OSMnx: New Methods for Acquiring, Constructing, Analyzing, and Visualizing Complex Street Networks," SocArXiv q86sd, Center for Open Science.
    Full references (including those not matched with items on IDEAS)

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Polina Lemenkova, 2022. "Handling Dataset with Geophysical and Geological Variables on the Bolivian Andes by the GMT Scripts," Data, MDPI, vol. 7(6), pages 1-18, June.

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Matteo Böhm & Mirco Nanni & Luca Pappalardo, 2022. "Gross polluters and vehicle emissions reduction," Nature Sustainability, Nature, vol. 5(8), pages 699-707, August.
    2. Lorenzo Barbieri & Roberto D’Autilia & Paola Marrone & Ilaria Montella, 2023. "Graph Representation of the 15-Minute City: A Comparison between Rome, London, and Paris," Sustainability, MDPI, vol. 15(4), pages 1-14, February.
    3. Ospina, Juan P. & Duque, Juan C. & Botero-Fernández, Verónica & Montoya, Alejandro, 2022. "The maximal covering bicycle network design problem," Transportation Research Part A: Policy and Practice, Elsevier, vol. 159(C), pages 222-236.
    4. Brinkley, Catherine & Raj, Subhashni, 2022. "Perfusion and urban thickness: The shape of cities," Land Use Policy, Elsevier, vol. 115(C).
    5. Spencer Leitch & Zhiyuan Wei, 2024. "Improving spatial access to healthcare facilities: an integrated approach with spatial analysis and optimization modeling," Annals of Operations Research, Springer, vol. 341(2), pages 1057-1074, October.
    6. Begazo Curie, Karin & Mertens, Kewan & Vranken, Liesbet, 2021. "Tenure regimes and remoteness: When does forest income reduce poverty and inequality? A case study from the Peruvian Amazon," Forest Policy and Economics, Elsevier, vol. 128(C).
    7. Alves d'Acampora, Bárbara Heliodora & Maraschin, Clarice & Taufemback, Cleiton Guollo, 2023. "Landscape ecology and urban spatial configuration: Exploring a methodological relationship. Application in Pelotas, Brazil," Ecological Modelling, Elsevier, vol. 486(C).
    8. Ali Enes Dingil & Federico Rupi & Joerg Schweizer & Zaneta Stasiskiene & Kasra Aalipour, 2019. "The Role of Culture in Urban Travel Patterns: Quantitative Analyses of Urban Areas Based on Hofstede’s Culture Dimensions," Social Sciences, MDPI, vol. 8(8), pages 1-12, July.
    9. Geoff Boeing, 2020. "Urban Street Network Analysis in a Computational Notebook," REGION, European Regional Science Association, vol. 7, pages 39-51.
    10. Geoff Boeing, 2020. "A multi-scale analysis of 27,000 urban street networks: Every US city, town, urbanized area, and Zillow neighborhood," Environment and Planning B, , vol. 47(4), pages 590-608, May.
    11. Lin, Jie & Cromley, Gordon, 2023. "Using the transportation problem to build a congestion/threshold constrained spatial accessibility model," Journal of Transport Geography, Elsevier, vol. 112(C).
    12. Waddell, Paul & Boeing, Geoff & Gardner, Max & Porter, Emily, 2018. "An Integrated Pipeline Architecture for Modeling Urban Land Use, Travel Demand, and Traffic Assignment," SocArXiv 74zaw, Center for Open Science.
    13. Shang, Wen-Long & Chen, Jinyu & Bi, Huibo & Sui, Yi & Chen, Yanyan & Yu, Haitao, 2021. "Impacts of COVID-19 pandemic on user behaviors and environmental benefits of bike sharing: A big-data analysis," Applied Energy, Elsevier, vol. 285(C).
    14. Geoff Boeing, 2020. "Planarity and street network representation in urban form analysis," Environment and Planning B, , vol. 47(5), pages 855-869, June.
    15. Geoff Boeing & Yougeng Lu & Clemens Pilgram, 2023. "Local inequities in the relative production of and exposure to vehicular air pollution in Los Angeles," Urban Studies, Urban Studies Journal Limited, vol. 60(12), pages 2351-2368, September.
    16. Leonardo Barleta & Mateo Carrillo & Zephyr Frank & Erik Steiner, 2020. "Ejidos, Urbanization, and the Production of Inequality in Formerly Agricultural Lands, Guadalajara, Mexico, 1975–2020," Land, MDPI, vol. 9(12), pages 1-21, December.
    17. Juan C Duque & Nancy Lozano-Gracia & Jorge E Patino & Paula Restrepo, 2022. "Urban form and productivity: What shapes are Latin-American cities?," Environment and Planning B, , vol. 49(1), pages 131-150, January.
    18. Jari Vepsäläinen, 2022. "Energy Demand Analysis and Powertrain Design of a High-Speed Delivery Robot Using Synthetic Driving Cycles," Energies, MDPI, vol. 15(6), pages 1-21, March.
    19. Zhang, Hui & Zhan, Bo & Ouyang, Min, 2024. "Enhancing accessibility through rail transit in congested urban areas: A cross-regional analysis," Journal of Transport Geography, Elsevier, vol. 115(C).
    20. Luxiao Yang & Qizhi Jin & Feng Fu, 2024. "Research on Urban Street Network Structure Based on Spatial Syntax and POI Data," Sustainability, MDPI, vol. 16(5), pages 1-22, February.

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:gam:jdataj:v:5:y:2020:i:1:p:8-:d:309637. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: MDPI Indexing Manager (email available below). General contact details of provider: https://www.mdpi.com .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.