Skip to content

LocationMind/GeoDataCompare

Repository files navigation

GeoDataCompare: Visualisation system to compare OpenStreetMap and Overture Maps Foundation data

Main Test
Dev Test
Last commit Test

Overture Maps Foundation (OMF) released its first official release in July 2024, and as its schemas are structured and its data come from different sources, it is interesting to know what one can do with this data. To answer this question, a comparison between it and OpenStreetMap (OSM), probably the most famous Open Source dataset for geoinformation data, has been made.

This project provides Python scripts to download and integrate data into a PostgreSQL database under a common model and assess its quality according to specific criteria, as well as a visualisation system based on Shiny for Python and LonBoard, two Python packages, to compare data with a dashboard.

This project was initially created for an internship at the ENSG-Géomatique school and is maintained by LocationMind Inc..

The information on the command line is provided for Windows users only. It might be necessary to make small changes in the command line if you are a Mac or Linux user, for instance.

Documentation

If you want more information about the data, quality criteria, or how to use the dashboard, you can refer to the user documentation.

If you want to modify a process or the dashboard (especially to add more criteria or other themes), please refer to the developer documentation.

Getting started

Install

Whether it is for installing the dependencies, running the scripts, or the application, it is always assumed that the command line is at the root of the GitHub project. This is important, as some scripts might not work if they are not run from the root of the project.

Also, depending on the OS you are using, you might need to change \ to / or vice versa. It should not be necessary to do so in the Python scripts, only in the command line.

Necessary components

To run the application, it is necessary to have at least these two components:

  • A PostgreSQL database with PostGIS and PgRouting extensions;
  • Python

with these specific versions used for development and testing:

Tool Version
PostgreSQL 16.2
PostGIS 3.4
PgRouting 3.6.0
Python 3.12.3

Requirements

It is strongly recommended to use a Python virtual environment to download the necessary dependencies only within the virtual environment. Here is how you can do this:

Create virtual environment

python -m venv .venv

Activate / Deactivate

.venv\Scripts\activate

.venv\Scripts\deactivate.bat

Upgrade pip version

python.exe -m pip install --upgrade pip

Install dependencies

pip install pip-tools && pip-compile Requirements\requirements.in && pip install -r Requirements\requirements.txt

Database

Create a PostGIS database named pgrouting.

Then, to install the extensions and create the schemas according to the database model, run the init.sql script in your database. This is not a necessary step, as it should be run by the scripts as well, but it prevents errors to do it manually.

To do so, you can run these two commands:

createdb -U postgres pgrouting
psql -U postgres -d pgrouting -f Data\init.sql

After each command, you should have to enter the password associated with the postgres user (usually postgres).

More information about the database can be found in the Database section of the user documentation.

Environment file

You can customise the .env file to configure your connection to the PostGIS database. Initially, the parameter values are:

  • POSTGRES_DATABASE (Name of the database): pgrouting
  • POSTGRES_HOST (IP address of the host): 127.0.0.1
  • POSTGRES_USER (Username): postgres
  • POSTGRES_PASSWORD (Password): postgres
  • POSTGRES_PORT (Port to connect to): 5432

This file is used in all scripts, whether for quality assessment or the dashboard.

Using the scripts

Download data

Use the data_integration.py file to download and integrate OSM and OMF data:

python src\Assessment\data_integration.py

It uses the file containing the bounding box: bboxs.json. Refer to the user documentation for more information on how to add new areas. You will also find information on how to configure the data_integration.py file to force the data download or prevent the bounding box table from being recreated.

Quality assessment

This script needs to be run after the data integration process, but before running the dashboard. It is contained in the quality_assessment.py. To run this script:

python src\Assessment\quality_assessment.py

This script will create layers in the database for the visible ones and also a summary result. The summary result is located in the Results folder of the repository.

Once again, you can refer to the user documentation for more information about this script and how to configure it.

Running the application

Run this command to launch the application:

shiny run .\src\GeoDataCompare\app.py

You can then go to this link: http://127.0.0.1:8000

You can find more information about how to use the application in the Help section directly on the app.

Licenses

OpenStreetMap data is under the Open Data Commons Open Database License, while Overture Maps Foundation licenses depend on the theme. You can find information about Overture Maps Foundation licenses and attributions on this page. The buildings and transportation themes are both under the Open Data Commons Open Database License. Places data from Overture Maps Foundation is under the Community Data License Agreement – Permissive – Version 2.0.

The visualisation platform and this project, in general, are under the MIT License.

Credits

Without other explicit credits, all map data are from OpenStreetMap. The data displayed on these maps are either from OpenStreetMap or from Overture Maps Foundation, depending on the picture. Usually, the type of data (OSM, OMF, or both) is described in the context of the picture.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •