中文 | English
An
- easily configurable
- easily extendable
- easily maintainable
- easily scalable
- robust
parser for OpenStreetMap, for the best experience in data manipulating in OpenStreetMap road network.
- Prerequisite: Install Docker
- Clone the repo
- Under the project folder, run
make up
(the initialization would take a few minutes) - Now the Airflow GUI console is accessible at http://localhost:8080/
- Airflow user name and password is set by default as
airflow:airflow
, this can be changed in thedocker-compose.yaml
- PostgreSQL database user name and password is set as above, this can be changed in the
atlas/config/commons.json
- Airflow user name and password is set by default as
- Also you can use the Airflow REST API or CLI commands to trigger jobs
- Usually you will need to make the Airflow jobs available by
make unpause
, before trigger the first Airflow job - To verify the integrity of Atlas codebase, you can use
make test
Atlas has provided two preset regions in the atlas/config
folder: Bristol, UK (used for automated testing) and Washington, US.
Also, two preset transportation modes, road and pedestrian are provided.
It's very simple to add your own regions and / or transportation modes in Atlas:
- Create your own configuration JSON file in the folder
atlas/config/regions
and / oratlas/config/modes
, - Add your own regions / modes in the
atlas/config/commons.json
, fieldatlas_region_allowed
ortraffic_mode_allowed
, so the new configuration can be found by the Airflow DAGs.
After your region is set up, in the terminal, run
make run step=<step> region=<region>
You can also trigger the job through GUI or REST API.
The output can be found at data/<region>/output
folder, with 3 CSV files:
node
: 2 columns, latitude / longitude coordinate for each node. The column number isnode_id
(start from 0).graph
: 3 columns: head -> tail ofnode_id
, representing each arc of the directed acyclic graph(DAG) for the transportation network, and thetime_cost
(in milliseconds), serving as weight of each arc in the DAG.
First we need to install Python 3.8:
- For Ubuntu users, it's recommended to use
sudo add-apt-repository ppa:deadsnakes/ppa
Then run:
sudo apt-get install python3.8-distutils libsasl2-dev python3.8-dev libldap2-dev libssl-dev
python3.8 -m virtualenv -p python3.8 venv
source venv/bin/activate
pip install -r atlas/requirements-venv.txt
Select venv/bin/python3.8
as the Python interpreter in the bottom-right corner of VSCode window, and voila.
- Automated testing
- Parallel processing
Contributions are absolutely, positively welcome and encouraged! Contributions come in many forms. You could:
- Submit a feature request or bug report as an issue.
- Ask for improved documentation as an issue.
- Comment on issues that require feedback.
- Contribute code via pull requests.
We aim to keep code quality at the highest level. This means that any code you contribute must be:
- Commented: Complex and non-obvious functionality must be properly commented.
- Documented: Public items must have doc comments with examples, if applicable.
- Styled: Your code's style should match the existing and surrounding code style.
- Simple: Your code should accomplish its task as simply and idiomatically as possible.
- Tested: You must write (and pass) convincing tests for any new functionality.
- Focused: Your code should do what it's supposed to and nothing more.
All pull requests are code reviewed and tested by the CI.
Also, during code review, we will follow the ETL design principles:
- Idempotence
- Modularity
- Atomicity
- Change Detection and Increment
- Scalability
- Error Detection and Data Validation
- Recovery and Restartability