https://github.com/arthurdjn/noiseplanet
A Python package for Map Matching and Mapping. Research work for Noise Planet center.
https://github.com/arthurdjn/noiseplanet
geojson geojson-tracks leaflet map-matching mapping osm osmnx
Last synced: about 1 month ago
JSON representation
A Python package for Map Matching and Mapping. Research work for Noise Planet center.
- Host: GitHub
- URL: https://github.com/arthurdjn/noiseplanet
- Owner: arthurdjn
- License: apache-2.0
- Created: 2019-12-30T11:30:02.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-09-29T14:59:36.000Z (over 2 years ago)
- Last Synced: 2025-01-21T02:15:23.746Z (3 months ago)
- Topics: geojson, geojson-tracks, leaflet, map-matching, mapping, osm, osmnx
- Language: HTML
- Homepage: http://noise-planet.org/
- Size: 198 MB
- Stars: 50
- Watchers: 3
- Forks: 13
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# :warning: This package is no longer maintained due to lack of time.
> This package was tested in 2019 and may be deprecated depending on your environment.# noiseplanet
[](http://noiseplanet.readthedocs.io/en/latest/index.html)
[](http://noise-planet.org/)
[](https://arthurdujardin.com/projects/noiseplanet.html)**Python for map matching and mapping geojson tracks**
This library is a project within the research center *UMR-AE/CNRS*, working on NoisePlanet for noise mapping.
Made in collaboration with the *École Nationale des Sciences Géographiques*.**Citation :** Dujardin, A., Mermet, S. (2020). État de l’art et suggestions pour la cartographie des données acoustiques mobiles. *Projet de recherche*.
## Overview
**noiseplanet** is a Python package that lets you extract, correct, and plot geojson data on Leaflet maps.
The main focus of this package is on map matching, and uses Open Street Map network as reference.
The geojson track should contains a list of GPS points that you want to match on the street graph. The only informations used for the map matching are the points coordinates.
OSM network
![]()
The report and poster made for this project can be found [here](pdf/report/PIRRAP_Dujardin_Mermet.pdf) and [here](pdf/report/PIRPOST_Dujardin_Mermet.pdf).
## Installing
### Dependencies
This module use several packages :
- **numpy**,
- **pandas**,
- **json**,
- **osmnx**,
- **leuvenmapmatching**, *KU Leuven - DTAI Research Group, Sirris - Elucidata Group*.To install, clone the repository, and in the *noiseplanet* folder execute the `setup.py` :
```
git clone https://github.com/arthurdjn/noiseplanet
cd noiseplanet
pip install .
```### Optional dependencies
For plotting and interface, the following packages are used :
- **matplotlib**,
- **folium**,
- **sqlite3**.Note that these packages are optional if you don't want to visualize the resulting maps. *SQLite3* is used to stock all the informations of a geojson tracks or polygon into an SQL database.
### Structure
*noiseplanet* is composed by internal sub-packages:
- **matching** lets you correct tracks and match it to the *Open Street Map* network,
- **utils** mainly handles conversion from geojson, metadata etc. to *DataFrame*,
- **ui** is used to generate *Leaflet* maps,
- **io** handles reading and writing files,
- **db** lets you access a *SQLite3* database.## Usage
This project was created to provide new ways of mapping for the *UMR-AE/CNRS* team.
### Map Matching
The **noiseplanet** package provides different tools for matching a track to the *Open Street Map* network.
- matching to the **nearest** edge,
- **hmm** based matching.However, the matching algorithm used within NoisePlanet is taken from **Hidden Markov Models**, as the matching is more precised.
HMM based algorithm used
![]()
To match a track, composed by latitudes and longitudes, use :
```python
import numpy as np
import osmnx as ox
from noiseplanet.matcher import matchingtrack = np.array([[45.7584882 , 4.83585996],
[45.75848068, 4.83586747],
[45.75849549, 4.83585205],
[45.75849134, 4.83584647],
[45.75848135, 4.8358245 ],
# ...
[45.75846756, 4.83580848],
[45.75844998, 4.83580936],
[45.7584067 , 4.83580086],
[45.7584067 , 4.83580086],
[45.75839346, 4.83579883]])graph = matching.model.graph_from_track(track)
track_coor, route_corr, edgeid, stats = matching.match(graph, track, method='hmm')
```And visualize the results :
```python
from noiseplanet.ui.foroute import plot_html# Plot the graph
plot_html(track, track_corr=track_corr, route_corr=route_corr,
proj=True, show_graph=True)
```
![]()
You can change the matching method.
For example, the above method uses **Hidden Markov Models**, and is the best way to match a track on the OSM (see the report for more details).
However, you can use a naive method to match the track on the nearest road :```python
track_coor, route_corr, edgeid, stats = matching.match(graph, track, method='nearest')
```And visualize the results :
```python
from noiseplanet.ui import plot_html# Plot the graph
plot_html(track, track_corr=track_corr, route_corr=route_corr,
proj=True, show_graph=True)
```
![]()
Check the read the docs documentation for more depth in the functions used.
You can also see the report published for this project [here](pdf/report/PIRRAP_Dujardin_Mermet.pdf) : Dujardin, A., Mermet, S. (2020). État de l’art et suggestions pour la cartographie des données acoustiques mobiles. *Projet de recherche*.## Visualization
The map matching algorithm was used to match more than 500.000 tracks from Lyon.
Therefore, the noise can be represented on roads and sidewalks, more relevant at larger scale.
Before : heat map and hexagonal grid
![]()
![]()
After : points and roads
![]()
![]()
## Authors
- **Arthur Dujardin**
- **Samuel Mermet**