{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Download" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Downloads the raw data files necessary to analyze Houston buildings found within flood zones." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import geopandas as gpd" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "import warnings\n", "warnings.simplefilter(\"ignore\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Buildings" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Download a list of all buildings published by the Harris County Appraisal District, as well as their tax districts" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " % Total % Received % Xferd Average Speed Time Time Time Current\n", " Dload Upload Total Spent Left Speed\n", "100 221M 100 221M 0 0 1163k 0 0:03:15 0:03:15 --:--:-- 2283k\n" ] } ], "source": [ "!curl -o input/Real_building_land.zip http://pdata.hcad.org/download/2017/Real_building_land.zip\n", "!curl -o input/Real_jur_exempt.zip http://pdata.hcad.org/download/2017/Real_jur_exempt.zip" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "After unzipping, convert them to CSVs." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "res = pd.read_csv(\n", " \"input/Real_building_land/building_res.txt\",\n", " delimiter=\"\\t\",\n", " dtype={\"ACCOUNT\": str},\n", " names=[\n", " 'ACCOUNT',\n", " 'USE_CODE',\n", " 'BUILDING_NUMBER',\n", " 'IMPRV_TYPE',\n", " 'BUILDING_STYLE_GUIDE',\n", " 'CLASS_STRUCTURE',\n", " 'CLASS_STRUCTURE_DESRICPTION',\n", " 'DEPRECIATION_VALUE',\n", " 'CAMA_REPLACEMENT_COST',\n", " 'ACCRUED_DEPR_PCT',\n", " 'QUALITY',\n", " 'QUALITY_DESCRIPTION',\n", " 'DATE_ERECTED',\n", " 'EFFECTIVE_DATE',\n", " 'YR_REMODEL',\n", " 'YR_ROLL',\n", " 'APPRAISED_BY',\n", " 'APPRAISED_DATE',\n", " 'NOTE',\n", " 'IMPR_SQ_FT',\n", " 'ACTUAL_AREA',\n", " 'HEAT_AREA',\n", " 'GROSS_AREA',\n", " 'EFFECTIVE_AREA',\n", " 'BASE_AREA',\n", " 'PERIMETER',\n", " 'PERCENT_COMPLETE',\n", " 'NBDH_FACTOR',\n", " 'RCNLD',\n", " 'SIZE_INDEX',\n", " 'LUMP_SUM_ADJ'\n", " ]\n", ")" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "jur = pd.read_csv(\n", " \"input/Real_jur_exempt/jur_value.txt\",\n", " delimiter=\"\\t\",\n", " dtype={\"ACCOUNT\": str, 'TAX_DISTRICT': str},\n", " names=[\n", " \"ACCOUNT\",\n", " \"TAX_DISTRICT\",\n", " \"TYPE\",\n", " \"PERCENT_IN_DISTRICT\",\n", " \"APPRAISED_VALUE\",\n", " \"TAXABLE_VALUE\"\n", " ]\n", ")" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "res['ACCOUNT'] = res.ACCOUNT.str.strip()\n", "jur['ACCOUNT'] = jur.ACCOUNT.str.strip()" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "res.to_csv(\"input/building_res.csv\", index=False)\n", "jur.to_csv(\"input/jur_value.csv\", index=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Parcels" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Download a map of the parcels where the buildings sit from the same source." ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " % Total % Received % Xferd Average Speed Time Time Time Current\n", " Dload Upload Total Spent Left Speed\n", "100 345M 100 345M 0 0 1240k 0 0:04:44 0:04:44 --:--:-- 1281k 3 10.6M 0 0 1292k 0 0:04:33 0:00:08 0:04:25 1505k 0 1372k 0 0:04:17 0:03:08 0:01:09 2216k\n" ] } ], "source": [ "!curl -o input/Parcels.exe http://pdata.hcad.org/GIS/Parcels.exe" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Flood zones " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Download the flood zones from FEMA [here](https://msc.fema.gov/portal/advanceSearch#searchresultsanchor)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 2", "language": "python", "name": "python2" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.14" } }, "nbformat": 4, "nbformat_minor": 2 }