Code Monkey home page Code Monkey logo

openstreetmapx.jl's Introduction

OpenStreetMapX.jl

  • Package for spatial analysis, simulation and visualization of Open Street Map data
  • The plotting functionality is provided via a separate package OpenStreetMapXPlot.jl

The goal of this package is to provide a backbone for multi-agent simulation of cities.

The package can parse *.osm and *.pbf (contributed by @blegat) files and generate a LightGraphs representation along the metadata.

Documentation Build Status

Build Status Coverage Status
Linux and macOS

Documentation

Agents travelling within a city

Installation

The current version uses at least Julia 1.5. However older versions will work with 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

In order to plot the maps we recommend two tools:

  • rendering the maps yourself with PyPlot or Plots.jl with backend - use the OpenStreetMapXPlot.jl package
  • rendering the maps with Leaflet.jl - use the Python folium package (examples can be found in the tutorial and the manual)

In order to install all plotting backends please run the commands below:

using Pkg
pkg"add Plots"
pkg"add PyPlot"
pkg"add OpenStreetMapXPlot"
pkg"add Conda"
using Conda
Conda.runconda(`install folium -c conda-forge`)

Usage

using OpenStreetMapX
map_data = get_map_data("/home/ubuntu/mymap.osm");

println("The map contains $(length(map_data.nodes)) nodes")

See the samples directory for a more complete example and have a look at OpenStreetMapXPlot.jl for a route plotting.

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:

  1. Got to the area of your interest at https://www.openstreetmap.org/
  2. Click the "Export" button at the top of the page
  3. Click "Manually select a different area" to select the area of your interest
  4. 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)

Acknowledgments

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 among many others:

  • LightGraphs.jl is 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.jl with GR is used as backend for map vizualization (via a separate package OpenStreetMapXPlot.jl)

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.

openstreetmapx.jl's People

Contributors

arash-dehghan avatar aszczur avatar bartoszpankratz avatar bkamins avatar blegat avatar juliatagbot avatar pszufe avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.