Created
July 18, 2018 05:02
-
-
Save kapadia/6434d78b43aa8695a9500abe858f0c30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 11, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"import fiona as fio" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 20, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"mono_parcels_url = \"https://gis.mono.ca.gov/Downloads/Data/Cadastral/Tax_Parcels.zip\"\n", | |
"inyo_parcels_url = \"http://www.inyocounty.us/gis/Parcels_shp.7z\"" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 30, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ | |
"%%capture\n", | |
"\n", | |
"! wget --no-clobber {mono_parcels_url} -O Tax_Parcels.zip\n", | |
"! wget --no-clobber {inyo_parcels_url} -O Parcels_shp.7z" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 31, | |
"metadata": { | |
"collapsed": false, | |
"scrolled": true | |
}, | |
"outputs": [], | |
"source": [ | |
"%%capture\n", | |
"\n", | |
"! 7z x -y Parcels_shp.7z" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 33, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"APN\n", | |
"Inyo_Zonin\n", | |
"GP\n", | |
"PIN\n", | |
"AssessYear\n", | |
"PersProp\n", | |
"LandVal\n", | |
"ImproveVal\n", | |
"TotalVal\n", | |
"ExemptVal\n", | |
"FixtureVal\n", | |
"UseCode\n", | |
"TxRateArea\n", | |
"LegalDescr\n", | |
"PropClass\n", | |
"ParcAdd1\n", | |
"ParcAdd2\n", | |
"ParcCity\n", | |
"ParcState\n", | |
"ParcZIP\n", | |
"Neighborhd\n", | |
"Width\n", | |
"Depth\n", | |
"LotSqFeet\n", | |
"LotAcres\n", | |
"LotType\n", | |
"ObjectCoun\n", | |
"RSaleDate\n", | |
"SqFeet_gis\n", | |
"Acres_gis\n", | |
"RECORD_DOC\n", | |
"Shape_STAr\n", | |
"Shape_STLe\n" | |
] | |
} | |
], | |
"source": [ | |
"# Inyo County's parcel shapefile contains information about\n", | |
"# property value through fields\n", | |
"# * LandVal\n", | |
"# * ImproveVal\n", | |
"# * TotalVal\n", | |
"# * ExemptVal\n", | |
"# * FixtureVal\n", | |
"\n", | |
"inyo_parcels_filepath = \"./Parcels_shp/COI_parcels_20180706.shp\"\n", | |
"with fio.open(inyo_parcels_filepath) as src:\n", | |
" for k, _ in src.schema['properties'].iteritems():\n", | |
" print k" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 26, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"AsmtNum\n", | |
"PrntAsmtNu\n", | |
"Complex\n", | |
"FullStreet\n", | |
"FullAddres\n", | |
"Address\n", | |
"StreetPref\n", | |
"Street\n", | |
"StreetSuff\n", | |
"Unit\n", | |
"Building\n", | |
"Floor\n", | |
"Community\n", | |
"LUD\n", | |
"Zoning\n", | |
"StatedArea\n", | |
"CalcAcres\n", | |
"TransientR\n", | |
"ParcelType\n", | |
"DivType\n", | |
"SupDist\n", | |
"Supervisor\n", | |
"VotingPrct\n", | |
"FD_Name\n", | |
"SD_Name\n", | |
"WD_Name\n", | |
"CSD_Name\n", | |
"SA_Name\n", | |
"PUD_Name\n", | |
"Flood\n", | |
"FloodZone\n", | |
"Fault\n", | |
"Avalanche\n", | |
"Wildland\n", | |
"NDDB_EO\n", | |
"NDDB_ElemN\n", | |
"NDDB_ElemC\n", | |
"NDDB_FedLi\n", | |
"NDDB_CALis\n", | |
"LegalStart\n", | |
"LegalEndDa\n", | |
"Latitude\n", | |
"Longitude\n", | |
"HistAPN\n", | |
"created_us\n", | |
"created_da\n", | |
"last_edite\n", | |
"last_edi_1\n", | |
"GlobalID\n", | |
"Shape_STAr\n", | |
"Shape_STLe\n" | |
] | |
} | |
], | |
"source": [ | |
"# Mono County's shapefile does not have any fields relevant to\n", | |
"# property value. Any adivce\n", | |
"\n", | |
"mono_parcels_filepath = \"./Tax_Parcels.zip\"\n", | |
"with fio.open('/TaxParcels.shp', vfs=\"zip://{}\".format(mono_parcels_filepath)) as src:\n", | |
" for k, _ in src.schema['properties'].iteritems():\n", | |
" print k" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"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.12" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment