[polygons/osm] Adding a unified neighborhood reverse geocoder incorporating Zetashapes, OSM and Quattroshapes. Uses the new Soft TFIDF implementation to approximately match OSM names to Quattroshapes/Zetashapes names and geohash indices for more coarse point-in-polygon tests (OSM neighborhoods are stored as points not polygons, so need to match with a geometry from the other sources)

This commit is contained in:
Al
2015-10-31 14:15:39 -04:00
parent a38624ba59
commit 3e43ac7255
3 changed files with 434 additions and 58 deletions

View File

@@ -2,6 +2,13 @@ VISIT, VISIT_EDGE, POST_VISIT = range(3)
def strongly_connected_components(graph):
'''
Find strongly connected components in a graph using iterative
depth-first search.
Based on:
http://code.activestate.com/recipes/578507-strongly-connected-components-of-a-directed-graph/
'''
identified = set()
stack = []
index = {}