Skip to content
/ osm2rn Public

A simple Python code to extract road network (in Shapefile) from OpenStreetMap (OSM)

License

Notifications You must be signed in to change notification settings

sjruan/osm2rn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OSM2RN

A simple Python code to extract road network (in Shapefile) from OpenStreetMap (OSM).

It serves as a fundamental data for trajectory map matching and other usages.

The generated road network is used for TPTK and DeepMG.

Usage

  1. Download OSM data from Geofabrik in .osm.pbf format.

  2. Clip the data according to your region of interest.

python osm_clip.py --input_path china-latest.osm.pbf --output_path interest_region.osm.pbf --min_lat 39.8451 --min_lng 116.2810 --max_lat 39.9890 --max_lng 116.4684
  1. Construct and store the road network from the clipped data.
python osm_to_rn.py --input_path interest_region.osm.pbf --output_path interest_region

Requirements

OSM2RN uses the following dependencies with Python 3.6

  • networkx==2.3

  • GDAL==2.3.2

  • osmium==2.15.3

Other packages can be easily installed using conda install or pip install, while the following scripts are recommended for gdal.

conda install -c conda-forge gdal==2.3.2

About

A simple Python code to extract road network (in Shapefile) from OpenStreetMap (OSM)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages