Skip to content

Repository files navigation

Repository for the generation of multitemporal multifactor route models (M2PRM)

The generation of M2PRM requires several steps:

  1. Generation of cost surface.
  2. Generation of cost distance rasters from user-defined points using the knights move algorithm.
  3. Generation of corridors using the previously generated cost distance rasters.
  4. Normalisation of the corridors.
  5. Raster cells stats to join all normalised corridors.

While a Jupyter Notebook with the full algorithm is provided (the requirements file can be used to set up the environment), GEE JavaScript code with a GUI is also provided for those who prefer to use GEE web-based code editor. The GEE code allows the exploration and visualisation of factors and their cost values. Just copy the GEE code, paste it into the code editor and press run.

Setting up the environment

Create and activate an env using the provided YAML file:

conda env create -f environment_m2prm.yml  # Creates the environemt and installs the pinned packages
conda activate m2prm  # Activates the environment
python -m ipykernel install --user --name m2prm --display-name "m2prm"  # Optional: registers your current Python environment as a selectable Jupyter kernel. No need to use if you are going to lauch Jupyter from m2prm environment (the YAML file installs jupyterlab) <br>

Alternatively, if you prefer to use the provided requirements pip file instead of conda pins, install only the heavy libs with conda, then pip the pinned set (helps when pip wheels struggle with GDAL/PROJ).

conda create -n m2prm -c conda-forge python=3.10 -y  # Creates the environemt (with a supported Python 3.10, which is safe for NumPy 1.26.x) and installs the pinned packages
conda activate m2prm  # Activates the environemt
conda install -c conda-forge python=3.10 rasterio gdal -y  # Installs the pinned packages
pip install -r /mnt/data/requirements_m2prm.txt
python -m ipykernel install --user --name m2prm --display-name "m2prm"  # Register the kernel in Jupyter (optional, see above)

For the generation of cost surfaces

The user needs to have a working Google Earth Engine (GEE) account.

The generation of cost surfaces requires two external datasets:

  1. Maps of areas with loose sand surfaces (i.e. dunes). This is not generated by the notebook code as it requires a Machine Learning multi-sensor approach that would have required too much memory for GEE to be able to produce it along the rest of the code. Therefore, loose sand maps have been produced independently and called within the main cost surface generation script.

    Consequently, the notebook calls the resulting maps from the author's GEE asset repository. The GEE code for the generation of these maps has also been provided for reproducibility reasons, but it is not required to run the Jupyter notebook or the GEE JavaScript code for the generation of cost surfaces.

    Two loose sand surface maps have been provided in order to cover large areas susceptible to past mobility studies:

    • A map covering large parts of South Asia. To call this map within the code use: users/hao23/looseSand_SA

      Loose sand map covering large parts of South Asia
    • A map covering the territories of the Roman Empire. To call this map within the code use: users/hao23/looseSand_RE

      Loose sand map covering the territories of the Roman Empire
  2. The Global Reservoir and Dam Database (GRanD), which can be downloaded at https://www.globaldamwatch.org/directory

    Please note that GRanD has now been superseded by the GDW v1 consensus global database.

    In order to use the database, download it from the provided link and upload it to your GEE assets repository. Then substitute the name of the asset in the code: line 185 of the Cost Surface generation cell in the notebook, and line 134 in the optional GEE code provided.

For the generation of corridors

GRASS GIS needs to be installed locally and its grass.bin directory provided within the notebook code.
The code has been tested with GRASS GIS 8.3 and 8.4
Follow the instructions provided within the Jupyter notebook.

Acknowledgements

Toby C. Wilkinson worked in collaboration with the author in the development of the method. Cameron A. Petrie provided insights and encouragement during the last 8 years, which eventually led to the development of this algorithm. Friederike K. Jürcke proposed the use of the GRanD database to reduce the effects of modern dams and reservoirs. Andrew McLean contributed to improve the snow and desert costs. The Spanish Ministry of Science, Innovation and Universities funded this research with grant ref. PID2023-152402NB-I00 for the project MOVIMIENTO A GRAN ESCALA Y EL ORIGEN DE LAS SOCIEDADES URBANAS (OneWorld).

About

Jupyter notebook and GEE code to produce multitemporal multifactor cost surfaces for the generations of transcontinental movement corridor networks

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages