Giter VIP home page Giter VIP logo

streetcontinuity's Introduction

StreetContinuity (SC)

StreetContinuity (SC) is a python library that implements both Intersection Continuity Negotiation (ICN) and Hierarchical Intersection Continuity Negotiation (HICN). ICN was first proposed by Porta et al. (2006) and further enhanced by Masucci et al. (2014), who advanced with the HICN approach.

For details about each implementation, please refer to:

Acknowledgement

I want to thank Elisabeth H. Krueger and Xianyuan Zhan, who provide me with their version of the HICN. Their code gave some insights and helped in the process of validation of the results.

For details about their implementation, please refer to:

Dependencies

  • numpy (1.15.4)
  • osmnx (0.8.1)
  • networkx (2.1)

Instalation (for developers)

After downloading the SC library, install it on Python 3 using the following commands:

pip3 install . --user

Example

import osmnx as ox
from street_continuity.all import *

# load the primal graph from osmnx
oxg = ox.graph_from_point((-22.012282, -47.890821), distance=5000)
p_graph = from_osmnx(oxg=oxg, use_label=True)

# alternatively, you can load the graph from a csv file
# p_graph = read_csv(nodes_filename='test-nodes.csv', edges_filename='test-edges.csv', directory='data', use_label=True, has_header=False)

# maps the primal graph to the dual representation
# use_label = True: uses HICN algorithm
# use_label = False: uses ICN algorithm
d_graph = dual_mapper(primal_graph=p_graph, min_angle=90)

# you must create the data directory before running this command
dxg = write_graphml(graph=d_graph, filename='file.graphml', directory='data')
write_supplementary(graph=d_graph, filename='supplementary.txt', directory='data')

Result

This is the resulting graph using Gephi (0.9.2) and OpenOrd layout with default parameters:

Primal and Dual Graph

Primal Graph (from OSMNX) on the left and Dual Graph (from StreetContinuity) on the right.

streetcontinuity's People

Contributors

gabrielspadon avatar lucasscabora avatar

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.