-
Notifications
You must be signed in to change notification settings - Fork 0
/
Revised_2.2.py
18 lines (12 loc) · 1.24 KB
/
Revised_2.2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import arcpy
scratch_ws = r"P:\Projects3\CDT-CEQA_California_2019_mike_gough\Tasks\CEQA_Parcel_Exemptions\Data\Intermediate\Scratch\Scratch.gdb"
urbanized_area_prc_21071_input = r"P:\Projects3\CDT-CEQA_California_2019_mike_gough\Tasks\CEQA_Parcel_Exemptions\Data\Intermediate\Intermediate.gdb\urbanized_area_prc_21071"
urban_area_prc_21094_5_output = r"P:\Projects3\CDT-CEQA_California_2019_mike_gough\Tasks\CEQA_Parcel_Exemptions\Data\Intermediate\Intermediate.gdb\urban_area_prc_21094_5"
#arcpy.CopyFeatures_management(urbanized_area_prc_21071_input, urban_area_prc_21094_5_output)
arcpy.AddField_management(urban_area_prc_21094_5_output, "urban_area_prc_21094_5", "SHORT")
urban_area_prc_21094_5_output_layer = arcpy.MakeFeatureLayer_management(urban_area_prc_21094_5_output)
expression = "community_type = 'Incorporated City' or urbanized_area_prc_21071 = 1"
arcpy.SelectLayerByAttribute_management(urban_area_prc_21094_5_output_layer, "NEW_SELECTION", expression)
arcpy.CalculateField_management(urban_area_prc_21094_5_output_layer, "urban_area_prc_21094_5", 1)
arcpy.SelectLayerByAttribute_management(urban_area_prc_21094_5_output_layer, "SWITCH_SELECTION")
arcpy.CalculateField_management(urban_area_prc_21094_5_output_layer, "urban_area_prc_21094_5", 0)