#!/usr/bin/env python # coding: utf-8 # # Merge # Merge together the buildings and parcels file into a consolidated data set. # In[1]: import geopandas as gpd # In[2]: import warnings warnings.simplefilter("ignore") # ## Import the buildings # In[3]: buildings = gpd.pd.read_csv( "./output/buildings.csv", dtype={"ACCOUNT": str, "IN_HOUSTON": str} ) # ## Import the parcels # In[4]: parcels = gpd.read_file("./output/parcels.shp") # ## Merge the two files # In[5]: merged = parcels.merge( buildings, on="ACCOUNT", how="inner" ) # ## Clean up the columns # In[6]: merged.columns = [ 'account', 'condo', 'owner', 'address', 'city', 'zipcode', 'geometry', 'use', 'class', 'number', 'erected', 'houston', 'decade', ] # ## Output the result # In[7]: merged.to_file("./output/buildings-and-parcels.shp")