SlideShare a Scribd company logo
Esri UK Scottish Conference 2018
Enhance your Maps with Arcade
Emma Sandison & Sarah Saint-Ruth
How do you make a map if the layer you’re
using doesn’t contain the data you need?
What is Arcade?
• Developed for ArcGIS
• Secure and portable expression language
• Manipulates text, performs mathematical
calculations and evaluates logical statements
• Simple!
•A full programming or scripting language
• A replacement for automation
Arcade is not…
Why have we developed Arcade?
Portability Simplification Security
Other benefits
Saves time Better maps
Demonstrations
RSPB garden bird watch survey
ArcGIS Pro label and popup expressions
Mailing Labels
ArcGIS Online web map popup and Web AppBuilder Public Information widget
Living Atlas - major earthquakes and UK census data
ArcGIS Online web map popups and symbology
Where can you find out more?
Arcade documentation: https://developers.arcgis.com/arcade/
Blogs: https://bit.ly/2xfCQwf
Videos: https://www.youtube.com/watch?v=wVfkgSl0sIA
Github expression repository: https://github.com/Esri/arcade-
expressions
Arcade examples gallery: https://bit.ly/2NPTQzT
Enhance your maps with arcade - Esri UK

More Related Content

Enhance your maps with arcade - Esri UK

  • 1. Esri UK Scottish Conference 2018 Enhance your Maps with Arcade Emma Sandison & Sarah Saint-Ruth
  • 2. How do you make a map if the layer you’re using doesn’t contain the data you need?
  • 3. What is Arcade? • Developed for ArcGIS • Secure and portable expression language • Manipulates text, performs mathematical calculations and evaluates logical statements • Simple! •A full programming or scripting language • A replacement for automation Arcade is not…
  • 4. Why have we developed Arcade? Portability Simplification Security
  • 6. Demonstrations RSPB garden bird watch survey ArcGIS Pro label and popup expressions Mailing Labels ArcGIS Online web map popup and Web AppBuilder Public Information widget Living Atlas - major earthquakes and UK census data ArcGIS Online web map popups and symbology
  • 7. Where can you find out more? Arcade documentation: https://developers.arcgis.com/arcade/ Blogs: https://bit.ly/2xfCQwf Videos: https://www.youtube.com/watch?v=wVfkgSl0sIA Github expression repository: https://github.com/Esri/arcade- expressions Arcade examples gallery: https://bit.ly/2NPTQzT

Editor's Notes

  1. 1. We’re going to introduce Arcade and show you some of the many ways in which Arcade can help you enhance your maps. If you ever start to question the value of Arcade and why we’d use it, this is a good question to come back to! ‘How do you make a map if the layer you’re using doesn’t contain the data you need?’ There’s never been so much Open Data available for us to use, but sometimes it just needs a bit of extra work to make it useful. Say you’ve found a Living Atlas layer with a population value - you want to normalise it and use this in your map’s popup. Since you don’t own the data, you can either contact the owner and ask if they can calculate a new field, or you download it and do it yourself – but then it’s not dynamic and won’t update if the data changes. Neither option’s ideal. This is the kind of problem Arcade addresses in the ArcGIS Platform. Arcade allows you to drive visualisations, popup content, and labels by a value returned from an expression rather than a field value.
  2. It’s an expression language that exists within ArcGIS – it’s not something you’d use in other software.   It’s secure and portable. Arcade expressions help you to communicate attributes meaningfully and consistently across your organisation.   An expression you create for labelling in ArcGIS Pro can also be used in ArcGIS Online. And the popups you create using Arcade in 2D web maps persist in 3D.   With Arcade, you can manipulate text, do calculations and evaluate logical statements like you do with other expression languages. And the main thing we want to emphasise is that it’s accessible to non-developers and that’s why we, rather than developers, are running this session! Arcade is not… A full programming language like JavaScript or Python. You’re not going to create an app using it. It’s also not a replacement for automation.
  3. We often get asked, ‘Why use Arcade when we have python? You can create expressions and complex labelling with python’. Well, unlike other languages, Arcade lets us write expressions for one app and use them in the others – so on mobiles, desktops, web apps, so there’s the portability aspect. There’s even a GitHub repository where folk can share expressions. Another thing, because it’s been written and optimised for ArcGIS, it’s quick and efficient to use. It helps make previously complex workflows accessible to everyday GIS users without having to understand complex syntax.   And because it can’t be read by anything else, nasty stuff like malicious code can’t be injected, so it’s more secure.
  4. Saves you time – removes the need to calculate new fields in your data and takes away the overhead of having to republish datasets when information updates. Maps can be more dynamic because the calculations are done on the fly using the latest data.   With the September update of ArcGIS Online, you can also dynamically calculate new field values in your hosted feature layers using Arcade, a bit like using field calculations in Excel. For example, given a numeric field representing tree health score of 1-3, you could populate a text field by conditionally writing ‘poor’, ‘satisfactory’ or ‘good’ depending on the score and use this more user-friendly text string to symbolise or label your map. So, Arcade expressions help make your maps nicer to use and easier to understand as you’ll see in the following demonstrations…
  5. I’ll start off showing how using Arcade in ArcGIS Pro labels and popups can help us better understand the data captured from the RSPB’s Big Garden Birdwatch survey. I’ll then show how Arcade can help generate better mailing labels in an ArcGIS Online WAB app. Sarah will then use Arcade expressions to enhance Living Atlas data in ArcGIS Online popups and symbology. A great feature of the platform is the amount of content available. An authoritative repository of content is the living atlas. If you’ve not had a chance to look at the living atlas yet there are some great global datasets which you can bring into your apps alongside UK specific datasets too. As mentioned by Emma one of the major benefits of using Arcade is being able to add values which aren’t currently in the dataset previously been resolved by either downloading the data or asking the data owner to add an additional field. Now with Arcade as seen in the prior demonstration, you can create the data you need without having to edit the underlying data. Let’s combine the If Statement functionality in the pop up to show different information that what is available in the source data. Here we have the 2011 Census UK Economic Activity from the Living Atlas. We want to find out whether those in full time employment are above or below the national average which is 38.48%. From the pop-up we can see the list of attributes and a chart describing the breakdown in percentage but there isn’t a way to see how that compares easily. Lets firstly get the full time as a percentage of the total economic activity for each area [Configure pop up and add Attribute Expressions] [Add first expression] Now we are going to return a string based on whether the area is above or below the national average. var fulltimeEmployment = $.KS601UK0003/$feature.KS601UK0001*100 if(fulltimeEmployment>38.48){ return "above the national average of 38.48" } else{ return "below the national average of 38.48" } Now we can use these two expressions to make a more meaningful pop up for the information we are trying to display. {NAME} has {expression/expr0}% for full time employment at {expression/expr1}%. See the below graph for a breakdown of employment in {NAME}. That is a simple example of how If Statements can be used to return new values. Now let’s have a look at what happens when we combine it with more advanced pop up configuration. Symbology We can also use Arcade natively in ArcGIS Online to visualise our data. In this example I have the Major Earthquakes layer available from the Living Atlas. I want to add a gauge to see how each of the earthquakes compare in smaller areas with high levels of activity when they measure between 1-10 in magnitude. Firstly, I add the same layer twice, and on one of them I use the Picture symbol to denote the gauge. Now on the second layer is where I use a needle symbol. The needle is currently at 225 and at the other side of the gauge is 135 degrees and therefore will travel through 270 degrees. var mag=$feature["EQ_PRIMARY"] var magPercent=mag/10*100 magPercent*2.7 Proportion the values over the gauge. I therefore add the feature in as a variable and divide by 10 as this is the maximum on our gauge and then * this become a %. We then need to * this by 2.7 to get the number of degree’s this needle should be rotated by.
  6. Arcade is becoming more proficient in the platform. This is further exemplified by the Aurora Project, which is a beta release of a new collector. The app already consumes services which have Arcade expressions and has its sights on using Arcade for Conditional logic, enrichment of data, inheritance of values from other features, grouping, and ordering of attributes. If you want to get started with Arcade there is now a GitHub to support your scripting.