psrc / urbansim2

3 stars 0 forks source link

Implement abstract within-walking-distance variable #32

Closed hanase closed 7 years ago

hanase commented 7 years ago

Needed for #9 and #10.

hanase commented 7 years ago

Instead of using the gridcells dataset (as in Opus), it may be implemented as a "within-given-radius" variable. In Opus, here is an example of such variable.

Currently, the KDTree function query_ball_tree is quite slow. See this thread for faster options, e.g. cKDTree.

hanase commented 7 years ago

Implemented using a cKDTree function in abstract_within_given_radius. The within-walking-distance variable uses a radius of 2000ft (is it reasonable?). See its usage in number_of_jobs_wwd.

hanase commented 7 years ago

The implementation is very slow. Need to find a different solution, maybe using pandana. Opened Issue #39.

hanase commented 7 years ago

After a conversation with Mike and Brian we decided to go ahead with our gridcell-based method of deriving wwd variables. The reasoning is we should not sacrifice speed for a measure that would not be that different, even if the price is to keep maintaining the gridcells table.

hanase commented 7 years ago

The abstract WWD variable is implemented in abstract_within_walking_distance_parcels which uses abstract_within_walking_distance_gridcells.

The size of a cell and a walking radius can be set in settings.yaml as nodes cell_size and cell_walking_radius (defaults are 150 and 600 meters respectively). Optionally, node wwd_correlate_mode can be given to determine how edges of the area are handled (default is "reflect", for details see the 'mode' argument of the convolve function).