Integration

Prepare city

The method is time consuming, so for the demonstration we will mask some of the blocks.

[1]:
from blocksnet import City, Accessibility

city = City.from_pickle('../data/model.pickle')
[2]:
blocks = city.get_blocks_gdf(True)
nearest_blocks = blocks.sjoin_nearest(blocks[blocks.index == 1445], distance_col='distance')
nearest_blocks = nearest_blocks[nearest_blocks['distance']<=3000]
nearest_blocks.plot().set_axis_off()
../../_images/examples_methods_integration_2_0.png
[3]:
city._blocks = {i:city[i] for i in nearest_blocks.index}

Method

[5]:
from blocksnet.method.integration import Integration, IntegrationType

integ = Integration(city_model=city)
[6]:
for integration_type in IntegrationType:
  res = integ.calculate(integration_type)
  res = integ.clusterize(res)
  integ.plot(res, column='integration')
  integ.plot(res, column='cluster')
../../_images/examples_methods_integration_6_1.png
../../_images/examples_methods_integration_6_2.png
../../_images/examples_methods_integration_6_3.png
../../_images/examples_methods_integration_6_4.png