Coder Social home page Coder Social logo

udst / pandana Goto Github PK

View Code? Open in Web Editor NEW
379.0 379.0 85.0 34.42 MB

Pandas Network Analysis by UrbanSim: fast accessibility metrics and shortest paths, using contraction hierarchies :world_map:

Home Page: http://udst.github.io/pandana

License: GNU Affero General Public License v3.0

Makefile 0.27% Shell 0.89% Python 32.96% C++ 61.44% C 1.18% Cython 3.26%

pandana's People

Contributors

alephcero avatar bstabler avatar cvanoli avatar federicofernandez avatar fillipefeitosa avatar fscottfoti avatar jalessio avatar janowicz avatar jiffyclub avatar ljwolf avatar martjanz avatar ngoldenberg avatar pksohn avatar pkubaj avatar pymap avatar rikuoja avatar sablanchard avatar smmaurer avatar thomastu avatar waddell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pandana's Issues

Documenting behavior for aggregations that can't be calculated

It looks like pandana.Network.aggregate() returns values of -1 for source nodes where an aggregation can't be calculated, for example if there aren't any other nodes within the distance radius. I can't find a reference to this in the documentation, though. We should confirm what the behavior is and make it more explicit.

Docstrings for pandana.Network.aggregate(): https://github.com/UDST/pandana/blob/master/pandana/network.py#L274-L320

Sphinx documentation: http://udst.github.io/pandana/network.html#pandana.network.Network.aggregate

There are several code conditions in the C++ that produce values of -1, but I haven't traced out the details: https://github.com/UDST/pandana/blob/master/src/accessibility.cpp

gtfs import

Do the same as with OSM import but for transit (will also need to connect the transit network to the walking network)

mac builds for multithreading

I want to open an issue that keeps the latest on multithreaded mac builds. Looks like you can now run "pip install pandana" on mac but you get the single threaded version by default because the default C++ compiler on Mac doesn't support openmp.

Multithreading on Mac is possible - I use it all the time - but requires getting a version of GCC. @jiffyclub - do you think we should list the steps here or on the wiki or in the sphinx docs or ...?

Basemap mpl tool not listed as a dependency

Basemap is an extension of Matplotlib but not included/distributed with the main library (see: http://matplotlib.org/mpl_toolkits/index.html?highlight=basemap#basemap).

Introduced in PR #38, the new dependency requirement appears to have been added/listed only to the Travis file.

Two suggestions:

  1. Add documentation (specifically in the Installation doc), indicating users need to install this.
  2. Modify #38's code and make it an optional lib (via a try), wherein matplotlib simply plots based on the x and y values in the dataframe.

import pandana on windows results in "ImportError: DLL load failed..." error

I am running 64-bit Windows 7 with python 2.7.11 and have installed pandana 0.2.0 via pip - this is a new install of pandana on a machine that has never had it. When I import pandana I receive the following error, any ideas on what may be wrong here?:

import pandana as pdna


ImportError Traceback (most recent call last)
in ()
----> 1 import pandana as pdna

C:\Users\samb\Anaconda2\lib\site-packages\pandana__init__.py in ()
----> 1 from network import Network
2
3 version = version = '0.2.0'

C:\Users\samb\Anaconda2\lib\site-packages\pandana\network.py in ()
8 import pandas as pd
9
---> 10 from . import _pyaccess
11 from .loaders import pandash5 as ph5
12

ImportError: DLL load failed: The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.

Different results when making multiple calls with nearest_pois

Description of the bug

I am assigning network node_ids a to parcel data set and then running nearest_poi to find all of the parcels within a mile of a set of coordinates. I want to be able to re-run these queries without re-creating the network. However, If I use one set of coordinates, then a different set of coordinates whose buffer intersects with the first set, then run the first set again, I get a different number of parcels returned in the first and third query. Please see the code as it might be easier to understand.

I am pretty sure that this is not a copy of a reference problem (in my code) because I use df.copy() to make a copy of the original parcel dataframe in the get_nearest_parcels function before any modifications are made to it. Also, the reason I do not want to recreate the network after each query is to save time- I am prototyping a web service that uses pandana to generate geojson isochrones from a passed in set of coordinates. So ideally the network is loaded and the app is listening for coordinates to run the query. I noticed this behavior because the app started generating weird polygons when making multiple calls from the same area. I have added the network files below.

UPDATE: The parcel DataFrame has nothing to do with the error so I have updated the code for simplicity.

Thanks,

Stefan

Network data (optional)

https://file.ac/8UQg8JUbhvs/

Environment

  • Operating system:
    Windows

  • Python version:
    2,7

  • Pandana version:
    0.2.0

  • Pandana required packages versions (optional):

Paste the code that reproduces the issue here:

import pandana as pdna
import pandas as pd
import numpy as np

nodes_file_name = r'D:\Stefan\Isochrone\repository\data\all_streets_nodes_2014.csv'
links_file_name = r'D:\Stefan\Isochrone\repository\data\all_streets_links_2014.csv'

max_dist = 5280 

# nodes must be indexed by node_id column, which is the first column
nodes = pd.DataFrame.from_csv(nodes_file_name)
links = pd.DataFrame.from_csv(links_file_name, index_col = None )

# get rid of circular links
links = links.loc[(links.from_node_id <> links.to_node_id)]

# assign impedance
imp = pd.DataFrame(links.Shape_Length)
imp = imp.rename(columns = {'Shape_Length':'distance'})

# create pandana network
network = pdna.network.Network(nodes.x, nodes.y, links.from_node_id, links.to_node_id, imp)

network.init_pois(1, max_dist, 1)

def get_nearest_nodes(x,y):
    print 'Getting data'
    x = pd.Series(x)
    y = pd.Series(y)
    #Set as a point of interest on the pandana network
    network.set_pois('tstop', x, y)
    #Find distance to point from all nodes, everything over max_dist gets a value of 99999
    res = network.nearest_pois(max_dist, 'tstop', num_pois=1, max_distance=99999)
    res = (res[res <> 99999]/5280.).astype(res.dtypes) # convert to miles
    return res 


#### ****Re-Run above code for each test**** #####

##### TEST 1 #####
# Same coordinates, same result
test1 = get_nearest_nodes(1272010.0, 228327.0)
print len(test1[(test1[1] > 0)])
test2 = get_nearest_nodes(1272010.0, 228327.0)
print len(test2[(test2[1] > 0)])

##### TEST 2- this shows the potential bug #####
# First and Third coordinates are the same but give different result. 
# The second set of coordinates are within the buffer distance of the first/third. 
test1 = get_nearest_nodes(1272010.0, 228327.0)
print len(test1[(test1[1] > 0)])
test2 = get_nearest_nodes(1268830.0, 228417.0)
print len(test2[(test2[1] > 0)])
# Same coords as the first call, but yields different results
test3 = get_nearest_nodes(1272010.0, 228327.0)
print len(test3[(test3[1] > 0)])

##### TEST 3 #####
# First and third coordinates are the same and give the same result. 
# The second set of coordinates are outside the buffer distance of the first/third.
test1 = get_nearest_nodes(1272010.0, 228327.0)
print len(test1[(test1[1] > 0)])
# These coords are outside the buffered area as the first call. 
test2 = get_nearest_nodes(1264180.0, 193485.0)
print len(test2[(test2[1] > 0)])
# Same coords and same results as the first call.
test3 = get_nearest_nodes(1272010.0, 228327.0)
print len(test3[(test3[1] > 0)])

Paste the error message (if applicable):

# place error message here

node ids shouldn't have to be ints

It was recently discovered that node ids have to be ints with the current version. In practical terms this isn't a huge problem, but should probably be addressed at some point.

Python 3 Support

I'd like to be able to use exclusively Python 3 and Pandana is probably the most difficult thing to port because it has C extensions. This article in the Python 3 docs might be useful, or we might try using something like Cython.

Failed installation: Failed building wheel for Pandana

Description of the bug

I'm trying to install pandana but I keep getting an error. I've followed the instructions in the project website. I have Visual C++ 2017 and 2015 installed in my machine. I also had no problem in installing urbansim

Environment

  • Operating system: Windows 10 64bit

  • Python version: 2.7.13

  • Pandana version: 0.4.0

Paste the code that reproduces the issue here:

C:\Anaconda>conda config --add channels udst
C:\Anaconda>conda config --add channels conda-forge
C:\Anaconda>conda install urbansim
C:\Anaconda>conda install pandana

Code output:

This is the error I get if I try to install pandana using conda install

C:\Anaconda>conda install pandana

Fetching package metadata .................
Solving package specifications: .

Package plan for installation in environment C:\Anaconda:

The following NEW packages will be INSTALLED:

    click:           6.7-py27_0    conda-forge
    click-plugins:   1.0.3-py27_0  conda-forge
    cligj:           0.4.0-py27_0  conda-forge
    curl:            7.49.1-vc9_2  conda-forge [vc9]
    descartes:       1.1.0-py27_0  conda-forge
    expat:           2.1.0-vc9_3   conda-forge [vc9]
    fiona:           1.7.8-py27_1  conda-forge
    freexl:          1.0.2-vc9_2   conda-forge [vc9]
    geopandas:       0.2.1-py27_4  conda-forge
    hdf4:            4.2.12-vc9_0  conda-forge [vc9]
    kealib:          1.4.7-vc9_2   conda-forge [vc9]
    krb5:            1.14.2-vc9_0  conda-forge [vc9]
    libgdal:         2.1.4-vc9_2   conda-forge [vc9]
    libiconv:        1.14-vc9_4    conda-forge [vc9]
    libnetcdf:       4.4.1.1-vc9_5 conda-forge [vc9]
    libpq:           9.6.3-vc9_0   conda-forge [vc9]
    libspatialindex: 1.8.5-vc9_1   conda-forge [vc9]
    libspatialite:   4.3.0a-vc9_15 conda-forge [vc9]
    libtiff:         4.0.6-vc9_7   conda-forge [vc9]
    libxml2:         2.9.4-vc9_4   conda-forge [vc9]
    munch:           2.2.0-py27_0  conda-forge
    openjpeg:        2.1.2-vc9_3   conda-forge [vc9]
    osmnet:          0.1.4-py27_0  conda-forge
    proj4:           4.9.3-vc9_4   conda-forge [vc9]
    pysal:           1.13.0-py27_0 conda-forge
    rtree:           0.8.3-py27_0  conda-forge
    sqlite:          3.13.0-vc9_1  conda-forge [vc9]
    vs2015_runtime:  14.0.25420-0  conda-forge
    xerces-c:        3.1.4-vc9_3   conda-forge [vc9]
    xz:              5.2.2-0       conda-forge

The following packages will be UPDATED:

    pandana:         0.1.2-py27_0  synthicity  --> 0.3.0-py27_0 udst

Proceed ([y]/n)? y

Paste the error message (if applicable):

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-core-console-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-core-file-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-core-file-l2-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-core-handle-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-core-heap-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-core-libraryloader-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-core-localization-l1-2-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-core-memory-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-core-processenvironment-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-core-processthreads-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-core-processthreads-l1-1-1.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-core-rtlsupport-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-core-synch-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-core-synch-l1-2-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-core-sysinfo-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-core-timezone-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-crt-conio-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-crt-convert-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-crt-environment-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-crt-filesystem-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-crt-heap-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-crt-locale-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-crt-math-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-crt-multibyte-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-crt-private-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-crt-process-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-crt-runtime-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-crt-stdio-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-crt-string-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-crt-time-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/api-ms-win-crt-utility-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/concrt140.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/msvcp140.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/ucrtbase.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/vccorlib140.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/vcomp140.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'Library/bin/vcruntime140.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-core-console-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-core-datetime-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-core-errorhandling-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-core-file-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-core-file-l1-2-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-core-file-l2-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-core-handle-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-core-heap-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-core-libraryloader-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-core-localization-l1-2-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-core-memory-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-core-processenvironment-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-core-processthreads-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-core-processthreads-l1-1-1.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-core-rtlsupport-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-core-synch-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-core-synch-l1-2-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-core-sysinfo-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-crt-conio-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-crt-convert-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-crt-environment-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-crt-filesystem-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-crt-heap-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-crt-locale-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-crt-math-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-crt-multibyte-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-crt-private-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-crt-process-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-crt-runtime-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-crt-stdio-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-crt-string-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-crt-time-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'api-ms-win-crt-utility-l1-1-0.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'concrt140.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'msvcp140.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'ucrtbase.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'vccorlib140.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'vcomp140.dll'
specified in the package manifest cannot be found.

CondaVerificationError: The package for vs2015_runtime located at C:\Anaconda\pkgs\vs2015_runtime-14.0.25420-0
appears to be corrupted. The path 'vcruntime140.dll'
specified in the package manifest cannot be found.

Code output:

This is the error I get if I try to install pandana using pip install

C:\Anaconda>pip install -U pandana

Collecting pandana
  Using cached pandana-0.4.0.1.zip
Requirement already up-to-date: matplotlib>=1.3.1 in c:\anaconda\lib\site-packages (from pandana)
Requirement already up-to-date: numpy>=1.8.0 in c:\anaconda\lib\site-packages (from pandana)
Requirement already up-to-date: pandas>=0.17.0 in c:\anaconda\lib\site-packages (from pandana)
Requirement already up-to-date: requests>=2.0 in c:\anaconda\lib\site-packages (from pandana)
Requirement already up-to-date: tables>=3.1.0 in c:\anaconda\lib\site-packages (from pandana)
Requirement already up-to-date: osmnet>=0.1.2 in c:\anaconda\lib\site-packages (from pandana)
Requirement already up-to-date: cython>=0.25.2 in c:\anaconda\lib\site-packages (from pandana)
Requirement already up-to-date: scikit-learn>=0.18.1 in c:\anaconda\lib\site-packages (from pandana)
Requirement already up-to-date: six>=1.10 in c:\anaconda\lib\site-packages (from matplotlib>=1.3.1->pandana)
Requirement already up-to-date: python-dateutil in c:\anaconda\lib\site-packages (from matplotlib>=1.3.1->pandana)
Requirement already up-to-date: functools32 in c:\anaconda\lib\site-packages (from matplotlib>=1.3.1->pandana)
Requirement already up-to-date: pytz in c:\anaconda\lib\site-packages (from matplotlib>=1.3.1->pandana)
Requirement already up-to-date: cycler>=0.10 in c:\anaconda\lib\site-packages (from matplotlib>=1.3.1->pandana)
Requirement already up-to-date: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 in c:\anaconda\lib\site-packages (from matplotlib>=1.3.1->pandana)
Requirement already up-to-date: chardet<3.1.0,>=3.0.2 in c:\anaconda\lib\site-packages (from requests>=2.0->pandana)
Requirement already up-to-date: idna<2.6,>=2.5 in c:\anaconda\lib\site-packages (from requests>=2.0->pandana)
Requirement already up-to-date: urllib3<1.23,>=1.21.1 in c:\anaconda\lib\site-packages (from requests>=2.0->pandana)
Requirement already up-to-date: certifi>=2017.4.17 in c:\anaconda\lib\site-packages (from requests>=2.0->pandana)
Requirement already up-to-date: numexpr>=2.5.2 in c:\anaconda\lib\site-packages (from tables>=3.1.0->pandana)
Requirement already up-to-date: Shapely>=1.5 in c:\anaconda\lib\site-packages (from osmnet>=0.1.2->pandana)
Requirement already up-to-date: geopandas>=0.2.1 in c:\anaconda\lib\site-packages (from osmnet>=0.1.2->pandana)
Collecting descartes (from geopandas>=0.2.1->osmnet>=0.1.2->pandana)
  Using cached descartes-1.1.0-py2-none-any.whl
Collecting pyproj (from geopandas>=0.2.1->osmnet>=0.1.2->pandana)
Collecting fiona (from geopandas>=0.2.1->osmnet>=0.1.2->pandana)
  Using cached Fiona-1.7.8.tar.gz
Collecting cligj (from fiona->geopandas>=0.2.1->osmnet>=0.1.2->pandana)
  Using cached cligj-0.4.0-py2-none-any.whl
Collecting click-plugins (from fiona->geopandas>=0.2.1->osmnet>=0.1.2->pandana)
Collecting munch (from fiona->geopandas>=0.2.1->osmnet>=0.1.2->pandana)
Requirement already up-to-date: enum34 in c:\anaconda\lib\site-packages (from fiona->geopandas>=0.2.1->osmnet>=0.1.2->pandana)
Collecting click>=4.0 (from cligj->fiona->geopandas>=0.2.1->osmnet>=0.1.2->pandana)
  Using cached click-6.7-py2.py3-none-any.whl
Building wheels for collected packages: pandana, fiona
  Running setup.py bdist_wheel for pandana ... error
  Complete output from command c:\anaconda\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\rafa\\appdata\\local\\temp\\pip-build-gkovnp\\pandana\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d c:\users\rafa\appdata\local\temp\tmpeszrqkpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-2.7
  creating build\lib.win-amd64-2.7\pandana
  copying pandana\network.py -> build\lib.win-amd64-2.7\pandana
  copying pandana\testing.py -> build\lib.win-amd64-2.7\pandana
  copying pandana\utils.py -> build\lib.win-amd64-2.7\pandana
  copying pandana\__init__.py -> build\lib.win-amd64-2.7\pandana
  creating build\lib.win-amd64-2.7\pandana\loaders
  copying pandana\loaders\osm.py -> build\lib.win-amd64-2.7\pandana\loaders
  copying pandana\loaders\pandash5.py -> build\lib.win-amd64-2.7\pandana\loaders
  copying pandana\loaders\__init__.py -> build\lib.win-amd64-2.7\pandana\loaders
  running build_ext
  skipping 'src\cyaccess.cpp' Cython extension (up-to-date)
  building 'pandana.cyaccess' extension
  creating build\temp.win-amd64-2.7
  creating build\temp.win-amd64-2.7\Release
  creating build\temp.win-amd64-2.7\Release\src
  creating build\temp.win-amd64-2.7\Release\src\contraction_hierarchies
  creating build\temp.win-amd64-2.7\Release\src\contraction_hierarchies\src
  C:\Users\rafa\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I. -Ic:\anaconda\include -Ic:\anaconda\PC -Ic:\anaconda\lib\site-packages\numpy\core\include /Tpsrc/accessibility.cpp /Fobuild\temp.win-amd64-2.7\Release\src/accessibility.obj /w /openmp
  cl : Command line warning D9025 : overriding '/W3' with '/w'
  accessibility.cpp
  C:\Users\rafa\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
  c:\users\rafa\appdata\local\temp\pip-build-gkovnp\pandana\src\accessibility.h(60) : error C2059: syntax error : '{'
  c:\users\rafa\appdata\local\temp\pip-build-gkovnp\pandana\src\accessibility.h(60) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
  c:\users\rafa\appdata\local\temp\pip-build-gkovnp\pandana\src\accessibility.h(73) : error C2059: syntax error : '{'
  c:\users\rafa\appdata\local\temp\pip-build-gkovnp\pandana\src\accessibility.h(73) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
  src/accessibility.cpp(125) : error C2039: 'at' : is not a member of 'std::map<_Kty,_Ty>'
          with
          [
              _Kty=std::string,
              _Ty=MTC::accessibility::Accessibility::accessibility_vars_t
          ]
  src/accessibility.cpp(213) : error C2065: 'aggregations' : undeclared identifier
  src/accessibility.cpp(213) : error C2228: left of '.begin' must have class/struct/union
          type is ''unknown-type''
  src/accessibility.cpp(213) : error C2065: 'aggregations' : undeclared identifier
  src/accessibility.cpp(213) : error C2228: left of '.end' must have class/struct/union
          type is ''unknown-type''
  src/accessibility.cpp(214) : error C2065: 'aggregations' : undeclared identifier
  src/accessibility.cpp(214) : error C2228: left of '.end' must have class/struct/union
          type is ''unknown-type''
  src/accessibility.cpp(215) : error C2065: 'decays' : undeclared identifier
  src/accessibility.cpp(215) : error C2228: left of '.begin' must have class/struct/union
          type is ''unknown-type''
  src/accessibility.cpp(215) : error C2065: 'decays' : undeclared identifier
  src/accessibility.cpp(215) : error C2228: left of '.end' must have class/struct/union
          type is ''unknown-type''
  src/accessibility.cpp(215) : error C2065: 'decays' : undeclared identifier
  src/accessibility.cpp(215) : error C2228: left of '.end' must have class/struct/union
          type is ''unknown-type''
  error: command 'C:\\Users\\rafa\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

  ----------------------------------------
  Failed building wheel for pandana
  Running setup.py clean for pandana
  Running setup.py bdist_wheel for fiona ... error
  Complete output from command c:\anaconda\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\rafa\\appdata\\local\\temp\\pip-build-gkovnp\\fiona\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d c:\users\rafa\appdata\local\temp\tmpp7nvv9pip-wheel- --python-tag cp27:
  c:\anaconda\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'metadata_version'
    warnings.warn(msg)
  c:\anaconda\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'requires_python'
    warnings.warn(msg)
  c:\anaconda\lib\distutils\dist.py:267: UserWarning: Unknown distribution option: 'requires_external'
    warnings.warn(msg)
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-2.7
  creating build\lib.win-amd64-2.7\fiona
  copying .\fiona\collection.py -> build\lib.win-amd64-2.7\fiona
  copying .\fiona\compat.py -> build\lib.win-amd64-2.7\fiona
  copying .\fiona\crs.py -> build\lib.win-amd64-2.7\fiona
  copying .\fiona\drvsupport.py -> build\lib.win-amd64-2.7\fiona
  copying .\fiona\errors.py -> build\lib.win-amd64-2.7\fiona
  copying .\fiona\inspector.py -> build\lib.win-amd64-2.7\fiona
  copying .\fiona\rfc3339.py -> build\lib.win-amd64-2.7\fiona
  copying .\fiona\tool.py -> build\lib.win-amd64-2.7\fiona
  copying .\fiona\transform.py -> build\lib.win-amd64-2.7\fiona
  copying .\fiona\__init__.py -> build\lib.win-amd64-2.7\fiona
  creating build\lib.win-amd64-2.7\fiona\fio
  copying .\fiona\fio\bounds.py -> build\lib.win-amd64-2.7\fiona\fio
  copying .\fiona\fio\calc.py -> build\lib.win-amd64-2.7\fiona\fio
  copying .\fiona\fio\cat.py -> build\lib.win-amd64-2.7\fiona\fio
  copying .\fiona\fio\collect.py -> build\lib.win-amd64-2.7\fiona\fio
  copying .\fiona\fio\distrib.py -> build\lib.win-amd64-2.7\fiona\fio
  copying .\fiona\fio\dump.py -> build\lib.win-amd64-2.7\fiona\fio
  copying .\fiona\fio\env.py -> build\lib.win-amd64-2.7\fiona\fio
  copying .\fiona\fio\filter.py -> build\lib.win-amd64-2.7\fiona\fio
  copying .\fiona\fio\helpers.py -> build\lib.win-amd64-2.7\fiona\fio
  copying .\fiona\fio\info.py -> build\lib.win-amd64-2.7\fiona\fio
  copying .\fiona\fio\insp.py -> build\lib.win-amd64-2.7\fiona\fio
  copying .\fiona\fio\load.py -> build\lib.win-amd64-2.7\fiona\fio
  copying .\fiona\fio\ls.py -> build\lib.win-amd64-2.7\fiona\fio
  copying .\fiona\fio\main.py -> build\lib.win-amd64-2.7\fiona\fio
  copying .\fiona\fio\options.py -> build\lib.win-amd64-2.7\fiona\fio
  copying .\fiona\fio\__init__.py -> build\lib.win-amd64-2.7\fiona\fio
  running build_ext
  building 'fiona._transform' extension
  creating build\temp.win-amd64-2.7
  creating build\temp.win-amd64-2.7\Release
  creating build\temp.win-amd64-2.7\Release\fiona
  C:\Users\rafa\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\anaconda\include -Ic:\anaconda\PC /Tpfiona/_transform.cpp /Fobuild\temp.win-amd64-2.7\Release\fiona/_transform.obj
  _transform.cpp
  fiona/_transform.cpp(469) : fatal error C1083: Cannot open include file: 'cpl_conv.h': No such file or directory
  error: command 'C:\\Users\\rafa\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

  ----------------------------------------
  Failed building wheel for fiona
  Running setup.py clean for fiona
Failed to build pandana fiona
Installing collected packages: pandana, descartes, pyproj, click, cligj, click-plugins, munch, fiona
  Running setup.py install for pandana ... error
    Complete output from command c:\anaconda\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\rafa\\appdata\\local\\temp\\pip-build-gkovnp\\pandana\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\rafa\appdata\local\temp\pip-rycrsq-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-2.7
    creating build\lib.win-amd64-2.7\pandana
    copying pandana\network.py -> build\lib.win-amd64-2.7\pandana
    copying pandana\testing.py -> build\lib.win-amd64-2.7\pandana
    copying pandana\utils.py -> build\lib.win-amd64-2.7\pandana
    copying pandana\__init__.py -> build\lib.win-amd64-2.7\pandana
    creating build\lib.win-amd64-2.7\pandana\loaders
    copying pandana\loaders\osm.py -> build\lib.win-amd64-2.7\pandana\loaders
    copying pandana\loaders\pandash5.py -> build\lib.win-amd64-2.7\pandana\loaders
    copying pandana\loaders\__init__.py -> build\lib.win-amd64-2.7\pandana\loaders
    running build_ext
    skipping 'src\cyaccess.cpp' Cython extension (up-to-date)
    building 'pandana.cyaccess' extension
    creating build\temp.win-amd64-2.7
    creating build\temp.win-amd64-2.7\Release
    creating build\temp.win-amd64-2.7\Release\src
    creating build\temp.win-amd64-2.7\Release\src\contraction_hierarchies
    creating build\temp.win-amd64-2.7\Release\src\contraction_hierarchies\src
    C:\Users\rafa\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I. -Ic:\anaconda\include -Ic:\anaconda\PC -Ic:\anaconda\lib\site-packages\numpy\core\include /Tpsrc/accessibility.cpp /Fobuild\temp.win-amd64-2.7\Release\src/accessibility.obj /w /openmp
    cl : Command line warning D9025 : overriding '/W3' with '/w'
    accessibility.cpp
    C:\Users\rafa\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
    c:\users\rafa\appdata\local\temp\pip-build-gkovnp\pandana\src\accessibility.h(60) : error C2059: syntax error : '{'
    c:\users\rafa\appdata\local\temp\pip-build-gkovnp\pandana\src\accessibility.h(60) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
    c:\users\rafa\appdata\local\temp\pip-build-gkovnp\pandana\src\accessibility.h(73) : error C2059: syntax error : '{'
    c:\users\rafa\appdata\local\temp\pip-build-gkovnp\pandana\src\accessibility.h(73) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
    src/accessibility.cpp(125) : error C2039: 'at' : is not a member of 'std::map<_Kty,_Ty>'
            with
            [
                _Kty=std::string,
                _Ty=MTC::accessibility::Accessibility::accessibility_vars_t
            ]
    src/accessibility.cpp(213) : error C2065: 'aggregations' : undeclared identifier
    src/accessibility.cpp(213) : error C2228: left of '.begin' must have class/struct/union
            type is ''unknown-type''
    src/accessibility.cpp(213) : error C2065: 'aggregations' : undeclared identifier
    src/accessibility.cpp(213) : error C2228: left of '.end' must have class/struct/union
            type is ''unknown-type''
    src/accessibility.cpp(214) : error C2065: 'aggregations' : undeclared identifier
    src/accessibility.cpp(214) : error C2228: left of '.end' must have class/struct/union
            type is ''unknown-type''
    src/accessibility.cpp(215) : error C2065: 'decays' : undeclared identifier
    src/accessibility.cpp(215) : error C2228: left of '.begin' must have class/struct/union
            type is ''unknown-type''
    src/accessibility.cpp(215) : error C2065: 'decays' : undeclared identifier
    src/accessibility.cpp(215) : error C2228: left of '.end' must have class/struct/union
            type is ''unknown-type''
    src/accessibility.cpp(215) : error C2065: 'decays' : undeclared identifier
    src/accessibility.cpp(215) : error C2228: left of '.end' must have class/struct/union
            type is ''unknown-type''
    error: command 'C:\\Users\\rafa\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

    ----------------------------------------

Error message

Command "c:\anaconda\python.exe -u -c "import setuptools, tokenize;file='c:\users\rafa\appdata\local\temp\pip-build-gkovnp\pandana\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record c:\users\rafa\appdata\local\temp\pip-rycrsq-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\rafa\appdata\local\temp\pip-build-gkovnp\pandana\

Finally, yhis is the error I get if I try to install pandana using easy_install

C:\Anaconda>easy_install pandana

Searching for pandana
Reading https://pypi.python.org/simple/pandana/
Downloading https://pypi.python.org/packages/e3/a2/8285f08ef1dd7f1fd8d2110661b3978291d62b5afa27b61d9e0d2830d055/pandana-0.4.0.1.zip#md5=0658f2e1ef5ef8ddcf6650b03df8f8f2
Best match: pandana 0.4.0.1
Processing pandana-0.4.0.1.zip
Writing c:\users\rafa\appdata\local\temp\easy_install-twmkyv\pandana-0.4.0\setup.cfg
Running pandana-0.4.0\setup.py -q bdist_egg --dist-dir c:\users\rafa\appdata\local\temp\easy_install-twmkyv\pandana-0.4.0\egg-dist-tmp-ghztiu
cl : Command line warning D9025 : overriding '/W3' with '/w'
accessibility.cpp
C:\Users\rafa\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
c:\users\rafa\appdata\local\temp\easy_install-twmkyv\pandana-0.4.0\src\accessibility.h(60) : error C2059: syntax error : '{'
c:\users\rafa\appdata\local\temp\easy_install-twmkyv\pandana-0.4.0\src\accessibility.h(60) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
c:\users\rafa\appdata\local\temp\easy_install-twmkyv\pandana-0.4.0\src\accessibility.h(73) : error C2059: syntax error : '{'
c:\users\rafa\appdata\local\temp\easy_install-twmkyv\pandana-0.4.0\src\accessibility.h(73) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
src/accessibility.cpp(125) : error C2039: 'at' : is not a member of 'std::map<_Kty,_Ty>'
        with
        [
            _Kty=std::string,
            _Ty=MTC::accessibility::Accessibility::accessibility_vars_t
        ]
src/accessibility.cpp(213) : error C2065: 'aggregations' : undeclared identifier
src/accessibility.cpp(213) : error C2228: left of '.begin' must have class/struct/union
        type is ''unknown-type''
src/accessibility.cpp(213) : error C2065: 'aggregations' : undeclared identifier
src/accessibility.cpp(213) : error C2228: left of '.end' must have class/struct/union
        type is ''unknown-type''
src/accessibility.cpp(214) : error C2065: 'aggregations' : undeclared identifier
src/accessibility.cpp(214) : error C2228: left of '.end' must have class/struct/union
        type is ''unknown-type''
src/accessibility.cpp(215) : error C2065: 'decays' : undeclared identifier
src/accessibility.cpp(215) : error C2228: left of '.begin' must have class/struct/union
        type is ''unknown-type''
src/accessibility.cpp(215) : error C2065: 'decays' : undeclared identifier
src/accessibility.cpp(215) : error C2228: left of '.end' must have class/struct/union
        type is ''unknown-type''
src/accessibility.cpp(215) : error C2065: 'decays' : undeclared identifier
src/accessibility.cpp(215) : error C2228: left of '.end' must have class/struct/union
        type is ''unknown-type''
error: Setup script exited with error: command 

###errror

'C:\Users\rafa\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe' failed with exit status 2

osm import

Has three subtasks

  • get osm network from the overpass API into pandana
  • get amenities and assign them to the network as either POIs or for aggregation
  • figure out a way to remove disconnected subgraphs from OSM

Pandana tutorial comes with NameError: name 'x' is not defined

If you encounter a bug in Pandana please: 1) first search the previously opened issues to see if the problem has already been reported; 2) If not, fill in the template below and tag with the appropriate Type label. You can delete any sections that do not apply.

Description of the bug


Trying to follow tutorial described at https://udst.github.io/pandana/tutorial.html

Network data (optional)

If the issue is related to specific network data please provide a link to download the data or the function used to download the data.

Environment

  • Operating system:

  • Python version: 2.7

  • Pandana version: 0.4

  • Pandana required packages versions (optional):

Paste the code that reproduces the issue here:

import pandas as pd
import pandana as pdna
store = pd.HDFStore('D:/2017/py_tu/osm_bayarea.h5', "r")
nodes = store.nodes
edges = store.edges
print nodes.head(3)
print edges.head(3)
net=pdna.Network(nodes["x"], nodes["y"], edges["from"], edges["to"],
                 edges[["weight"]])
net.precompute(3000)
net.set_pois("restaurants", 2000, 10, x, y)

Paste the error message (if applicable):

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-5-3fc5423cc35e> in <module>()
----> 1 net.set_pois("restaurants", 2000, 10, x, y)

NameError: name 'x' is not defined

Persistence of pre-computed networks

I don't believe there is currently a way to save pandana networks in their pre-computed state, i.e. being able to load a saved pandana network without re-running contraction hierarchies. Is this correct? I know the save_hdf5 and from_hdf5 methods exist but as far as I can tell, they only save the network itself (edges and nodes) without that pre-computed information.

It would be great to be able to save a precomputed pandana Network object in that state, like how sklearn models can be persisted using pickle or joblib. Trying to save and load a pandana object using pickle or joblib currently results in a segmentation fault (at least for me).

Aggregation query directionality

So now, the aggregation queries identify the accessibility of a given location (node) by summarizing the properties of locations (other nodes) that can be reached from from the given location within some maximum impedance.It would be nice to mirror this and also be able to identify how accessible a given location is to other locations, i.e. what other locations can reach (traveling to) a given location within a maximum impedance.

The choice of a direction is probably model specific. For household location choice models we might be more inclined to use the accessibility from a given location as is available now, but for job location choice models we might care more how about accessible the location is to other locations. In many cases this might be equivalent but for congested networks this could be an issue.

I guess this could be achieved now by simply swapping the from and tonode columns on the edges data frame and creating an additional network. However, it might be nice to eventually enhance the aggregate method to take a direction argument (moving away from vs. moving towards).

links to articals

The readme has a broken link. Also are there other papers that should be cited?

Oneway by Series

This is likely a feature request or a suggestion of where to start for a potential PR. One of the options for network declaration is the ability to set a boolean for twoway edges. If this is true, the edges of the graph are flipped and appended back to the edges.
I have used a previously posted solution (by SEMCOG) using networkx to construct a graph from a shapefile. NetworkX's import does not allow fine control of of how the graph is constructed. I was hoping the twoway option for the network API could be altered to allow a series (of 0s & 1s). To determine which edges are flipped? Also, are there any objections to changing "twoway" to "oneway" defaulting to false as part of that change? I am willing to work on a PR for this, just not sure where to start.

Environment

  • Operating system:
    Linux
  • Python version:
    3.6
  • Pandana version:
    3.0

Tutorial Question concerning set_pois, pandana 0.3.0

the x,y variables are not defined, I tried 'x','y' and ['x','y'] which produce other pandas errors.

net.set_pois("restaurants", x, y)
produces
*** NameError: name 'x' is not defined


import pandas as pd
import pandana as pdna
store = pd.HDFStore('osm_bayarea.h5', "r")
nodes = store.nodes
edges = store.edges
print(nodes.head(3))
print(edges.head(3))
net=pdna.Network(nodes["x"], nodes["y"], edges["from"], edges["to"],edges[["weight"]])
net.precompute(3000)
net.init_pois(num_categories=1, max_dist=2000, max_pois=10)
net.set_pois("restaurants", x, y)

Unable to close network in memory

There doesn't seem to be a good way to "close" a pandana network instance in memory. I would like to get the following steps working:

  • Load a pandana network from its precomputed saved state as an HDF5 file (i.e. using from_hdf5)
  • Do some things with it (join data to it, run aggregation query, return data)
  • Close the network so I can repeat these steps

Since I can't seem to "close" the pandana network that is loaded in memory (the last step above), I get the following message: AssertionError: Adding more networks than have been reserved. I am aware that we can configure pandana so that it takes more than one network in memory, but I'd like to avoid that solution.

Future Improvements- Returning a DataFrame of all source-destination nodes within a certain distance (and including the distance)

With an eye towards the release of the urbanaccess libary, I'd like to test using pandana to build accessibility isochrones. My idea is to associate parcels with nodes (as we are already doing in our Soundcast accessibility scripts: https://github.com/psrc/soundcast/blob/master/scripts/accessibility/accessibility.py) and then have pandana return all the nodes/parcels that are accessible within a certain distance/impedance to a passed in set of coordinates. I would then be able to build polygon isochrones using either the parcel point or polygon geometries from the returned ids. I don't think this functionality exists in pandana yet- there would be potentially too many nodes/parcels for the nearest pois method. It sounds like the Future Improvement listed in the title would do the trick and so I was wondering if there are plans to implement this feature? The end goal is to produce transit accessibility isochrones so if this functionality will exist in urbanaccess then I am happy to wait until its release. Thanks!

Stefan

Install error with clang and not-Anaconda

Report from a user:

I've been trying to installing Pandana. I'm not using the Anaconda distribution, but have brewer2mpl, matplotlib, numpy, pandas, and tables installed, all at or above the listed versions.

When I try installing via pip, I get the following error:

clang: error: invalid argument '-dynamic' not allowed with '-static'

The line above it is:

clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I. -Isrc/ann_1.1.2/include -I/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/accessibility.cpp -o build/temp.macosx-10.9-x86_64-2.7/src/accessibility.o -DMACOSX -DLINUX -w -std=c++0x -O3 -fpic -g -static

tutorial data

I'm trying to follow the tutorial in tutorial.rst, I can't find the example data called in

store = pd.HDFStore("data/osm_bayarea.h5", "r")

anywhere in the repository. In fact, the only place I can find this file is at the MTC website, but it appears to be behind a login wall.

Are you able to distribute this dataset? If not, is there a different hdf5 dataset that I should try out?

current way of constructing graphs (email from scott bridwell)

I'm adding this as an issue on github for public knowledge since many people might have this problem, although I received it via email. Per Scott Bridwell at MAG:

If you guys have some time, I have a couple of quick questions on constructing a graph for use with the accessibility module.

  1.  The wiki states that nodeids argument provided  to the pya.createGraph method are not actually used by the accessibility model and that the node ids used by the accessibility are actually indexes of the nodes in the vector/ndarray. So should the node ids assigned to the edges be the indexes from the ndarray also? Or should the edges reference the ids in the nodeids argument?
    
  2.  Our transportation network models direction specific costs by using a single arc and then having multiple impedance fields (e.g. AB_NODE, BA_NODE, AB_TIME, BA_TIME) and 1-way arcs have impedances of 0 for the direction they are restricted from. Are direction specific costs supported by pyAccess? If so, do I need to transform this so that a row is created for each arc? For example:
    

[TABLE OMITTED]

  1.  Does pyAcess support turn impedances (global or turn specific)?
    
  2.  When doing aggregations and routing is the distance of a given parcel to the closest node factored into the accumulations (based on say an assumed travel rate) or does the cost accumulation begin at the node itself? I guess Iโ€™m generally asking if off-network costs can be accounted for in developing areas with sparse network coverage or if we would have to create pseudo edges to account for this.
    

Additional OpenStreetMap, ESRI ShapeFile and Geodatabase, and GTFS (General Transit Feed Service) importing

#I read in the documentation that this is already implemented on the C++ side? I was curious what the most current information on shapefile/geodatabase import is? A lot of analysis requires custom edge weights based on prior analysis on the network. I was reviewing NetworkX implementation of the graph network importer, but it is pure Python implementation that has been shown to be slower relative to IGraph/graph-tool.
Questions about the implementation:
Does the C++ shapefile import functionality allow import of networks that have connections based on vertices along with line end points? Or just end points?
What are the dependencies on the C++ implementation on import?
Depending on where this was on your priority queue I was thinking about implementing something myself. Any thoughts or updates on this would be great.

KeyError: "['weight'] not in index"

Hi I'm trying the pandanas network tool.
I already ran the SF bay area example.
I'm trying to do the same analysis with data in Vienna.

# Bounding box 
tmp = [16.169815,48.113391,16.589355,48.327496]

# Reordered for Pandana functions
bbox = [tmp[1], tmp[0], tmp[3], tmp[2]]

poi_df = osm.node_query(*bbox, tags='amenity=restaurant')
x, y = poi_df['lon'], poi_df['lat']

network_wien = osm.pdna_network_from_bbox(*bbox, network_type='walk', two_way=True, timeout=600, max_query_area_size=2500000000)

pandash5.network_to_pandas_hdf5(network_wien, './osm_wien.h5')

When I try to run the example I get the following error:
KeyError: "['weight'] not in index"

Am I missing something ?

Environment

  • Operating system: ubuntu 16.04
  • Python version: 2.7
  • Pandana version: lastest

Paste the error message (if applicable):

Traceback (most recent call last):
  File "tutorial_example_vienna.py", line 69, in <module>
    edges[["weight"]])
  File "/home/jccb/anaconda2/lib/python2.7/site-packages/pandas/core/frame.py", line 1958, in __getitem__
    return self._getitem_array(key)
  File "/home/jccb/anaconda2/lib/python2.7/site-packages/pandas/core/frame.py", line 2002, in _getitem_array
    indexer = self.loc._convert_to_indexer(key, axis=1)
  File "/home/jccb/anaconda2/lib/python2.7/site-packages/pandas/core/indexing.py", line 1231, in _convert_to_indexer
    raise KeyError('%s not in index' % objarr[mask])
KeyError: "['weight'] not in index"
Closing remaining open files:./osm_wien.h5...done

add optional precompute parameter to take a list of discrete impedance values or range of values

precompute currently is set up to only accept a 0 to n range of values for the precomputation process. It would be a great feature to not only have this as a option but to allow for precompute of multiple ranges and discrete single values in a list. This is particularly useful when dealing with very complex and large networks at the pedestrian scale when say you are only ever interested in a small set of values such as 10, 20, 30, 40 minute travel times or a set of different value ranges such as 2000-3000 m and 5000-6000 m. Otherwise a lot of processing time is wasted on values that one may never be interested in especially in the lower bound of the values. The precompute for units other than distance, such as minutes, for large pedestrian scale networks tend to take too long and is a waste of computation resources when only a subset of values will be examined anyway. This assumes that the underlying processes called in precompute can skip certain ranges of values.

set_pois() fails with number of args error

Just running through the tutorial and it's telling me I don't have the right number of args for set_pois().

I'm loading OSM data for Sydney, Australia using the pdna OSM from bbox method (which seems to work well), and I'm just using 10 random POIs (I'm just filling some pd.Series with rands inside the bbox).

Environment

Windows-10-10.0.14393-SP0
Python 3.6.1 |Anaconda custom (64-bit)| (default, May 11 2017, 13:25:24) [MSC v.1900 64 bit (AMD64)]
Pandas 0.21.0
Pandana 0.3.0
Numpy 1.12.1

Here's the code to reproduce the issue:

from pandana.loaders import osm
network = osm.pdna_network_from_bbox(-33.9014, 151.0216, -33.7704, 151.3093)
network.precompute(3000)
x = pd.Series([(-33.7704-(-33.9014))*np.random.random_sample()-33.9014 for i in range(0,10)])
y = pd.Series([(151.3093-151.0216)*np.random.random_sample()+151.0216 for i in range(0,10)])
network.set_pois("restaurants",2000,10,x,y)

Here's the error:

set_pois() takes 4 positional arguments but 6 were given

Expose shortest path functionality

Can the underlying shortest path functionality in pananda be exposed so it can be called using a python method? Given a node pair A-B, I want to get back 1) the impedance from A to B, and 2) the sequence of node or link IDs that define the shortest path from A to B. Doing this for a list of node pairs is even better.

My specific use case is that I am matching probe vehicle GPS points to the a network. Since they are only collected every 60 seconds, I need to impute the path between points, so I end up building many "short" shortest paths to do so. My current implementation works, but is slow, and I'm hoping your multi-threaded C++ implementation can speed things up.

pandana looks like it could turn into a nice general purpose networks container for transportation modelling/analysis, and I think exposing more of this functionality would help in that regard. Many thanks!

Inclusion of numpy import in setup can cause errors during a pip install process

It appears that the requirement of Numpy already being present before Pandana is install is in order to take advantage of the np.get_include() call in the include_dirs array. Is there another way to get the directory location of this dependency?

It seems like an alternate method would make including Pandana in a reqs.txt file function more reliably.

nearest_pois() discrepancy between version 0.2.0 and 0.2dev

Trying to generate poi's for bayarea_urbansim on two different machines yielded two different sets of results, despite the underlying data files being the same. Debugging ultimately led me to determine that different versions of Pandana, one installed from pip and the other installed from the source using setup.py, was the source of the problem. The reason I'm raising an issue here is that the version of Pandana installed from source, 0.2dev, doesn't seem to be working properly. The nearest_pois() function was returning the value of the max_distance parameter for every source node for every poi, indicating that no poi's were found. The same exact code with the same exact underlying data files returned different results, with poi's found, once I rolled Pandana back to version 0.2.0. Don't know enough about the differences between the version of Pandana that's on pip and the one that you get when you install from the source, but it might be worth looking into.

init_pois on multiple network graphs?

I built two networks for nearest distance queries. One is for regional wide auto access, the other is for local walking access. I can built two networks without problem using "reserve_num_graphs" option. However, "init_pois" only works for the first network not the second (which network is irrelevant) . Running "init_pois" command on the second network will cause kernel death on Linux. I guess it is related to C++ limitation? Any idea on how to get this around?

Thanks.

Allow inspection of the precomputed network from python

Right now it is not possible AFAIK to inspect the network object after it has been processed by the contraction hierarchies code. Usually, that process goes well, but there is a suspicion that for a particular case some nodes are not present in the computed network. It would be great to have methods to inspect the processed network.

Network.set() fails if network node IDs are not sequentially ordered integers starting at 0

I ran into this problem while running an instance of bayarea_urbansim using my own network where the node ids were OSM node IDs. A lot of digging led me to identify net.set() as the source of my problems. Network.set() relies on this class method when relating the node IDs of the network to the node IDs of the variable that is being set. The problem is that this function, self._node_indexes(), in turn relies on a merge of the node IDs from the variable in question with the node indices of this class object, self.node_idx, which for some reason is defined as a NumPy arange(). Thus, if the node IDs of the variable you wish to compute with Network.set() are not themselves sequentially ordered integers a-la a NumPy arange(), the network will not be able to find any matching POI's, which is precisely the problem that I was encountering. I'm sure there is some reason why self.node_idx is defined the way it is, but without knowing the rationale I don't know whether it makes more sense to implement a fix or to instead update the documentation to reflect the requirement that network node IDs be sequentially ordered IDs.

Missing POIs with a small network

When I make a very small network (in this case two nodes), there seems to be a problem with POIs. In the example below I'm adding four POIs but nearest_pois only ever finds one. My hunch is that some of the POIs aren't actually being assigned to nodes, maybe because they are outside the the bounding box formed by the network nodes? (They are inside the original bounding box, though.)

In [1]: from pandana.loaders import osm

In [2]: bbox = (37.8668405874, -122.2590948685, 37.8679028054, -122.2586363885)

In [3]: network = osm.network_from_bbox(*bbox)
Generating contraction hierarchies with 1 threads.
Setting CH node vector of size 2
Setting CH edge vector of size 1
[info src/contraction_hierarchies/src/libch.cpp:205] Range graph removed 0 edges of 2
. 10% . 20% . 30% . 40% . 50%  100%
. 60% . 70% . 80% . 90% . 100%
In [4]: network.nodes_df
Out[4]:
                   x          y
id
53063555 -122.258810  37.866910
53099275 -122.258993  37.867808

In [5]: query = "amenity=restaurant"

In [6]: data = osm.node_query(*bbox, tags=query)

In [7]: data
Out[7]:
               amenity    cuisine        lat         lon           name
id
286632169   restaurant        NaN  37.867231 -122.258692     Tako Sushi
366088674   restaurant        NaN  37.867388 -122.258940  Naan 'n Curry
1419597327  restaurant  ice_cream  37.867044 -122.258676          Cream
2965338413  restaurant      asian  37.867116 -122.258682   Koja Kitchen

In [8]: network.init_pois(num_categories=1, max_dist=1000, max_pois=5)

In [9]: network.set_pois(query, data['lon'], data['lat'])

In [10]: network.nearest_pois(1000, query, num_pois=3)
Out[10]:
                   1     2     3
id
53063555  101.205002  1000  1000
53099275    0.000000  1000  1000

In [11]:

pandana 2.0.0 gcc error during install on linux machine

I have a linux (4.1.15-8) machine with SUSE (gcc version 4.8.5) and python 2.7.11 with anaconda 4.0.0 64-bit and under a variety of scenarios I can not get pandana 2.0.0 to install properly. All except for conda seem to all be a gcc error. Could it be a gcc path issue? Any thoughts on how to get around this or any plans to release 2.0.0 via conda?

1) conda install pandana
After adding the correct channel, only version 0.1.2 is available via conda. Version 0.1.2 installs fine this way.

2) pip install pandana (for pandana 2.0.0)
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/sablanchard/anaconda2/lib/python2.7/site-packages/numpy/core/include -I. -Isrc/ann_1.1.2/include -I/home/sablanchard/anaconda2/include/python2.7 -c src/accessibility.cpp -o build/temp.linux-x86_64-2.7/src/accessibility.o -w -std=c++0x -O3 -fpic -g -fopenmp
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1

----------------------------------------

Command "/home/sablanchard/anaconda2/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-veqtsZ/pandana/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-yCejEP-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-veqtsZ/pandana/

3) install via the repo clone for 2.0.0 with python setup.py install
building 'pandana._pyaccess' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/sablanchard/anaconda2/lib/python2.7/site-packages/numpy/core/include -I. -Isrc/ann_1.1.2/include -I/home/sablanchard/anaconda2/include/python2.7 -c src/accessibility.cpp -o build/temp.linux-x86_64-2.7/src/accessibility.o -w -std=c++0x -O3 -fpic -g -fopenmp
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1

This all stems from an error in 0.1.2 with get_node_ids that I am assuming is fixed in 2.0.0 because this same data with the same command on another machine with 2.0.0 works fine:

blocks['node_id'] = net.get_node_ids(blocks['x'], blocks['y'])

KeyError Traceback (most recent call last)
in ()
1 t0 = time.time()
----> 2 blocks['node_id'] = net.get_node_ids(blocks['x'], blocks['y'])
3 print int(time.time()-t0), 'sec.' #

/home/sablanchard/anaconda2/lib/python2.7/site-packages/pandana-0.1.2-py2.7-linux-x86_64.egg/pandana/network.pyc in get_node_ids(self, x_col, y_col, mapping_distance)
342 # later date - need to convert from internal to external ids
343 node_ids = pd.Series(self.nodes_df.reset_index().
--> 344 iloc[s]["index"].values,
345 index=s.index)
346 return node_ids

/home/sablanchard/anaconda2/lib/python2.7/site-packages/pandas/core/frame.pyc in getitem(self, key)
1990 return self._getitem_multilevel(key)
1991 else:
-> 1992 return self._getitem_column(key)
1993
1994 def _getitem_column(self, key):

/home/sablanchard/anaconda2/lib/python2.7/site-packages/pandas/core/frame.pyc in _getitem_column(self, key)
1997 # get column
1998 if self.columns.is_unique:
-> 1999 return self._get_item_cache(key)
2000
2001 # duplicate columns & possible reduce dimensionality

/home/sablanchard/anaconda2/lib/python2.7/site-packages/pandas/core/generic.pyc in _get_item_cache(self, item)
1343 res = cache.get(item)
1344 if res is None:
-> 1345 values = self._data.get(item)
1346 res = self._box_item_values(item, values)
1347 cache[item] = res

/home/sablanchard/anaconda2/lib/python2.7/site-packages/pandas/core/internals.pyc in get(self, item, fastpath)
3223
3224 if not isnull(item):
-> 3225 loc = self.items.get_loc(item)
3226 else:
3227 indexer = np.arange(len(self.items))[isnull(self.items)]

/home/sablanchard/anaconda2/lib/python2.7/site-packages/pandas/indexes/base.pyc in get_loc(self, key, method, tolerance)
1876 return self._engine.get_loc(key)
1877 except KeyError:
-> 1878 return self._engine.get_loc(self._maybe_cast_indexer(key))
1879
1880 indexer = self.get_indexer([key], method=method, tolerance=tolerance)

pandas/index.pyx in pandas.index.IndexEngine.get_loc (pandas/index.c:4027)()
pandas/index.pyx in pandas.index.IndexEngine.get_loc (pandas/index.c:3891)()
pandas/hashtable.pyx in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:12408)()
pandas/hashtable.pyx in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:12359)()
KeyError: 'index'

osm loader -- support for very large queries

right now, very large OSM queries fail because python runs out of memory before the network object can be written to disk.

Would it be possible to add an option in the OSM loader to stream the overpass request to disk, allowing for really big networks?

conda out of date

attempting to run conda update pandana gives me

# All requested packages already installed.
# packages in environment at C:\Anaconda2:
#
pandana                   0.1.2                    py27_0    synthicity

Looks like 0.2.0 was never loaded on conda for windows.

Allow joining to nodes by type

We tested this module with our region wide land parcel data. The module performed very well except accessibility evaluation was not consistent for all parcel units. For example, some land parcels had much higher accessibility than other parcels from the same neighborhood. A closer inspection showed those high accessibility parcels were assigned to closest highway nodes instead of nearby local road nodes even they don't actually have direct accesses to highway. This is caused by the pure proximity based joining between land parcels and road nodes. One possible solution is to exclude certain type of the nodes such as highway nodes in the spatial joining process so the parcels can be assigned to local nodes only. Thanks.

Plotting is broken

Likely related to the observation in prev. Issue #71 regarding warnings.

Attempting to plot with Pandana's built in tool results in a blank graph, like this:
image
Above image is based off a bounding box bbox = (-89.566399, 42.984056, -89.229584, 43.171917) (note shown arrangement is before bbox is resorted/ordered in function.

The plot function in UrbanAccess's plot.py file was used in my case as a rough guide to generate a temporary replacement function to enable the plot function in Pandana to work.

Should it be of any assistance, I will include it below:

import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib import collections as mc
x_min, y_min, x_max, y_max = bbox
bbox_aspect_ratio = (y_max-y_min)/(x_max-x_min)
fig_height = 35
fig, ax = plt.subplots(figsize=(fig_height / bbox_aspect_ratio, fig_height))
x_vals = list(p_net.nodes_df.x.values)
y_vals = list(p_net.nodes_df.y.values)

s = p_net.aggregate(15, type="sum", decay="linear", name="emp")
s = s[s.values == 0]
s[s.values == 0] = 9000

# drop all 0s
data = s[s.values > 0]

num_bins = 10
categories = pd.qcut(x=data, q=num_bins, labels=range(num_bins))
import matplotlib.cm as cm
color_list = [cm.get_cmap('hot')(x) for x in np.linspace(0.1, 0.9, num_bins)]
cleaned_categories = [int(cat) for cat in categories]
colors = [color_list[cat] for cat in cleaned_categories]

ax.scatter(x_vals, y_vals, s=5, c=colors, alpha=0.35, edgecolor='none', zorder=3)

margin=0.02
margin_ns = (y_min-y_max) * margin
margin_ew = (x_min-x_max) * margin
ax.set_ylim((y_min - margin_ns, y_max + margin_ns))
ax.set_xlim((x_min - margin_ew, x_max + margin_ew))

# configure axis
ax.get_xaxis().get_major_formatter().set_useOffset(False)
ax.get_yaxis().get_major_formatter().set_useOffset(False)
ax.axis('off')

plt.savefig('testplot.png', facecolor='black')

`ValueError: Buffer dtype mismatch` when construcing Network from pandas dataframe

Description of the bug

I cannot use pdna.Network() with my own pandas edge and node dataframes (built from an sql query), there is some sort of type mismatch saying it is getting double when it is expecting long, but all values from the dataframes are integer so I can't pinpoint where this is coming from. The tutorial says the node_x node_y and weight values should be float in any case.

This error doesn't come up when I am using osm.pdna_network_from_bbox() or I use your example osm_bayarea.h5 data and they even have float numbers, so I am assuming there is a specific way to construct the node and edge dataframes so they can be used by pdna.Network?

Network data (optional)

Our network is large and sits on a sql database so I'll just show the structure here.
I've input a edge dataframe in this format (bigint from a pandas sql query):

from to weight
1534152 1533645 839
1534051 1533659 1644
1534016 1534015 200
1534024 1534016 758
1534013 1534016 313

And the node data was in this format (bigint from a pandas sql query):

id x y
1539680 486522 240589
1539682 486522 240376
1539683 486531 240399
1539684 486540 240513
1539686 486563 240392

I also tried making sure the dtype of the data series matched exactly the osm_bayarea.h5 data but I also got the same error.
Edges

id
1840193    1534152
1840213    1534051
1855844    1534016
1855845    1534024
1855841    1534013
Name: from, dtype: int64
id
1840193    1533645
1840213    1533659
1855844    1534015
1855845    1534016
1855841    1534016
Name: to, dtype: int64
id
1840193     839.0
1840213    1644.0
1855844     200.0
1855845     758.0
1855841     313.0
Name: weight, dtype: float32

Nodes

id
1539680    486522.0
1539682    486522.0
1539683    486531.0
1539684    486540.0
1539686    486563.0
Name: x, dtype: float64
id
1539680    240589.0
1539682    240376.0
1539683    240399.0
1539684    240513.0
1539686    240392.0
Name: y, dtype: float64

The only significant difference is that the network is cropped from a larger graph we have, so the node ids don't start from 0 but from an arbitrary point, but I don't know if that affects this.

Thank you very much for your hard work on this package, it is very appreciated and I hope I can help.

Environment

  • Operating system: Ubuntu 16.04

  • Python version: 3.5

  • Pandana version: 0.4

Paste the code that reproduces the issue here:

net=pdna.Network(nodes["x"], 
                 nodes["y"],
                 edges["from"], 
                 edges["to"],
                 edges[["weight"]])

Paste the error message (if applicable):

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-10-12c11d512036> in <module>()
      3                  edges["from"],
      4                  edges["to"],
----> 5                  edges[["weight"]])

~/anaconda3/envs/test-environment/lib/python3.5/site-packages/pandana/network.py in __init__(self, node_x, node_y, edge_from, edge_to, edge_weights, twoway)
     84                                                           .astype('double')
     85                                                           .as_matrix(),
---> 86                             twoway)
     87 
     88         self._twoway = twoway

ana/src/cyaccess.pyx in pandana.cyaccess.cyaccess.__cinit__ (src/cyaccess.cpp:2186)()

ValueError: Buffer dtype mismatch, expected 'long' but got 'double'

Extracting node IDs in distances dataframe output by network.nearest_pois()

I have applied the .nearest_pois function to find out how well connected nodes within a network are in relation to their nearest hospital. I got positive results so far and stored the results in a data frame and .csv. However, for every poi (1-10) with an output distance, I am also interested in retrieving the ID of the hospital that this corresponds to in the cases where it found a point located within my threshold distance of 2000 m (See relevant bits of my code below). I.e. if this is my current output (data frame):

node id 1 2 3
[dist] 600 800 2000

I'd like a corresponding output (data frame) with:
node id 1 2 3
hosp1 hosp2 N/A ..

Would you be able to help? I looked at the function definitions in the network.py file to identify if there is another function or local variable within an existing function that returns such output.


Relevant bits of the code:

Initialise the network with the point of interest queries:

network.init_pois(num_categories=1,max_dist=2000,max_pois=10)

network.set_pois('hospitals',nodes['lon'],nodes['lat'])

Perform point of interest queries - I would like to obtain the node_ids

df = network.nearest_pois(2000,"hospitals",num_pois=10)

Installing pandana via conda does not install loaders correctly

I am running 64-bit Windows 8.1 with python 2.7 and have installed pandana 0.1.2 with the following code:

conda config --add channels synthicity
conda install pandana

pandana imports fine with:

import pandana

but it seems the loader scripts were not installed correctly. I get the following error running:

from pandana.loaders import osm
ImportError: No module named loaders
capture

Checking the pandana package directory in anaconda: C:\Anaconda\pkgs\pandana-0.1.2-py27_0 there are no loader subfolder or scripts.

As a work around, I tried installing pandana via the github zipfile and installation gets hung up when building _pyaccess. See below:

unnamed

Any ideas on the issue or potential solutions?

pandana revamp todo list

I'm opening an issue to keep track of my to do list for the pandana rewrite taking place here

The main purpose of the rewrite is to replace the C++ api wrapper pyaccesswrap.cpp with a cython wrapper which will be much easier to use going forward. Cython was around when I worked on this but it wasn't nearly as ubiquitous as it is these days.

In addition to that I should be able to fix:

  • style issues and general clunkiness in the C++ code
  • use scipy NN instead of ANN, which saves us from having to build ANN
  • the big one: not having global memory thus allowing Accessibility objects to be created and discarded on the fly #52

Here's the ongoing high level todo list:

  • port POI functions to cython
  • port aggregation functions to cython
  • port shortest path and precompute functions to cython
  • integrate with @federicofernandez scipy NN code
  • add unit tests for the cython wrapper (lower level tests)
  • get the old unit tests back up and running again

Small issues:

  • make sure #73 is still solved
  • check to see if nodes ids and locations are actually used in CH code - I don't think they are and can be removed from cython wrapper
  • addGraphalg doesn't have to be public - cython shouldn't know about graphAlg
  • think long and hard about which level is responsible for turning ids into indexes (CH requires indexes), in the context of #62
  • drop initialize_pois - use std::map internally, use strings for categories
  • drop initialize_acc_vars - use std::map internally, use strings for categories
  • pass in strings for decay and aggregation types, rather than ints
  • impedance ids should be strings not ints too (leaving this as-is)
  • check for memory leaks
  • add test for non integer node ids
  • there's probably a better way to return the POI node_ids
  • fix travis build issue for python3.5

Plotting function utilizes deprecated Basemap functions

Relevant traceback:

/usr/local/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py:1623: MatplotlibDeprecationWarning: The get_axis_bgcolor function was deprecated in version 2.0. Use get_facecolor instead.
  fill_color = ax.get_axis_bgcolor()
/usr/local/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py:3222: MatplotlibDeprecationWarning: The ishold function was deprecated in version 2.0.
  b = ax.ishold()
/usr/local/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py:3231: MatplotlibDeprecationWarning: axes.hold is deprecated.
    See the API Changes document (http://matplotlib.org/api/api_changes.html)
    for more details.
  ax.hold(b)

range graph removing edges

When constructing the network object I receive the following message:
'[info src/contraction_hierarchies/src/libch.cpp:205] Range graph removed 10 edges of 58364'

I looked and all the edges appear to use from and to nodes that exist in the nodes table. They also appear to have valid weight values. Are there are other reasons why these edges would be removed? Also, is there a way to query the network for the IDs of invalid/removed edges?

Remove the need of POIs initialization

Currently, it is necessary to call an initialization routine when adding POIs to a network:

net.init_pois(num_categories=1, max_dist=2000, max_pois=10)

As documented in the tutorial here

I tracked down the need for this initialization down to the CH code, and it seems that the need comes from the initialization of these data structures.

Then, it seems to be that a way to do that initialization on demand should exist.

It would be great to know @fscottfoti opinion about this.

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.