Giter Club home page Giter Club logo

osm2streets's Introduction

osm2streets

OpenStreetMap (OSM) has many details about streets, but the schema presents many challenges for rendering, routing, and analyzing done at the detail of lanes, especially in the presence of dual carriageways, separated cycletracks and footways, and complex intersections. osm2streets provides a simplified street network schema, a library transforming OSM data into this representation, and tools to render and work with the results.

Getting started

  1. Open StreetExplorer
  2. Select a test area from the left, then click Reimport
  3. Or navigate to anywhere in the world and press Import current view (change the driving side in Settings first)

Features

  • A schema able to represent:

    • Roads leading between two intersections
      • Thickened line-strings
      • A list of lanes from left-to-right, with: type, direction, width
    • Intersections linking roads
      • Polygon areas, with each road polygon intersecting at a perpendicular angle
      • Planned: turning movements and crosswalks
    • Planned: bike boxes / advanced stop lines, pedestrian crossing islands, modal filters
  • Rendering to GeoJSON

    • Individual lane and intersection polygons
    • Lane markings: lines between lanes, schematic display of turn arrows and access restrictions
  • Transformations to simplify complex OSM situations

    • Collapsing "unnecessary" intersections between 2 roads
    • Merging "sausage links" and dual carriageways into a single road
    • Merging "dog-leg" intersections and other short roads into one logical intersection
    • "Snapping" parallel cycletracks and footways to the main road

There are other planned features:

  • routing (score functions can take advantage of knowing how a cycle lane is segregated from the road)
  • isochrone / walkshed calculations
  • map-matching GPS trajectories to routes
  • tracing the area in between roads ("walking around the block")
  • robustly representing user-created edits to the street network model, even when underlying OSM data is updated

Some of these extra features may sound redundant with libraries like osmnx and existing OSM routers. osm2streets will support these features in a way that uses the lane-level detail and consolidated road representation, is compatible with user-made edits to the network, and can be deployed in a variety of environments (native, web, offline without running an external server).

Users

  • StreetExplorer: a web app to interactively import OSM and explore the osm2streets output
  • A/B Street: a collection of projects to design cities friendlier to walking, cycling, and public transit. osm2streets began life here.
  • Bus Spotting: a bus network GTFS viewer, using osm2streets to snap routes to roads
  • Planned: plugins for iD and JOSM to display streets in detail and visually edit lane tagging

Using osm2streets in your projects

You can use osm2streets today with Leaflet, Mapbox, OpenLayers, or any other web map frameworks. The osm2streets Javascript API can render to GeoJSON.

Since the API isn't stable yet, please get in touch first.

Architecture

osm2streets architecture

The osm2streets library itself (Rust):

  • osm2streets with the schema, transformations, rendering, etc
  • streets_reader to read osm.xml input
  • experimental: an experimental crate for experimenting with implementation details.
  • The logic for calculating lanes for a single road will eventually be owned by osm2lanes

Bindings for other languages:

The StreetExplorer web app (Javascript, CSS using Leaflet):

Contributing

There's many opportunities to help out:

  • writing and improving transformations of street networks
  • adjusting the schema to represent bike boxes, modal filters, lanes that change width, etc
  • designing how to render lane detail
  • integrating the library into your own OSM tool
  • adding test cases for representative situations requiring simplification

Check out the issues.

Further reading

osm2streets's People

Contributors

budgieinwa avatar dabreegster avatar

Watchers

 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.