<commit_before>[![PyPI version](https://badge.fury.io/py/OSMnx.svg)](https://badge.fury.io/py/OSMnx)
[![Build Status](https://travis-ci.org/gboeing/osmnx.svg?branch=master)](https://travis-ci.org/gboeing/osmnx)
[![Coverage Status](https://coveralls.io/repos/github/gboeing/osmnx/badge.svg?branch=master)](https://coveralls.io/github/gboeing/osmnx?branch=master)

# OSMnx

**Python for street networks**

Retrieve, construct, analyze, and visualize street networks from OpenStreetMap: [full overview](http://geoffboeing.com/2016/11/osmnx-python-street-networks/).

You can read/cite the journal article manuscript: <NAME>. 2016. "[OSMnx: New Methods for Acquiring, Constructing, Analyzing, and Visualizing Complex Street Networks](http://geoffboeing.com/publications/osmnx-complex-street-networks/)." Manuscript under review. doi:10.2139/ssrn.2865501.

## Overview

**OSMnx** is a Python 2+3 package that lets you download spatial geometries and construct, project, visualize, 
and analyze street networks from OpenStreetMap's APIs. Users can download and construct walkable, drivable, or bikable 
urban networks with a single line of Python code, and then easily analyze and visualize them:

```
import osmnx as ox
G = ox.graph_from_place('Manhattan, New York, USA', network_type='drive')
ox.plot_graph(ox.project_graph(G))
```
![](examples/images/manhattan.jpg)

In a couple lines of code you can examine intersection density, network circuity, average block size, PageRank,
betweenness centrality, connectivity, spatial distribution of dead-ends or 4-way intersections, etc for anywhere in the world:

```
basic_stats = ox.basic_stats(G)
print(basic_stats['circuity_avg'])

extended_stats = ox.extended_stats(G)
print(extended_stats['pagerank_max_node'])
```

## Installation

```
pip install osmnx
```

If you are on **Windows**, install [geopandas and rtree](http://geoffboeing.com/2014/09/using-geopandas-windows/), *before* pip installing OSMnx. 
If you are on **Mac**, install rtree via [conda-forge](https://anaconda.org/conda-forge/rtree), *before* pip installing OSMnx.
If you are on **Linux**, follow the rtree installation [instructions](http://toblerity.org/rtree/install.html#nix), *before* pip installing OSMnx.

## How to use OSMnx

For a quick demo overview of OSMnx, see this [demo notebook](examples/01-overview-osmnx.ipynb).
<commit_msg>added conda install instructions<commit_after>[![PyPI version](https://badge.fury.io/py/OSMnx.svg)](https://badge.fury.io/py/OSMnx)
[![Build Status](https://travis-ci.org/gboeing/osmnx.svg?branch=master)](https://travis-ci.org/gboeing/osmnx)
[![Coverage Status](https://coveralls.io/repos/github/gboeing/osmnx/badge.svg?branch=master)](https://coveralls.io/github/gboeing/osmnx?branch=master)

# OSMnx

**Python for street networks**

Retrieve, construct, analyze, and visualize street networks from OpenStreetMap: [full overview](http://geoffboeing.com/2016/11/osmnx-python-street-networks/).

You can read/cite the journal article manuscript: <NAME>. 2016. "[OSMnx: New Methods for Acquiring, Constructing, Analyzing, and Visualizing Complex Street Networks](http://geoffboeing.com/publications/osmnx-complex-street-networks/)." Manuscript under review. doi:10.2139/ssrn.2865501.

## Overview

**OSMnx** is a Python 2+3 package that lets you download spatial geometries and construct, project, visualize, 
and analyze street networks from OpenStreetMap's APIs. Users can download and construct walkable, drivable, or bikable 
urban networks with a single line of Python code, and then easily analyze and visualize them:

```
import osmnx as ox
G = ox.graph_from_place('Manhattan, New York, USA', network_type='drive')
ox.plot_graph(ox.project_graph(G))
```
![](examples/images/manhattan.jpg)

In a couple lines of code you can examine intersection density, network circuity, average block size, PageRank,
betweenness centrality, connectivity, spatial distribution of dead-ends or 4-way intersections, etc for anywhere in the world:

```
basic_stats = ox.basic_stats(G)
print(basic_stats['circuity_avg'])

extended_stats = ox.extended_stats(G)
print(extended_stats['pagerank_max_node'])
```

## Installation

You can install OSMnx with conda:

```
conda install -c conda-forge osmnx
```

Or with pip:

```
pip install osmnx
```

If you are pip installing OSMnx, install [geopandas](http://geoffboeing.com/2014/09/using-geopandas-windows/) 
and [rtree](http://geoffboeing.com/2016/10/r-tree-spatial-index-python/) first. It's easiest to 
use [conda-forge](https://anaconda.org/conda-forge/geopandas) to get these dependencies installed.

## How to use OSMnx

For a quick demo overview of OSMnx, see this [demo notebook](examples/01-overview-osmnx.ipynb).

{'fraction_non_alphanumeric': 0.12966893039049235, 'fraction_numerical': 0.015704584040747028, 'mean_word_length': 5.666195190947666, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '158995', 'n_tokens_mistral': 1656, 'n_tokens_neox': 1500, 'n_words': 410}