Select to view content in your preferred language

Attribute Rule to calculate point in polygon across datastores using arcade

620
2
Jump to solution
07-22-2022 09:36 AM
JonathanPollack
Occasional Contributor

I want to do an Arcade point in polygon intersect.  My points ($feature) are in one datastore (SDE database), my polygons (districts) are in another.  Is this possible?  I also have these feature layers (registered) in our Enterprise environment.

 

// Create reference to the Districts layer
var districts = FeatureSetByName($datastore,"GIS_Infra.GISADMIN.PARK_P",["NAME"],true)

// Get a feature set of zones that intersect the new POINT
var intersectingDistricts = Intersects(districts, $feature)

0 Kudos
1 Solution

Accepted Solutions
JohannesLindner
MVP Frequent Contributor

A big limitation of Attribute Rules is that they only know about their own database. With eg Popups, you can access external data using the $map global or FeatureSetByPortalID(). None of these work in Attribute Rules, you are limited to $datastore.

A possible workaround seems to be to create a cross-database view of the external feature class in the database backend and register that view with the geodatabase. This way, you could use it in Attribute Rules. I haven't tested this and I doubt this is a supported workflow, so maybe try it in a test environment...
Solved: Access a field value in a layer that is outside th... - Esri Community

 

An easier solution would be to copy the districts to your database. Districts should be fairly static, so it shouldn't be too much work to keep the copy current. Just have an automated script recopying every night or do it manually every month or so. But of course, this approach clutters your database and introduces data redundancy, which is generally bad...


Have a great day!
Johannes

View solution in original post

0 Kudos
2 Replies
JohannesLindner
MVP Frequent Contributor

A big limitation of Attribute Rules is that they only know about their own database. With eg Popups, you can access external data using the $map global or FeatureSetByPortalID(). None of these work in Attribute Rules, you are limited to $datastore.

A possible workaround seems to be to create a cross-database view of the external feature class in the database backend and register that view with the geodatabase. This way, you could use it in Attribute Rules. I haven't tested this and I doubt this is a supported workflow, so maybe try it in a test environment...
Solved: Access a field value in a layer that is outside th... - Esri Community

 

An easier solution would be to copy the districts to your database. Districts should be fairly static, so it shouldn't be too much work to keep the copy current. Just have an automated script recopying every night or do it manually every month or so. But of course, this approach clutters your database and introduces data redundancy, which is generally bad...


Have a great day!
Johannes
0 Kudos
JonathanPollack
Occasional Contributor

Nice reply.  I like the view idea but I think I will just write an automated arcpy script with a spatial join or update curser to get the district.

0 Kudos