Select to view content in your preferred language

Model Builder: Creating Locator Only Works on After Feature Class is Created

380
0
07-09-2019 12:48 PM
ChiansonSiu
New Contributor

I am trying to use Model Builder to create an Address Locator. My steps are: 

1. Take an input FC and run a vertices feature to point geoprocess

2. Output this to another feature class

3. Add additional address field

4. Add x, y fields

5. Run a python script to calculate the address field in step 3 (no new fields are added, just the current ones are updated).

6. If python script is successful, precondition is set to true for the Locator

7. Create the Locator (General - single field) with the output FC that I added the additional fields and x, y data to

If I try to validate the model, everything gets filled in except for the Locator box. It says 'not enough reference data for this style'. The Locator is using General - single field. The Locator is using the field created in step 3 as the KeyField, which is calculated in the python script from step 6. In general, the script just takes the address parts which are separated into different columns (e.g. street name, number, city, state, zip) and concatenates them all into one field, blurring the address number by doing some custom rounding.

I then run the model in edit mode, and it stops after step 6. No errors, everything worked.

Then I validate the model a second time, and everything gets filled in including the Locator box. Now I am able to run the model successfully from start to finish outside of edit mode.

I think its because the feature class and field that the Locator is looking for is not yet created before the model  runs. Once I delete the feature class created from step 1 / step 2, then the Locator box becomes unfilled again.

Is there a way around this? Or have I approached this model incorrectly?

0 Kudos
0 Replies