Help with model / modelbuilder: using iterator to calculate string values from one shapefile to another

613
1
02-21-2022 06:10 PM
Labels (1)
ChrisVan
New Contributor

In short I have 

  • a polygon shapefile with 100's of polygons (PolygonShapefile)
  • within the shapefile there is a field (string) that is MeadowID
  • i want to automate the selection of all the points (from PointShapefile with 1000's of points) that fall within each polygon
  • once they are selected I want to calculate the field within the selected points to equal the string MeadowID
  • and repeat the process for all polygons
  • both fields are type 'string' in the PolygonShapefile and PointShapefile

 

The problem is whenever the MeadowID string includes alphabetical characters, the model falls apart, if it's just numeric values, the model works fine. However, sadly alphabetical characters are a must. 

I've tried all sorts of things and just can't get it to work with strings. Can someone please point out what I'm doing wrong here or give me some guidance? would be greatly appreciated. Cheers

 

 

 

 

This is the modelThis is the model

This is the configuration for 'Get Field Value'This is the configuration for 'Get Field Value'

This is the configuration for 'Calculate Field'This is the configuration for 'Calculate Field'

0 Kudos
1 Reply
RhettZufelt
MVP Frequent Contributor

what is the field type/length for MeadowID in the subsetPointShapefile?

The "Model falls apart" is not very descriptive of the error that is happening, but it sounds like maybe you are trying to calculate a text value (sMeadowID) into a numeric field.

Of course, the spatial join tool will do this same thing in one swoop without iterating through the data.

R_

 

0 Kudos