SharedStreets (Python)
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

SharedStreets (Python)

Python implementation of SharedStreets Reference System.


  1. Install from PyPI with Pip.

    pip install sharedstreets
  2. Try downloading a single tile to GeoJSON.

    sharedstreets-get-tile 16 10509 25324 > 16-10509-25324.geojson


  • Retrieve a tile and convert to GeoJSON in Python.

    import sharedstreets.tile
    tile = sharedstreets.tile.get_tile(16, 10508, 25324)
    geojson = sharedstreets.tile.make_geojson(tile)
  • Install optional webserver to serve GeoJSON tiles.

    pip install 'sharedstreets[webserver]'
  • Run a debug webserver and request a tile at /tile/16/10508/25324.geojson.

  • Run a production webserver under Gunicorn.

    gunicorn sharedstreets.webapp:app
  • Install optional Geopandas to use read tabular excerpts of SharedStreets data.

    pip install 'sharedstreets[dataframe]'
  • Read a small area of SharedStreets data into a pair of Geopandas dataframes.

    import sharedstreets.dataframe
    frames = sharedstreets.dataframe.get_bbox(-122.2820, 37.7946, -122.2480, 37.8133)
    geometries, intersections = frames.geometries, frames.intersections


Install for local development.

  1. Clone the SharedStreets-Python git repository and prepare a Python virtual environment running Python 3.

  2. Install the sharedstreets module, keeping it editable, and run test suite.

    pip install --editable .
    python test


Current .proto files can can be found at sharedstreets/sharedstreets-ref-system.

Install protoc and follow Python directions to regenerate sharedstreets/ if necessary:

protoc -I=sharedstreets-ref-system/proto/ \
    --python_out=sharedstreets/ \