Select to view content in your preferred language

Populate point feature with value from underlaying polygon layer

04-14-2022 10:05 AM
New Contributor II

I am creating a task where there are many steps to create and assign an address to a point feature. One of the steps I am trying to automate is to have information taken from some polygons that the point feature falls within. I know I can do a spatial join but the problem is, I don't want to end up with a bunch of extra tables from the join. Does anyone know another way to accomplish this? Maybe a script?



0 Kudos
3 Replies
MVP Esteemed Contributor

You can use a spatial intersection in a field calculation. I've done a very similar process to what you describe using Arcade:

var portal = Portal('your portal url')

var polygons = FeatureSetByPortalItem(
    'itemid of polygon layer',
    ['the field you need'],

// get first intersecting polygon
var xs = First(Intersects($feature, polygons))

// return value of desired field
return xs['the field you need']

If you're working with local layers as opposed to services, you can still pull in those other features with different FeatureSet functions in Arcade. 

- Josh Carlson
Kendall County GIS
0 Kudos
New Contributor II

Thanks! I will check this out.

0 Kudos
New Contributor II

So my data is not from Portal so I assume I would use FeatureSetbyName()

Below is what I am working with:

My Zip code layer is named  GISMAIN.DBO.qc_ZipCodes

The field I need to grab data from is "GEOID10"


My dataset that needs the Zip Code appended in is called Addressses_TestData


I basically need to make the user be able to click to add the address point, and have it populate the Zip field with the data from the layer under it. 


0 Kudos