Using Arcade Geometry functions in ArcGIS Online

8932
19
Jump to solution
12-12-2017 11:49 AM
XanderBakker
Esri Esteemed Contributor

I noticed that the December update of ArcGIS Online included Geometry Functions | ArcGIS for Developers . That is really swell, but I am trying to get my head around this and without the actual access to other features, I have problems seeing the benefits to this. 

Kelly Gerrow‌; or anyone else, is it possible provide some real-world examples of how this can be used. I suppose I could hard code another geometry storing the json in the arcade expression, but it does not seem as the right way to do this. 

Especially the SetGeometry intrigues me  ( Geometry Functions | ArcGIS for Developers ) I can imagine this it returns an error if I buffer a point feature and try to set the geometry, but when I apply it on a polygon, it returns that the geometry is immutable. 


Any example would be highly appreciated!

19 Replies
Nae_NayHirunpongchai
New Contributor

Hello Xander,

Do you mind to give me the link of your demo? Because I am a beginner in Arcade so i don't understand the variable of your code which line I should modify. So, please guide me if i would like to select the overlapping layer and it is shown in a pop-up.

Thank you and best,

Nae

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Nae Nay Hirunpongchai ,

The crime dataset that was used in the first example was published to the early adopters site, but I'm not sure if this could be shared outside. The second example is based on some clients data and I can't share that either. I could generate a random dataset to explain how the concept works, but in stead of doing that, why don't you explain what you are trying to achieve and if you can share (a sample of) the data we could look if that is something which can be achieved using the new Arcade functions.

0 Kudos
KellyGerrow
Esri Frequent Contributor

HI Nae Nay,

Here is a blog that outlines a simple example of how to populated a pop up with intersecting

feature information.

https://community.esri.com/community/gis/web-gis/arcgisonline/blog/2018/12/10/overlapping-features-i...

-Kelly

XanderBakker
Esri Esteemed Contributor

Hi gisday.02 , 

In addition to the great blog post by Kelly Gerrow‌, there is a new blog post by Paul Barker  here:

What’s new with Arcade: Taking a stroll through FeatureSets (Part 1) 

And I just posted another one here: Using FeatureSetBy functions in Arcade to drill-down to other layers and tables   

0 Kudos
NaomiBegg
Occasional Contributor

I really really want this too!  Especially as we largely work with live datasets rather than static copies which is why the intersect script is invaluable to us.

0 Kudos
LukeAllen2
Occasional Contributor

Xander Bakker‌ Hi Xander, sorry to hijack this post, but I know you are very experienced with pop-up customization in AGOL. I wanted to ask if you knew if it is possible to change the color of fields displayed in a popup when using the popup display setting "A list of field attributes" alot of the customization I see online has all been for a custom attribute display (which isnt ideal for me as I want to make an app where by the fields can be edited).

Thanks for any input!

Luke

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Luke Allen ,

As you noticed, creating a table and assign colores can be accomplished using custom HTML in the pop-up. At this moment this requires multiple Arcade expression. In the (near?) future it will be able to return html enabling the use of a single Arcade expression to create the HTML output you want.

For an editing workflow, I'm afraid that the custom HTML code will not be used. This workflow will probably require custom coding the editing experience. Can you share a sketch of what you want to obtain to evaluate if there are any other plausible options?

0 Kudos
LukeAllen2
Occasional Contributor

Hi Xander Bakker, thats ok I understand, thank you for taking your time to respond to my post.

My coding capabilities are rather limited shall we say so this isnt a deal breaker for me. My web app was just a basic web app with a feature service that could have the fields updated using the smart editor widget. For one of the fields I have a domain (string values) of 'Not Tested' 'Not Applicable' and 'Tested', I was just thinking it would be nice to be able to color code them within the attribute window.

Web App Builder Pic

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Luke Allen ,

So the pop-up could be color code, yet that would require a custom HTML configuration. The Smart editor widget will not be influenced by this. However, why don't you visualize your polygons using a combination of WQ Status and WQ Result showing which ones have been tested and which one not and in case tested the result of the test? 

0 Kudos
LukeAllen2
Occasional Contributor

Hi Xander Bakker, actually my polygons are coded by the domain I mentioned earlier (unfortunately the screenshot only shows some of the untested (orange) parcels, just for extra 'bells and whistles' I was going to color code the attribute field red for not tested and green for tested on the popup - like i said not a major deal breaker, I just was wondering if it could be done

0 Kudos