Coder Social home page Coder Social logo

Allow joining to nodes by type about pandana HOT 2 OPEN

udst avatar udst commented on September 28, 2024
Allow joining to nodes by type

from pandana.

Comments (2)

semcogli avatar semcogli commented on September 28, 2024

We explored this issue with the help from Fletcher and found a temporary solution. The idea behind is very simple: create a local road network and assign parcels with local nodes then perform accessibility queries on the full road network. The key here is to make sure local network nodes and full network nodes share the same node ids.

Here's a step by step instruction:

  1. Convert the two network shape files (all roads and local roads) to HDF5 format defined by pandana.
    During the conversion, make sure local nodes have the same IDs as the full network nodes. This can be done through matching their x,y coordinates.
  2. Create two networks using pandana.
    At the time of writing, pandana by default allows 1 network to be generated. So the first step is to use command
    pdna.network.reserve_num_graphs(2)
    to open the option for more than 1 network. Then create two networks net_full and net_local.
  3. Use local network to assign node ids to parcels. Parcels will get node ids from local network but those ids match corresponding node ids on the full network.
    parcels["node_ids"] = net_local.get_node_ids(x, y)
  4. Perform accessibility query using full network.
    example:
    net_full.set(parcels['node_ids'], variable=parcels.land_value, name="landv" )
    ave_landv= net_full.aggregate(10, type="ave", decay="flat",name="landv")

As a side note, spatial joining can also be done using python Rtree but we found its performance was much slower than pandana.

from pandana.

d-wasserman avatar d-wasserman commented on September 28, 2024

This is the general approach I have seen for network analysis as well. However, I generally just snap the parcels/origins to a local network (for the purposes of analysis I don't change the network, but the "locations" of the origins so that they would naturally snap to the right nodes). This approach is very similar and the difference is semantics. Generally it would be nice if the network assignment could be isolated to nodes by type for reasons beyond accessibility bias, but also the fact that it is easier to work with layered multimodal networks when this is the case. I second and think this would be good addition if it does not exist yet.

from pandana.

Related Issues (20)

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.