Madina (Arabic for the word 'city') is a package of classes and functions to streamline the representation and analysis of urban data. The package provide layer management (Similar to layers in CAD/GIS), urban network representation and visualization. The package also includes a python implemetation of the Urban Network Analysis Toolbox (Homepage - User Guide).
More detailed documentation of the package is available here
- Organization of data layers using Geopandas
- Creation of topological (Routable) networks from a geometric representaion. Network is represented using NetworkX
- Insertion of origin and destination poitnts from data layers into topological network
- Creating maps using DeckGL with various streamlined styling options
- Improved implementation of UNA Tools that uses multiprocessing and novel path generation algorithoms to enable effecient betweenness flow simulations on large scale.
- Added functionalities for UNA including percieved distance, elastic trip generation, turn penalties,
- streamlined workflow for pedestrian flow simulation in urban environments.
The package features a streamlined way to model pedestrian activity in urban areas between pairs of pre-specified origins and destinations. This can be done by following these steps:
- Prepare input data files for the network, and each origin and destination. Place all data in a folder called
Cities/city_name/Data
- Fill in the pairing table to specify origin-destination pairs, and specify specific parameters for each pair. Save the filled pairing table in the same
Cities/city_name/Data
folder - run the simulation:
from madina.una.betweenness import betweenness_flow_simulation
betweenness_flow_simulation(
city_name="new_york"
)
- Output would be saved in
Cities/city_name/Simulations
. - More instructions on running a pedestrain flow simulation, preparing data and creating the pairing table are found in the documentation here
First, install geopandas through conda in a new environment
conda create -n madina_env -c conda-forge --strict-channel-priority geopandas
Activate the newly created environment
conda activate madina_env
Install Madina through pip
pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple madina
Detailed instructions are available in the documentation here
Zonal
class: This is the main class that the user interacts with. A user would create a Zonal object, populate it with data layers and calls functions to create a network object within a Zonal object.Network
Class: Created inside a Zonal ovject to represent a network of origins, destinations and 'street' connections. This object is used internally as input to most network algorithms.UNA
Module: A set of functions implementing the UNA functionalities. Each function tales aZonal
object as input.Workflows
module: A set of standarized workdlows that takes a set of structured inpurs. Examples for Pedesstrain flow simulartiob
If you find this package useful in your research, feel free to read and reference this paper (Link).
Bibtex ENTRY PLACEHOLDER