Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to streamline a model that identifies all zones that intersect each parcel in our Local Government Area (eg. Parcel x has Zone B1, B2 and E4). I am trying to make use of iterators in ArcGIS10. The problem is in bold italics below;

I have a Zones layer and a Parcels layer. I select all polygons of Zone A (using iterate feature selection) then do a select by location to get parcels that intersect those selected polygons. I now want to check if Field1 is empty, if it is, use calculate field to populate Field1 with the "Zone A" value used to select my zone in the first place. I then continue with some simple if-then-else logic and the model then iterates with Zone B. Screen Capture of my model I built a working version of this in ArcGIS 9.3.1 that works but it is extremely cumbersome and making small changes to the process is very time-consuming.

Any suggestions are much appreciated.

P.S. I have no python experience and only a little VB knowledge but if writing an arcpy script is the only solution to my problem then I'm more than happy to start learning!

share|improve this question

1 Answer 1

up vote 3 down vote accepted

When you say empty, do you mean "Null" or Empty like this: "" ? Pass the ZoneName value into the "Calculate Value" model tool. Then write a basic python function in the "code block" section of the calculate value tool. If values are null:

def getField(field) if field is none: return "Zone A"

then call the function in the "expression" section of the Calculate Value tool like this:

getField("%ZoneName%")

Select String for "Data Type"

Now pass that into value into your field calculation as ("%Value%")

share|improve this answer
    
That did the trick, thanks! –  Loz Jul 24 '12 at 22:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.