Skip to content

Quickly generate maps of road networks coloured by words in road names

License

Notifications You must be signed in to change notification settings

timfernando/osmnx-color-roads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

osmnx-color-roads

Quickly generate maps of road networks coloured by words in road names

What it does

  • Gets the OSM graph for a given place
  • Finds the most common words used in the graph
  • Generates a colour scheme based on the common words
  • Tries to ensure that the most common words have visually distinct colours
  • Allows for stop words (TODO: Improve this system)
  • Allows for a single line query to generate a map and allows for osmnx optional parameters, e.g. dpi, etc.

Installation

osmnx-color-roads requires osmnx which has a long list of dependencies. The fastest way to get started is to use conda to manage your Python environment and dependencies for osmnx.

  1. Install conda
  2. Setup osmnx with conda
    conda config --prepend channels conda-forge
    conda create -n ox --strict-channel-priority osmnx
    
  3. conda activate ox
  4. Download a copy of osmnx_color_roads.py from this repo
  5. Run your python program that imports osmnx_color_roads

Warning: conda will clash with Pyenv - this StackOverflow can help

Example usage:

from  osmnx_color_roads import generate_image

generate_image('Oahu, Mililani, Honolulu County, Hawaii, United States of America', query_type='string', key_size=9, line_width=0.5)

Inspiration

Inspiration and original code from Giuseppe Sollazzo @puntofisso -> https://twitter.com/puntofisso/status/1213135545121099777?s=20

Building on work by Cédric Scherer @CedScherer and @erdavis

#mapgeek #gis #osmnx #opensource #visualization #python #mapvisualization

About

Quickly generate maps of road networks coloured by words in road names

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages