Python library and research pipeline for the analysis of urban complexity, mobility, and socio-spatial segregation.
This project is part of a broader research initiative that investigates the relationship between urban form, mobility patterns, and segregation through graph theory, information theory, and computational modeling.
The first phase of the project focuses on the implementation and validation of the Trajectory Entropy (ET) metric using a pilot area in Porto Alegre, Brazil.
- Download and process urban street networks from OpenStreetMap.
- Characterize transportation infrastructure.
- Generate and analyze movement trajectories.
- Compute Trajectory Entropy (ET).
- Support future implementations of segregation and complexity indicators.
urban-complexity/
│
├── data/
│ ├── raw/
│ ├── processed/
│ ├── results/
│ └── graph/
│
├── notebooks/
│ ├── 01_download_network.ipynb
│ ├── 02_explore_network.ipynb
│ ├── 03_characterize_network.ipynb
│ └── ...
│
├── src/
│ ├── network.py
│ ├── classification.py
│ ├── visualization.py
│ ├── origins.py
│ └── metrics/
│ ├── entropy.py
│ └── ...
├── config/
│ ├── config.json
│ ├── road_classification.json
│ └── ...
│
├── requirements.txt
├── README.md
├── anotacoes.md
└── .gitignore
Create a virtual environment
python -m venv .venvActivate
.venv\Scripts\activatesource .venv/bin/activateInstall dependencies
pip install -r requirements.txt- OSMnx
- GeoPandas
- NetworkX
- Shapely
- Pandas
- NumPy
- Matplotlib
Additional libraries will be incorporated as the project evolves.
The project is organized as a sequential research pipeline:
- Download street network
- Characterize road infrastructure
- Generate origins (population)
- Generate destinations (amenities)
- Build OD matrix
- Compute routes
- Build trajectories
- Compute urban metrics
- Calculate Trajectory Entropy (ET)
- Visualize and analyze results
Current implementation:
- ✔ Street network download
- ✔ Road classification
- ✔ Network visualization
- ✔ Build origins
In progress:
- Network Cleaning
- Routing
- Trajectory generation
- Trajectory Entropy (ET)
Future work:
- Segregation indicators
- Accessibility analysis
- Agent-Based Modeling
- Machine Learning
- Space-time analysis
The implementation is based on concepts from:
- Shannon (1948)
- Kwan (1998, 2013)
- Netto et al.
- Boeing (2018)
- Network Science
- OSMnx
Research project.
For academic use only.