Using a Select By Location in Python and Calculating a field based on what State Plan

المشرف العام

Administrator
طاقم الإدارة
Here's what I have so far. Do I need to make another feature layer based on the selection?

import arcpy arcpy.MakeFeatureLayer_management(r"PATH TO THE POINT", "point_lyr") arcpy.MakeFeatureLayer_management(r"PATH OF THE STATEPLANE", "stPlane_lyr") arcpy.SelectLayerByLocation_management("point_lyr", "INTERSECT", "stPlane_lyr") Here's the updated Script for each state plane zone

#Feature layers Point_Layer = "Point_Layer" CP_Layer = "CP_Layer" IntersectLayerCON = "IntersectLayerCON" # Process: Make Feature Layer for the SMON Points arcpy.MakeFeatureLayer_management(SMONPoint, Point_Layer, "", "", "FID FID VISIBLE NONE;Shape Shape VISIBLE NONE;link_fld link_fld VISIBLE NONE;State State VISIBLE NONE") # Process: Make Feature Layer for the Control Points arcpy.MakeFeatureLayer_management(ControlPoint, CP_Layer, "", "", "FID FID VISIBLE NONE;Shape Shape VISIBLE NONE;link_fld link_fld VISIBLE NONE;State State VISIBLE NONE") # Process: Make Feature Layer for Intersection Shapefiles arcpy.MakeFeatureLayer_management(IntersectLayer, IntersectLayerCON, "", "", "FID FID VISIBLE NONE;Shape Shape VISIBLE NONE;OBJECTID OBJECTID VISIBLE NONE;ZONE ZONE VISIBLE NONE;ZONENAME ZONENAME VISIBLE NONE;FIPSZONE FIPSZONE VISIBLE NONE;SQMI SQMI VISIBLE NONE;COLORMAP COLORMAP VISIBLE NONE;Shape_Leng Shape_Leng VISIBLE NONE;Shape_Area Shape_Area VISIBLE NONE") #This will calculate the fields labeled the correct STATE PLANE zone # Process: Select Layer By Location for SMON arcpy.SelectLayerByLocation_management(Point_Layer, "INTERSECT", IntersectLayerCON, "", "NEW_SELECTION") # Process: Calculate Field for SMON arcpy.CalculateField_management(Point_Layer, "StatePlane", "\"Colorado North\"", "VB", "") arcpy.CalculateField_management(Point_Layer, "State", "\"Colorado\"", "VB", "") It will just calculate the fields for state and state plane.



أكثر...
 
أعلى