Select to view content in your preferred language

Field to Field by Location

1309
2
02-15-2019 09:26 AM
Status: Already Offered
deleted-user-yjvxGXQvvuHC
New Contributor II
  • It would be really cool to be able to select features by there location/proximity to one another and then update a field using any already existing field in the other layer based on the nearest neighbor.
    • I had a field worker collecting depth to nut for our water valves.  Depth to nut is not an inspection property but and actual attribute about the valve feature.  I need to have the field "depth to nut"  dumped into our valve layer, currently I will have to do this by hand....yikes! there are over 200!
  • Please ESRI... make loading field from field based on location. I included a picture to enhance the understanding of the features and the overlay.
    • Thanks a bunch!#water #utilities #valves #nuts #depths #field #dumpit
2 Comments
DavidCrawford

I think based your description.  You would be able to accomplish this task using a Calculation (or batch calculation) attribute rules. You can do proximity queries within an arcade script (as an exmample, buffering a polygon and locating features that are within that buffer):

var bufferPolygon = Buffer($feature,20,'feet')
var structureFeatures = FeatureSetByName($datastore, 'somedb.user.StructureJunction', ['objectid', 'someValue'], true)
var structureFeature = First(Intersects(structureFeatures, bufferPolygon))

You can then update attributes on the feature you are editing ($feature) or on the features returned from the query (I'm not certain which you are specifically requesting, based on the value from the other feature.

Calculation rules target a field, you would target the field to update on the feature you are editing, and return the value to add into that field:

return structureFeature.someValue

If, instead, you are attempting to update the features from within the buffer, you can return a DML dictionary to do the work for you:

var structureFeatures = Intersects(structureFeatures, bufferPolygon)

j=0

for(var structureFeature in structureFeatures)
{
structureFeatureEdits[j] = {'ObjectID':structureFeature.objectid, 'attributes':{'FIELD_TO_UPDATE':$feature.fieldToPulllValueToUpdate}}

j = j + 1 }

//return the target field back to the $feature, include the 'edit' DML dictionary //to edit the other features.
return{ 'result':$feature.TheTargetField,
'edit':[{
'className':'TheOtherClassBeingUpdated','updates':structureFeatureEdits
}]
}

 

Hope that helps, but for more examples the documentation is here:https://developers.arcgis.com/arcade/

And for a playground to try your hand at the scripting: https://developers.arcgis.com/arcade/playground/

 

MelissaJarman
Status changed to: Already Offered

There are Arcade functions available to use with attribute rules to accomplish this workflow.