In [2]:
import json, shapely, fiona, os
import seaborn as sns
import pandas as pd
import geopandas as gpd
import networkx as nx
import matplotlib.pyplot as plt
%matplotlib inline
In [4]:
buildings = gpd.read_file('data/Building_Footprints.shp')
print("Found {0} buildings".format(len(buildings)))
buildings.head(1);
In [6]:
flood_extent = gpd.read_file('data/Flood2013Extents.shp')
flood_extent.head()
Out[6]:
In [10]:
flood_extent = flood_extent.to_crs(buildings.crs)
In [12]:
flooded_buildings = gpd.sjoin(buildings, flood_extent)
flooded_buildings.head()
In [16]:
with open('/home/cc/www/flooded_buildings.geojson','w') as outFile:
outFile.write(flooded_buildings.to_json())
print("Now open http://townsendjennings.com/geo/?src=http://yetilabs.science/flooded_buildings.geojson")
In [ ]: