1

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.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
MjonesGEO
  • 791
  • 1
  • 10
  • 27
  • Could you elaborate on the question? I am not exactly sure what are you trying to achieve. – Alex Tereshenkov Jan 16 '14 at 20:40
  • I'm trying to calc a field in my point feature class based off of what state plane zone it falls into which is a different feature class. – MjonesGEO Jan 16 '14 at 21:59
  • So, say you have 10 points in a fc (PointFC), 10 polygon fcs (each for each state plane zone) (StateZoneX) and then one reference polygon fc (AssignPoly). You take first point, check its location > say it is located within feature polygon in AssignPoly named StateZone1. Then you append this point feature to the feature class StateZone1. Did I get it right? – Alex Tereshenkov Jan 17 '14 at 06:47
  • Yes, I ended up just exporting the state plane zones into seperate shapes – MjonesGEO Jan 22 '14 at 17:00
  • I've posted an answer just in case you want to improve your code :) – Alex Tereshenkov Jan 23 '14 at 07:56

1 Answers1

1

You can develop this workflow in either ModelBuilder or by using ArcPy.

ModelBuilder: you can refer to this post to see an example of model which you need to create. You basically have to make multiple selections on points and then export those feature layers into new feature classes. An Iterate Feature Selection iterator would help here.

Python: basically the same workflow and it might be actually more concise code-wise. I would get first unique values of state planes you have in your feature class.

def unique_values(table, field):
    with arcpy.da.SearchCursor(table, [field]) as cursor:
        return sorted({row[0] for row in cursor})

then iterate over the list and use each state plane name value as input for a selection expression. The resulting selection feature layer will be used to create a new feature class on disk (use Copy Features GP tool for that).

Alex Tereshenkov
  • 29,912
  • 4
  • 54
  • 119