Weighted connectivity

[1]:
from blocksnet import City, WeightedConnectivity

city = City.from_pickle('../data/model.pickle')
[2]:
weighted_connectivity = WeightedConnectivity(city_model=city)
result = weighted_connectivity.calculate()
/Users/polina/Desktop/blocksnet/blocksnet/blocksnet/method/weighted_connectivity.py:71: RuntimeWarning: divide by zero encountered in divide
  house_to_service = np.outer(populations, service_counts) / mx.values
/Users/polina/Desktop/blocksnet/blocksnet/blocksnet/method/weighted_connectivity.py:71: RuntimeWarning: invalid value encountered in divide
  house_to_service = np.outer(populations, service_counts) / mx.values
/Users/polina/Desktop/blocksnet/blocksnet/blocksnet/method/weighted_connectivity.py:74: RuntimeWarning: divide by zero encountered in divide
  service_to_house = np.outer(service_counts, populations) / mx.values
/Users/polina/Desktop/blocksnet/blocksnet/blocksnet/method/weighted_connectivity.py:74: RuntimeWarning: invalid value encountered in divide
  service_to_house = np.outer(service_counts, populations) / mx.values
[3]:
result.head()
[3]:
geometry weighted_connectivity
id
0 POLYGON ((354918.622 6625258.829, 354901.464 6... 19.221452
1 POLYGON ((355412.142 6623378.149, 355411.700 6... 7.670383
2 POLYGON ((353934.329 6625429.433, 353923.453 6... 2.534715
3 POLYGON ((355099.099 6623847.765, 355074.808 6... 17.962766
4 POLYGON ((352766.168 6621954.748, 352744.412 6... 51.360120
[4]:
WeightedConnectivity.plot(result, figsize=(10,10))
../../_images/examples_methods_weighted_connectivity_4_0.png