- Package for spatial analysis, simulation and vizualization of Open Street Map data
- The plotting functionality is provided via a separate package
The goal of this package is to provide a backbone for multi-agent simulation of cities.
Linux and macOS
- STABLE — documentation of the most recently tagged version.
- DEV — documentation of the development version.
- TUTORIAL — A simple tutorial showing routing simulation with OpenStreetMapX along with integration with folium via
The current version uses Julia 1.0
using Pkg; Pkg.add("OpenStreetMapX.jl")
Note that on Linux platform you need to separately install
libexpat used by the library to parse XML (on Windows this step is not required). For example, on Ubuntu run in bash shell:
sudo apt install libexpat-dev
using OpenStreetMapX map_data = get_map_data("/home/ubuntu/mymap.osm"); println("The map contains $(length(map_data.nodes)) nodes")
Obtaining map data
The simplest way to get the map data is to go to the Open Street Map project web page.
In order to obtain the
*.osm file follow the steps below:
- Got to the area of your interest at https://www.openstreetmap.org/
- Click the "Export" button at the top of the page
- Click "Manually select a different area" to select the area of your interest
- Press the "Export" button on the left. Note that sometimes the Export link does not work - in this case click one of the links below the Export button (for example the Overpass API link)
Any pull requests are welcome!
This code is a major re-write of project - available at https://github.com/tedsteiner/OpenStreetMap.jl .
Compared to the original package major changes include:
LightGraphs.jlis used for map data storage
- Several changes with routing algorithm (currently finding a route in a 1 million people city takes around 150ms)
- Added support for using Google Maps API for routing
- Data structure adjustment to make the library more suitable to run simulations of cities.
Plots.jlwith GR is used as backend for map vizualization (via a separate package
The creation of some parts of this source code was partially financed by research project supported by the Ontario Centres of Excellence ("OCE") under Voucher for Innovation and Productivity (VIP) program, OCE Project Number: 30293, project name: "Agent-based simulation modelling of out-of-home advertising viewing opportunity conducted in cooperation with Environics Analytics of Toronto, Canada.