Skip to main content

I am trying to populate one attribute field (Main) based on a spatial relationship in a file geodatabase. I have mains and laterals. Our mains have a field called "Main_ID". I want to populate our lateral attribute field "Main" based on the main that the lateral touches. Seems like a pretty simple problem. I've tried the spatial relator, but that actually adds the geometry (essentially doubling the number of laterals). I don't want to write out or replace any geometry, just populate that one attribute field.

Any suggestions?

I would use either SpatialFilter (merge the attributes and if necessary first remove all attributes except the ID from the main) or the NeighborFinder (same setting).


@erik_jan Thanks. That sort of worked. I got it to add the attribute, but it is still writing features, so now I have duplicate laterals, one with the main field populated correctly and one that is still blank. How do I get it to just populate the attribute, not write out another feature?


@erik_jan Thanks. That sort of worked. I got it to add the attribute, but it is still writing features, so now I have duplicate laterals, one with the main field populated correctly and one that is still blank. How do I get it to just populate the attribute, not write out another feature?

How do you write your data?

You can use the Feature Operation on the table, set to Update to update the existing laterals based on ID.


I would use either SpatialFilter (merge the attributes and if necessary first remove all attributes except the ID from the main) or the NeighborFinder (same setting).

@erik_jan - I still cannot seem to get this to work 100%. I used the NeighborFinder on the lateral/main union and that works great now, but for the lateral/parcel one I need to use the intersect predicate. It runs, finds everything, and says it is writing, but nothing does write. I have sent it to support, but wanted to post it here in case anyone else has run into it.

Thanks for your time.


Reply