Created
January 23, 2018 19:06
-
-
Save GuidoS/606d3db50501201af3bfe9dbd3e6b0ba to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# --------------------------------------------------------------------------- | |
# Lexington Build Out_Staff.py | |
# Created on: 2018-01-17 10:15:39.00000 | |
# (generated by ArcGIS / ModelBuilder) | |
# Description: | |
# --------------------------------------------------------------------------- | |
# Import arcpy module | |
import arcpy | |
# Local variables: | |
LexingtonParcels2015_AssessorData = \ | |
"R:\\Planning\\LexingtonPlanning.gdb\\LexingtonParcels2015_AssessorData" | |
LexingtonParcels2015_AssessorData_lyr = \ | |
"LexingtonParcels2015_Assesso" | |
ZoningDistricts_2016 = \ | |
"R:\\Planning\\LexingtonPlanning.gdb\\Zoning\\ZoningDistricts_2016" | |
ZoningDistricts_2016_Layer0 = \ | |
"ZoningDistricts_2016_Layer0" | |
Residential_Parcels = \ | |
"Residential Parcels" | |
Wetlands_MassDEP_2016 = \ | |
"R:\\Planning\\LexingtonPlanning.gdb\\Wetlands_MassDEP_2016" | |
Wetlands_MassDEP_2016_Layer = \ | |
"Wetlands_MassDEP_2016_Layer" | |
BuildOut_WetlandBuffer = \ | |
"R:\\Planning\\LexingtonPlanningWork.gdb\\BuildOut_WetlandBuffer" | |
BuildOut_WetlandBuffer_Union = \ | |
"C:\\Users\\dfields\\Documents\\ArcGIS\\Default.gdb" + \ | |
"\\BuildOut_WetlandBuffer_Union" | |
BuildOut_Parcel_NoWetland = \ | |
"BuildOut_Parcel_NoWetland" | |
BuildOut_WetlandBuffer_Model = \ | |
"R:\\Planning\\LexingtonPlanningWork.gdb\\BuildOut_WetlandBuffer_Model" | |
BuildOut_ConservationRestriction = \ | |
"R:\\Planning\\LexingtonPlanningWork.gdb\\BuildOut_ConservationRestriction" | |
BuildOut_CR_Model = \ | |
"R:\\Planning\\LexingtonPlanningWork.gdb\\BuildOut_CR_Model" | |
BuildOut_CR_Model_Output = \ | |
"BuildOut_CR_Model_Output" | |
ZoningDistricts_2016_Layer1 = \ | |
"ZoningDistricts_2016_Layer1" | |
BuildOut_RO = \ | |
"BuildOut_RO" | |
Buildout_RO__2_ = \ | |
"R:\\Planning\\LexingtonPlanningWork.gdb\\Buildout_Base\\Buildout_RO" | |
ZoningDistricts_2016_Layer2 = \ | |
"ZoningDistricts_2016_Layer2" | |
BuildOut_RS = \ | |
"BuildOut_RS" | |
Buildout_RS__2_ = \ | |
"R:\\Planning\\LexingtonPlanningWork.gdb\\Buildout_Base\\Buildout_RS" | |
ZoningDistricts_2016_Layer9 = \ | |
"ZoningDistricts_2016_Layer9" | |
BuildOut_RT = \ | |
"BuildOut_RT" | |
Buildout_RT__2_ = \ | |
"R:\\Planning\\LexingtonPlanningWork.gdb\\Buildout_Base\\Buildout_RT" | |
# Process: Make Feature Layer (2) | |
arcpy.MakeFeatureLayer_management( | |
LexingtonParcels2015_AssessorData, | |
LexingtonParcels2015_AssessorData_lyr, | |
"POLY_TYPE IN ('FEE', 'TAX' )") | |
# Process: Make Feature Layer (3) | |
arcpy.MakeFeatureLayer_management( | |
ZoningDistricts_2016, | |
ZoningDistricts_2016_Layer0, | |
'''ZONING_1 NOT IN( | |
'CB', 'CD-1', 'CD-10', 'CD-11', 'CD-12', 'CD-13', 'CD-14', 'CD-15', | |
'CD-16', 'CD-2', 'CD-3', 'CD-4', 'CD-5', 'CD-8', 'CD-9', 'CLO', 'CM', | |
'CN', 'CN-4', 'CRO', 'CRS', 'CS', 'RD-1', 'RD-10', 'RD-2', 'RD-3', | |
'RD-4', 'RD-5', 'RD-6', 'RD-7', 'RD-8', 'RD-9', 'GC')''') | |
arcpy.SelectLayerByLocation_management( | |
LexingtonParcels2015_AssessorData_lyr, | |
"HAVE_THEIR_CENTER_IN", | |
ZoningDistricts_2016_Layer0, | |
"", | |
"NEW_SELECTION", | |
"NOT_INVERT") | |
# Process: Make Feature Layer (4) | |
arcpy.MakeFeatureLayer_management( | |
LexingtonParcels2015_AssessorData_lyr, | |
Residential_Parcels, | |
"M155Assess.USE_CODE <> '132'") | |
# Process: Make Feature Layer | |
arcpy.MakeFeatureLayer_management( | |
Wetlands_MassDEP_2016, | |
Wetlands_MassDEP_2016_Layer, | |
"IT_VALDESC <> 'OPEN WATER'") | |
# Process: Buffer | |
arcpy.Buffer_analysis( | |
Wetlands_MassDEP_2016_Layer, | |
BuildOut_WetlandBuffer, | |
"50 Feet", | |
"FULL", | |
"ROUND", | |
"LIST", | |
"OBJECTID;WETCODE;IT_VALC;IT_VALDESC;POLY_CODE;PALIS_ID;PWSID;SOURCE;" + | |
"SOURCE_SCA;AREAACRES;AREASQMI", | |
"PLANAR") | |
# Process: Union | |
arcpy.Union_analysis( | |
"'Residential Parcels' #;R:\\Planning\\LexingtonPlanningWork.gdb\\BuildOut_WetlandBuffer #", | |
BuildOut_WetlandBuffer_Union, | |
"ALL", | |
"", | |
"GAPS") | |
# Process: Make Feature Layer (5) | |
arcpy.MakeFeatureLayer_management( | |
BuildOut_WetlandBuffer_Union, | |
BuildOut_Parcel_NoWetland, | |
"FID_BuildOut_WetlandBuffer=-1 AND POLY_TYPE IN('FEE','TAX')") | |
# Process: Copy Features (5) | |
arcpy.CopyFeatures_management( | |
BuildOut_Parcel_NoWetland, | |
BuildOut_WetlandBuffer_Model) | |
# Process: Union (2) | |
arcpy.Union_analysis( | |
"{} #;{} #".format( | |
BuildOut_WetlandBuffer_Model, | |
BuildOut_ConservationRestriction), | |
BuildOut_CR_Model, | |
"ALL", | |
"", | |
"GAPS") | |
# Process: Make Feature Layer (12) | |
arcpy.MakeFeatureLayer_management( | |
BuildOut_CR_Model, | |
BuildOut_CR_Model_Output, | |
"OLI_1_INT IS NULL AND " + | |
"FID_BuildOut_WetlandBuffer=-1 AND POLY_TYPE IN('FEE','TAX')") | |
# Process: Make Feature Layer (6) | |
arcpy.MakeFeatureLayer_management( | |
ZoningDistricts_2016_Layer0, | |
ZoningDistricts_2016_Layer1, | |
"ZONING_1 = 'RO'") | |
# Process: Select Layer By Location (2) | |
arcpy.SelectLayerByLocation_management( | |
BuildOut_CR_Model_Output, | |
"WITHIN", | |
ZoningDistricts_2016_Layer1, | |
"", | |
"NEW_SELECTION", | |
"NOT_INVERT") | |
# Process: Make Feature Layer (7) | |
arcpy.MakeFeatureLayer_management( | |
BuildOut_CR_Model_Output, | |
BuildOut_RO) | |
# Process: Copy Features (2) | |
arcpy.CopyFeatures_management( | |
BuildOut_RO, | |
Buildout_RO__2_) | |
# Process: Make Feature Layer (8) | |
arcpy.MakeFeatureLayer_management( | |
ZoningDistricts_2016_Layer0, | |
ZoningDistricts_2016_Layer2, | |
"ZONING_1 = 'RS'") | |
# Process: Select Layer By Location (3) | |
arcpy.SelectLayerByLocation_management( | |
BuildOut_CR_Model_Output, | |
"WITHIN", | |
ZoningDistricts_2016_Layer2, | |
"", | |
"NEW_SELECTION", | |
"NOT_INVERT") | |
# Process: Make Feature Layer (9) | |
arcpy.MakeFeatureLayer_management( | |
BuildOut_CR_Model_Output, | |
BuildOut_RS) | |
# Process: Copy Features (3) | |
arcpy.CopyFeatures_management( | |
BuildOut_RS, | |
Buildout_RS__2_) | |
# Process: Make Feature Layer (10) | |
arcpy.MakeFeatureLayer_management( | |
ZoningDistricts_2016_Layer0, | |
ZoningDistricts_2016_Layer9, | |
"ZONING_1 = 'RT'") | |
# Process: Select Layer By Location (4) | |
arcpy.SelectLayerByLocation_management( | |
BuildOut_CR_Model_Output, | |
"WITHIN", | |
ZoningDistricts_2016_Layer9, | |
"", | |
"NEW_SELECTION", | |
"NOT_INVERT") | |
# Process: Make Feature Layer (11) | |
arcpy.MakeFeatureLayer_management( | |
BuildOut_CR_Model_Output, | |
BuildOut_RT) | |
# Process: Copy Features (4) | |
arcpy.CopyFeatures_management( | |
BuildOut_RT, | |
Buildout_RT__2_) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment