Skip navigation
All Places > GIS > Web GIS > ArcGIS Online > Blog
1 2 3 Previous Next

ArcGIS Online

120 posts

I've had a longstanding need to visualize, query, and filter features using values from a related table, and came up with the following solution, which works great for my use case.

 

The use case involves managing stormwater catch basin inspection and cleaning (I've simplified the workflow for purposes of this post). The customer wanted field workers to be able to open Collector and quickly see basins that need attention or haven't been inspected/cleaned in over a year, and provide that same information in a dashboard. 

 

It's very easy to set up:

 

  1. Add fields to the feature layer to hold the attributes to bring over from the related table
  2. Grab the most recent record from the related table, and write values from that record over to the feature layer using the ArcGIS API for Python
  3. Put script on PythonAnywhere and set it to run every 60 seconds
  4. Configure web map symbology with a simple Arcade expression to show expired and failed inspections

 

Details on each step above:

 

  1. Self-explanatory. I named the fields "Status" and "LastCleaning".
  2. Wrote the script shown at the end of this post to grab records from the related table from the past day, sort them by time and drop duplicate records related to an asset (in case there were two inspection/cleaning records within the past 24 hours -- for example, a failed inspection on Wednesday afternoon was resolved on Thursday morning), then use a unique identifier ('FacilityID') to update the asset with data from the most recent inspection/cleaning. Shout out to Michael Duncan for help with the date query.
    from arcgis import GIS
    from arcgis.features import FeatureLayer
    import pandas as pd
    from arcgis.features import SpatialDataFrame
    from datetime import datetime, timedelta
    import time

    gis = GIS(f"https://someorg.maps.arcgis.com", 'someuser', 'somepass')

    def update_basins():
        one_day = datetime.today() - timedelta(days=1)
        string_day = one_day.strftime('%Y-%m-%d %H:%M:%S')
        where_query = f"DateInspected >= DATE '{string_day}'"

        catch_basins = gis.content.get('21343f6579b74cf212576e5614db8866')
        catch_basins_lyr = catch_basins.layers[0]
        catch_basins_sdf = SpatialDataFrame.from_layer(catch_basins_lyr)
        catch_basins_fset = catch_basins_lyr.query()
        catch_basins_features = catch_basins_fset.features

        cleanings_url = 'https://services9.arcgis.com/iERASXD4kaw1L6en/arcgis/rest/services/this_is_an_example/FeatureServer/1'
        cleanings_lyr = FeatureLayer(cleanings_url)
        cleanings_sdf = SpatialDataFrame.from_layer(cleanings_lyr)
        cleanings_fset = cleanings_lyr.query(where=where_query, out_fields='DateInspected, FacilityID, Status')
        cleanings_features = cleanings_fset.features

        df=cleanings_sdf.sort_values('DateInspected', ascending=False)
        df=df.drop_duplicates(subset="FacilityID")

        overlap_rows = pd.merge(left = catch_basins_sdf, right = df, how='inner', on = 'FacilityID')
        catch_basin_features = catch_basins_fset.features
        cleaning_updates = cleanings_fset.features
        cleaning_updates.reverse()

        def update(basins, cleanings):
            for FacilityID in overlap_rows['FacilityID']:
                try:
                    basin_feature = [f for f in catch_basin_features if f.attributes['FacilityID'] == FacilityID][0]
                    cleaning_feature = [f for f in cleanings_features if f.attributes['FacilityID'] == FacilityID][0]
                    basin_feature.attributes['LastCleaning'] = cleaning_feature.attributes['DateInspected']
                    basin_feature.attributes['Status'] = cleaning_feature.attributes['Status']
                    catch_basins_lyr.edit_features(updates=[basin_feature])
                    print(f"Updated {basin_feature.attributes['FacilityID']} status to {basin_feature.attributes['Status']}", flush=True)
                except:
                    continue

        update(catch_basins_features, cleaning_updates)

    while True:
        update_basins()
        time.sleep(60)

     

  3. Set up an "Always-On" task on PythonAnywhere to continually run the script. This is a very easy process. Just set up a PythonAnywhere account (the free tier would probably be fine for this application), upload your script file, and add the script on the Tasks tab as an Always-On Task. Now, the script writes the most recent inspection/cleaning record to the catch basins attribute table every 60 seconds:
  4. And lastly, just a simple Arcade expression to symbolize by the status of each basin (Current, Expired, or Needs Attention):
    var present = Now()
    var last_cleaning = $feature.LastCleaning
    var cleaning_age = DateDiff(present, last_cleaning, 'years');

    If (cleaning_age < 1 && $feature.Status == 'CleaningComplete') {
        return "Current"
    } else if ($feature.Status == 'NeedsAttention') {
        return "Needs Attention"
    } else if (cleaning_age > 1) {
        return "Expired"
    } else if (IsEmpty($feature.Status)) {
        return "Record missing or incomplete"
    }

 

I hope this is helpful to someone. Feel free to offer suggestions or ask questions. Hang in there everyone!

A Message from Blake Bilbo, Head of Customer Support

During these times, it’s absolutely critical for all GIS teams to make the best possible use of their time and available resources. Taking advantage of the right tools to ensure objectives and responsibilities are accomplished quickly is imperative. To any ArcGIS Online Administrators, or Administrators you may know: Please be aware that there is a FREE version of Admin Tools for ArcGIS Online on the ArcGIS Marketplace that we encourage everyone to take advantage of, if they are not already doing so.

To put this in perspective, many day-to-day administrative tasks will be streamlined and performed in bulk. Rapid access to items, users, and groups throughout an entire Organization via advanced filtering and sorting is supported. There is also the capability to add tags to users, as well as items and groups for important classification on-the-fly as situations develop, and emailing users in bulk ensures everyone in the Organization can be contacted with important information and updates as needed.

For very fluid environments and response, users can rapidly be invited to groups and items can be shared to those groups in bulk. Admin Tools also supports bulk updates to users’ roles as well as their Esri access. In situations where responsibilities and tasks may frequently shift from one user to another, item ownership can be quickly updated and changed. To protect an Organization’s items, delete protection can be turned on in bulk across all items.

Again, we ask that every ArcGIS Online Administrator be taking advantage of these free tools if they are not already doing so. I am also encouraging anyone coordinating with other ArcGIS Administrators and colleagues to share this message to ensure everyone has access to these tools. For any questions, please reach out to us at connect@geo-jobe.com.

Thank you, best wishes, stay healthy, and stay productive!

 

Most of us have not been through something like COVID-19 before. Many authorities and agencies have turned to ArcGIS Online applications to disseminate crucial COVID-19 related information and gain insight for how to respond. You might have come across the Johns Hopkins dashboard, or the web experience created by World Health Organization.

 

ArcGIS Online can be leveraged as a powerful tool for your organization and community in this difficult situation as well, and the picks for this week are intended to provide a firm foundation for getting started. They provide some newly updated best practices for preparing highly scalable ArcGIS Online web applications, comprehensive resources and crucial steps for mapping and understanding COVID-19, a brand new solution template for collecting and sharing information with the public related to the outbreak, and a living document that has collected and categorized COVID-19 dashboard examples, educational resources, questions, and solutions on GeoNet. 

 

Essential Configurations for Highly Scalable ArcGIS Online Web Applications

 

ArcGIS Online Product Manager Kelly Gerrow published this excellent, interactive blog post on the essential best practices for preparing layers and apps for very high demand. As Kelly writes, ArcGIS Online is built on scalable architecture that has supported millions of views per hour on the Johns Hopkins dashboard. The blog features a checklist where you can literally toggle off each setting for your layers and apps as they are configured, ensuring that you tap into the technology that has facilitated this massive-scale information sharing. As the title suggests, it is truly an essential read. 

 

Additional Resources:

 

 

The Tools to Get Started

 

Esri has been working to make resources available for mapping, analyzing, and understanding the spread of COVID-19, as well as gathering information from and sharing information with your community regarding the pandemic. On Esri's COVID-19 Hub Site, you can learn where to begin, access authoritative data and get updates from national agencies. If you want to create your own website to share information and resources with your community, this blog post is an ultra-comprehensive step-by-step guide for accomplishing this using ArcGIS Hub (as many government agencies have already done). And just yesterday, the ArcGIS Solutions team released Coronavirus Response | ArcGIS Solutions for Local Government - this features 10 applications specifically designed for use by the public and public health staff to "to understand the impact of the coronavirus (COVID-19) and share authoritative information about the pandemic with your community." 

 

Join the Conversation on GeoNet

 

Naturally, some of the conversation about the GIS response to COVID-19 has occurred on GeoNet. Leslie Fountain has curated a compelling, living document with links to data sources, dashboard examples, educational resources, and a collaborative spacewhere unanswered COVID-19 questions are highlighted. Taking a look at this space and seeing if you have experience with one of the questions may be a great way to help out a community from afar. 

 

I hope that the picks provided some guidance on the ways that GIS solutions can assist during these challenging days. Let me know in the comments below if they were helpful or if you have any additional questions. Keep an eye out for This Week's Picks - ArcGIS Enterprise & This Week's Picks - ArcGIS Pro. Thanks for reading - my sincere best wishes to you and yours. See you on Tuesday, 3/31.

 

-Peter

 

----------

 

Previous posts: This Week's Picks - ArcGIS Online: Archive 

Connect with me on LinkedIn and follow me on Twitter

On the evening of March 31 (PDT), we plan to update ArcGIS Online.

 

 

New Tools Coming in Beta

  • ArcGIS Notebooks, Esri's integrated Jupyter notebook experience, will be available in beta with ArcGIS Online 8.1. ArcGIS Notebooks will allow you to combine the ArcGIS Python libraries with the larger open-source Python ecosystem for spatial data management, spatial analysis, and data science. 
  • Build simple, responsive applications with the beta version of Esri's popular minimalist Configurable App. Now it can use ArcGIS API for Javascript 4X, and you can include the new functionality from maps authored in Map Viewer beta.
  • A beta for the next version of ArcGIS Dashboards, built using ArcGIS API for Javascript 4x, will be available shortly after the March ArcGIS Online release. New enhancements include improved usability and performance, plus ArcGIS Arcade support for list and indicator elements.

 

HTTP Layer Notifications

ArcGIS Online is preparing to enforce HTTPS-only communication starting September 15, 2020. At the March release, organizations who have chosen not to utilize HTTPS for their web services will receive a notification informing them that adding layers and content via an HTTP URL will not work after September 2020. For more information, read the blog.

 

Regional Subscriptions

ArcGIS Online is launching the capability to choose the region where your geospatial data is stored. With the March update of ArcGIS Online, customers will be able to select their data hosting region (United States or Europe) at the time of purchase. Subscriber and subscription information, item metadata, LBS services and processing (analytics, geocoding, routing, etc.), and back-office systems (subscriber management, credit accounting) will always remain in the US. Regional hosting will be for new subscriptions only.

 

Support for Social Logins with GitHub

Social logins can be an efficient way for organization members to create and manage access to an ArcGIS Online organization account. With the March update of ArcGIS Online, GitHub will be added as a supported social login. 

 

 

Please note that all planned updates are subject to change. A comprehensive list of implemented changes will be provided in our What's New email, blog, and documentation.

 

When an ArcGIS Online update is slated for the near future, I tend to reflect on functionality that has been recently added to the platform. With an update planned for later in March (see this post to participate in the Beta), I realized that there have been a couple of key updates to vector tile layers within the last year. In case you are new to ArcGIS Online within the last couple of months or weren't using vector tiles when the updates went out, the picks for this week showcase some of my go-to vector tile layer resources. I hope you enjoy!

 

Vector Tile Layer Style Editor (Native in Map Viewer)

 

This feature was released in June 2019. Without leaving the Map Viewer, create and save your very own custom style. Zara Matheson's excellent blog will walk you through exactly how: Edit Vector Tiles in Style from Map Viewer 

 

Additional Resources:

 

 

Replace Vector Tile Layers

 

Replacing a vector tile layer with updated data, from the Graphic User Interface (GUI), with minimal downtime, came to ArcGIS Online in October 2019. Garima Tiwari's blog describes in a succinct fashion how to accomplish this: Update hosted vector tile layer content using Replace Layer 

 

Additional Resources:

 

 

Understand the Root Tile

 

When creating vector tile packages in local tiling schemes, it is important to understand the root tile. This Esri Support knowledge base article, written by senior analyst Adam Eversole, sums it up nicely then goes deeper: "If a tile cache were a pyramid, the root tile would be its peak. It is the tile that represents the largest area of the map and the lowest level of detail." This is required reading for those wanting to publish hosted vector tile layers in a local projection. 

 

Additional Resources:

 

 

I hope the above picks provided some guidance and inspiration for working with vector tile layers! Let me know in the comments below if there are any questions, comments, or if there is any content you want to see in the future. Don't forget to keep an eye out for installments of This Week's Picks - ArcGIS Enterprise & This Week's Picks - ArcGIS Pro, coming later this week. Thanks for reading and see you again on 3/17. 

 

Cheers,

 

-Peter

 

--------------------

 

Previous posts: This Week's Picks - ArcGIS Online: Archive 

Connect with me on LinkedIn and follow me on Twitter

Static bus timetables (GTFS) are no match for real time bus information (GTFS-realtime). But that doesn't mean you have to settle for static visualisation techniques.

In this blog I will show how you can be a little creative and make your static timetables sing and move along with Arcade. And you'll be left wanting to sing: the wheels on the bus go round and round

Select a link below to view the web map associated with this GIF.

The GIF and web map show popups of upcoming buses and those just recently missed. This would come in handy for bus commuters to understand which services are available at any given date and time. We’ll learn how to create these popup displays from a GTFS feed. Followed by how to extend this solution to a mobile friendly app, where commuters could access this information on the go

More on GTFS

A GTFS feed is a collection of text files, each telling a story about transit information. For this example we'll use the GTFS feed for public buses in Canberra, Australia.

  • Click here to download the GTFS feed for Canberra.

  • Click here to view the GTFS specification for Canberra.

Data prep

Before you get started, click here to download an ArcGIS Pro project package with my model builder configurations, used to create these layers.

Build expressions (hosted table)

You may have noticed from the model used for the hosted table, I created an extra field arrivalSeconds to calculate the arrival_time of buses from hh:mm:ss string type to a number (seconds elapsed since start of day). This was done to accelerate the filter query (which we'll use later) to only return features relevant to the time of day. As you can imagine, it's a lot faster to query numbers compared to converting string types on the fly (especially with large datasets).

Convert arrival_time to number of seconds elapsed since start of day
//separate arrival hours, minutes and seconds into an array
var separateArrival = Split($feature["arrival_time"],":")

//To fix hour figures greater than 23
var fixedHours = When(separateArrival[0] >= 24, separateArrival[0] - 24, separateArrival[0])

//convert arrival_time from 'String' to 'Date' type
var arrivalTimeAware = Date(Year(Now()), Month(Now()), Day(Now()), fixedHours, separateArrival[1], separateArrival[2])

var startOfDayTime = Date(Year(Now()), Month(Now()), Day(Now()), 0, 0, 0)

//arrival_time to number of seconds elapsed since start of day
var arrivalSeconds = DateDiff(arrivalTimeAware, startOfDayTime, 'seconds')
return arrivalSeconds

Build expressions (web map)

The following expressions assume that you're already familiar with Arcade FeatureSets, and FeatureSetByPortalItem() released in Arcade 1.8. If you'd like to familiarise yourself with Featuresets refer to this excellent blog written by Paul Barker.

After you've added the bus stops feature layer to a web map, build the following expression to return information relevant to the upcoming buses in the next 60 minutes (3,600 seconds).

  • Here is a web map already built for your convenience .

Expression for upcoming buses in the next 60 minutes
//query features from hosted table - 'stopsTimesTripsRoutesCalendar' in ArcGIS Online
var portal = Portal("https://www.arcgis.com")
var gtfsTable = FeatureSetByPortalItem(portal,"38ee59b7d5bc4173ab8786bd58ae274a", 0)

var stopId = $feature["stop_id"]

var startOfDayTime = Date(Year(Now()), Month(Now()), Day(Now()), 0, 0, 0)
//seconds elapsed since start of day
var secondsElapsed = DateDiff(Now(), startOfDayTime, 'seconds')

//return curr_date as an integer in the format 'YYYYMMDD' #HowItShouldBe
var curr_date = Number(Text(Now(),'YMMDD'))

//filter statement (SQL) - access variables with @
//if you'd like to change the time interval, change '3600' seconds to something else in statement - 'arrivalSeconds <= (@secondsElapsed + 3600)'
var filterStatement = 'arrivalSeconds >= @secondsElapsed AND arrivalSeconds <= (@secondsElapsed + 3600) AND stop_id = @stopId AND @curr_date >= start_date AND @curr_date <= end_date'

//filter the gtfsTable by the filter statement
//order results by arrivalSeconds in ascending order
var filtered = OrderBy(Filter(gtfsTable, filterStatement),'arrivalSeconds ASC')

var popupResult = ''

var weekDays = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday']
//This variable is used within the for loop to determine whether a bus is operational on a given weekDay (e.g. returns 1 if operational, 0 if not).
var currWeekdayOpr = weekDays[Weekday(Now())]

//Iterate over the filtered results to show desried fields in popup
for (var f in filtered){
   if (f[currWeekdayOpr] == 1){
       popupResult += Left(f.arrival_time, 5) + " - " + f.route_long_name +
       When(f.route_type == 712, Concatenate(" (",f.trip_headsign,")"), Concatenate(" (",f.route_short_name,")")) +
       When(f.wheelchair_accessible == 1 && f.bikes_allowed == 1, " - ",
       f.wheelchair_accessible == 1 && f.bikes_allowed == 0," - ",
       f.wheelchair_accessible == 0 && f.bikes_allowed == 1," - ","") + TextFormatting.NewLine + TextFormatting.NewLine
   } else{
       popupResult += ""
   }
}

IIF(IsEmpty(popupResult), "No upcoming buses in the next hour" + TextFormatting.NewLine + TextFormatting.NewLine, popupResult)

You can also use a similar expression with a slightly modified filterStatement to query buses departed in the last x minutes. The statement below queries buses departed in the last 20 minutes (1,200 seconds).

var filterStatement = 'arrivalSeconds >= (@secondsElapsed - 1200) AND arrivalSeconds < @secondsElapsed AND stop_id = @stopId AND @curr_date >= start_date AND @curr_date <= end_date'
Complete expression for buses departed in the last 20 minutes
//query features from hosted table - 'stopsTimesTripsRoutesCalendar' in ArcGIS Online
var portal = Portal("https://www.arcgis.com")
var gtfsTable = FeatureSetByPortalItem(portal,"38ee59b7d5bc4173ab8786bd58ae274a", 0)

var stopId = $feature["stop_id"]

var startOfDayTime = Date(Year(Now()), Month(Now()), Day(Now()), 0, 0, 0)
//seconds elapsed since start of day
var secondsElapsed = DateDiff(Now(), startOfDayTime, 'seconds')

//return curr_date as an integer in the format 'YYYYMMDD' #HowItShouldBe
var curr_date = Number(Text(Now(),'YMMDD'))

//filter statement (SQL) - access variables with @
//if you'd like to change the time interval, change '1200' seconds to something else in statement - 'arrivalSeconds >= (@secondsElapsed - 1200)'
var filterStatement = 'arrivalSeconds >= (@secondsElapsed - 1200) AND arrivalSeconds < @secondsElapsed AND stop_id = @stopId AND @curr_date >= start_date AND @curr_date <= end_date'

//filter the gtfsTable by the filter statement
//order results by arrivalSeconds in ascending order
var filtered = OrderBy(Filter(gtfsTable, filterStatement),'arrivalSeconds ASC')

var popupResult = ''

var weekDays = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday']
//This variable is used within the for loop to determine whether a bus is operational on a given weekDay (e.g. returns 1 if operational, 0 if not).
var currWeekdayOpr = weekDays[Weekday(Now())]

//Iterate over the filtered results to show desried fields in popup
for (var f in filtered){
   if (f[currWeekdayOpr] == 1){
       popupResult += Left(f.arrival_time, 5) + " - " + f.route_long_name +
       When(f.route_type == 712, Concatenate(" (",f.trip_headsign,")"), Concatenate(" (",f.route_short_name,")")) +
       When(f.wheelchair_accessible == 1 && f.bikes_allowed == 1, " - ",
       f.wheelchair_accessible == 1 && f.bikes_allowed == 0," - ",
       f.wheelchair_accessible == 0 && f.bikes_allowed == 1," - ","") + TextFormatting.NewLine + TextFormatting.NewLine
   } else{
       popupResult += ""
   }
}

return popupResult

Final thoughts

Once you’ve built the pop-ups to your heart's content, you can further highlight them by using configurable app templates. Click here to see how I’ve extended the above web map using the NearBy configurable app where users can search for bus stops by stop numbers, stop names or addresses.

Gotchas - FeatureSetByPortalItem() function is a great way to pull in data from another layer without needing to add that layer to your map. But make sure that the same sharing privileges are shared across the layer in the map and the layer you're pulling data from.

Learn more - if you like what you see, check out these carefully crafted Arcade resources by esri staff members. And if you do happen to be visiting this year's Developer Summit keep an eye out for Arcade tech sessions presented by Lisa Berry and Paul Barker.

Finally, stay tuned to Part 2 - where we'll take this solution "all the way to town"

 

Cheers! - Gee Fernando

The 2020 Esri Developer Summit (March 10-13 in Palm Springs) is almost here and there are a lot of ArcGIS Online sessions in store. Though all will be great, some recommended ones are listed below:

 

 

The full list of ArcGIS Online sessions can be found here. Don't forget to stop by the ArcGIS Online Product Island, too!

 

If you would like to join the ArcGIS Online beta program, follow this link: ArcGIS Online Early Adopter Program

 

Some of the new features coming to ArcGIS Online in the March 2020 Update include:

 

  • Next generation builder for ArcGIS Online's Configurable Applications
  • New support for Social Logins with GitHub
  • Embed Videos in Item Details
  • Improved Group Sharing

 

Note: The following blog describes the ArcGIS Online Early Adopter Community (EAC) and why you might benefit from participating in the beta: What is ArcGIS Online EAC and Why Join? 

 

If you have any questions, don't hesitate to comment below and Julia Shi or myself can assist. 

 

As an ArcGIS Online administrator, you have control over just about every aspect of your ArcGIS Online organization. From inviting members, assigning licenses and managing groups to configuring credits, security settings and utility services, you the ArcGIS Online admin are in charge. An incredible benefit of this is that the organization can be configured and managed with specific use case or workflow requirements in mind. A challenge is that there can be a lot to keep track of, and for new admins, a bit of a learning curve. The below picks provide some tips and tricks for new and seasoned admins alike to make the most of your, dare I say almighty, role as ArcGIS Online administrator.

 

How to Be an ArcGIS Online Administrator

 

If you are just getting started with administration, my colleague Rachel Guttmacher's blog post, How to be an ArcGIS Online Administrator, is a must-read. It's a fun, conversational piece that covers some of the most crucial administration components including credits, member management, licensing, and security. 

 

Additional Resources:

 

 

Utilize Custom Administrative Roles to the Fullest

 

Another colleague of mine, Tyler Burns, recently wrote a great blog post on taking advantage of custom administrative roles: Lighten the Administrative Load in ArcGIS Online with Custom Roles. If you're looking to delegate specific administrative tasks such as managing members and content or organizing the website, the post provides directions and screenshots for exactly how to configure custom administrative roles to accomplish this. 

 

Additional Resources:

 

 

"AAA": ArcGIS Online Administration Automation - Video 

 

Kelly Gerrow and John Yaist presented this 20 minute talk on automating administration at the 2019 Dev Summit. For anyone administering a larger organization or with an interest in bolstering their automation skills, this is a recommended view. Topics covered are using the Rest API to query the organization history, and creating groups, users, and assigning licenses in batch with the ArcGIS API for Python. 

 

Additional Resources:

 

 

I hope the above picks were helpful for all the administrators out there! Let me know below any comments, questions, or if there are any topics you want to see in future posts. Thanks for reading, and be sure to keep an eye out for This Week's Picks - ArcGIS Enterprise & This Week's Picks - ArcGIS Pro!

 

See you again in March,

 

-Peter

 

--------------------

 

Previous posts: This Week's Picks - ArcGIS Online: Archive 

Connect with me on Linkedin and follow me on Twitter

For those new to this series, "This Week's Picks" is a (loosely) biweekly blog where I share some of my favorite ArcGIS Online content with you.

 

If you are interested in earlier posts, they’re archived here: This Week's Picks - ArcGIS Online: Archive 

 

--------------------

 

 

--------------------

 

YouTube is an incredible platform for learning. From how to tie a tie (relied upon heavily for job interviews after undergrad) to how to play guitar, there are short videos on how to do just about everything. No surprise there are a lot of great how-to videos for ArcGIS Online workflows - the picks for this week highlight three new, relevant videos on using Living Atlas layers to analyze Australia's wildfires, uploading tile layers and tile packages to ArcGIS Online, and preserving relationships based on GlobalID/GUID fields when appending records. 

 

Use Living Atlas layers to analyze Australia's wildfires

 

Joseph Kerski recorded this timely how-to video on leveraging Living Atlas layers to analyze Australia's tragic wildfires. Joseph is a master educator (the video is tailored towards teachers and researchers); after watching the video I felt like I not only knew how to map wildfires, but also better understood spectral bands and satellite data collection. 

 

Additional References:

 

 

Uploading tile layers and tile packages to ArcGIS Online

 

Esri Canada's Céline Doré created this helpful video on how to push tile layers and packages into ArcGIS Online. My favorite part (Céline does a great job explaining this workflow) was the demonstration of the sequence of geoprocessing tools to use in ArcGIS Pro to turn larger imagery layers into tile packages, and finally into hosted tile layers in ArcGIS Online. 

 

Additional References:

 

 

Preserve GlobalID/GUID relationships when appending records

 

After seeing several GeoNet posts with questions about appending records with relationships based on GlobalID/GUID fields (the central issue is that appended records are assigned a new GlobalID, becoming disassociated from their related records), I recorded this how-to video of a workflow James Tedrick designed to preserve relationships during the append. This is a workflow that shouldn't need to be used frequently but is good to have in your back pocket if you end up with two Hosted Feature Layers/Feature Classes with GlobalID/GUID relationships that need to be combined into one. 

 

Additional References:

 

 

--------------------

 

Hopefully the selection of how-to videos provides some visual guidance on the workflows! Let me know below  any questions, comments, or if there is any content you want to see in the future. Thanks for reading and keep an eye out for This Week's Picks - ArcGIS Enterprise and This Week's Picks - ArcGIS Pro!

 

If you're interested, I would love to connect on LinkedIn. You can follow me on Twitter as well. I regularly post / tweet GIS(ish) content to these platforms.

 

Have a good rest of your week, and see you after President's day ~

 

-Peter

Did you know that you can customise popups based on time and dates? With Arcade you can .

This can come in handy when displaying opening hours for restaurants, cafes and other facilities. If you’re unfamiliar with Arcade - please refer to these ArcGIS Blogs, as this post assumes some prior knowledge.

Additional Arcade resources

Pop Up Variations

 

Let’s get started

First, find or create a data-set with opening hours (preferably for all days of the week). For this example I’ll be using Access Canberra locations (sourced from - dataACT). Please ensure opening hours are saved as numbers or text field types.

Time Types

 

Build expressions

Within the pop-up configuration window - build the following expressions or feel free to follow along with this web map.

Opening Hour Expressions

 

hoursOfOperationToday {expression/expr0}

This expression will return the current weekday alongside its opening hours.

For example:

Thursday: 08:30-16:30

var weekDays = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']

//Returns the current weekday. Values range from 0-6 where sunday is 0 and saturday is 6
var currentWeekDay = Weekday(Now())

//Return weekday followed by opening hours
var hoursOfOperationToday = weekDays[currentWeekDay] + ": " + $feature[weekDays[currentWeekDay]]

return hoursOfOperationToday

 

hoursOfOperationRestOfWeek {expression/expr1}

This expression will return the remaining weekdays alongside their opening hours.

For example:

Friday: 08:30-16:30
Saturday: Closed
Sunday: Closed
Monday: 08:30-16:30
Tuesday: 08:30-16:30
Wednesday: 08:30-16:30

var weekDays = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday','Monday','Tuesday','Wednesday','Thursday','Friday'];

//Returns the current weekday. Values range from 0-6 where sunday is 0 and saturday is 6
var currentWeekDay = Weekday(Now())

var hoursOfOperationRestOfWeek = ""

//Iterate over the weekdays and opening hours for the remaning 6 days of the week
for(var i = currentWeekDay + 1; i < currentWeekDay + 7; i++){
    hoursOfOperationRestOfWeek += weekDays[i] + ": " + $feature[weekDays[i]] + TextFormatting.NewLine
}

return hoursOfOperationRestOfWeek

 

openCloseStatus {expression/expr2}

This expression will return whether the shopfront is Open, Closed, Opens soon or Closing soon based on opening hours and the time displayed on users' device .

var weekDays = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']

//Returns the current weekday. Values range from 0-6 where sunday is 0 and saturday is 6
var currentWeekDay = Weekday(Now())

//Change 'Closed' to 00:00-00:00 to be consistent with the rest of opening hours information
var formattedOpeningHours = When($feature[weekDays[currentWeekDay]] == "Closed", "00:00-00:00", $feature[weekDays[currentWeekDay]])

//Separate Opening hours and minutes into an array
var separateOpening = Split(Replace(formattedOpeningHours,'-',':'),':')

//Assign hours and minutes to opening and close times
var startTime = Date(Year(Now()),Month(Now()),Day(Now()),separateOpening[0],separateOpening[1])
var endTime = Date(Year(Now()),Month(Now()),Day(Now()),separateOpening[2],separateOpening[3])

When(Now() > startTime && Now() < endTime && Now() > Dateadd(endTime, -1, 'hours'), "Closes soon:",
Now() > startTime && Now() < endTime, "Open",
Now() < startTime && Now() > Dateadd(startTime, -1, 'hours'), "Opens soon",
"Closed")

 

openCloseStatusColour {expression/expr3}

If you'd like to re-iterate the openCloseStatus values with added colour - rewrite and replace previous expression's return values with hexadecimal colour values.

For example:

#239B56 ⋅ Open

#CB4335 ⋅ Closed

#2ECC71 ⋅ Opens soon

#EC7063 ⋅ Closing soon

//First 15 lines the same as - openCloseStatus {expression/expr2}

When(Now() > startTime && Now() < endTime && Now() > Dateadd(endTime, -1, 'hours'), "#EC7063",
Now() > startTime && Now() < endTime, "#239B56",
Now() < startTime && Now() > Dateadd(startTime, -1, 'hours'), "#2ECC71",
"#CB4335")

Now use this expression to replace the colour code within the popup HTML. For more information on this topic - refer to Bring Colors From Your Map Into Your Pop-up Using Arcade written by Lisa Berry.

Inserting Colour Expressions into HTML

 

closingOrOpeningTime {expression/expr4}

This expression can look a little daunting at first, but like any other piece of code - go through one line at a time and use your own test environment to test and experiment .

It will return the:

  • closing time, if the Access Canberra shop front is Open or Closes soon.
  • opening time for the current day, if it Opens soon, or Closed (before hours).
  • and next opening day and timeif it's Closed (after hours), Closes soon or Closed for the whole day.
var weekDays = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday','Monday','Tuesday','Wednesday','Thursday','Friday'];

//Returns the current weekday. Values range from 0-6 where sunday is 0 and saturday is 6
var currentWeekDay = Weekday(Now())

//Change 'Closed' to 00:00-00:00 to be consistent with the rest of of opening hours information
var formattedOpeningHours = When($feature[weekDays[currentWeekDay]] == "Closed", "00:00-00:00", $feature[weekDays[currentWeekDay]])

//Separate Opening hours and minutes into an array
var separateOpening = Split(Replace(formattedOpeningHours,'-',':'),':')

var startTime = Date(Year(Now()),Month(Now()),Day(Now()),separateOpening[0],separateOpening[1])
var endTime = Date(Year(Now()),Month(Now()),Day(Now()),separateOpening[2],separateOpening[3])

var openCloseStatus = When(Now() > startTime && Now() < endTime && Now() > Dateadd(endTime, -1, 'hours'), "Closes soon:",
Now() > startTime && Now() < endTime, "Open",
Now() < startTime && Now() > Dateadd(startTime, -1, 'hours'), "Opens soon",
"Closed")

//If openCloseStatus is Closed (before hours), return current day's opening time
//Else if openCloseStatus is Closed (after hours), Closes soon or Closed for the whole day, return next opening day and time
var nextOpening = ""
if (openCloseStatus == "Closed" && $feature[weekDays[currentWeekDay]] != "Closed" && Now() < startTime){
    nextOpening = "Opens " + LEFT($feature[weekDays[currentWeekDay]],5)
} else if ((openCloseStatus == "Closed" || openCloseStatus == "Closes soon:") && $feature[weekDays[currentWeekDay + 1]] != "Closed"){
    nextOpening = "Opens " + LEFT($feature[weekDays[currentWeekDay + 1]],5) + " " + weekDays[currentWeekDay + 1]
} else if (openCloseStatus == "Closed" || openCloseStatus == "Closes soon:") {
    for(var i = currentWeekDay + 1; $feature[weekDays[i]] == "Closed"; i++){
        nextOpening = "Opens " + LEFT($feature[weekDays[i + 1]],5) + " " + weekDays[i + 1]
    }
}

When(openCloseStatus == "Open", "⋅ " + RIGHT($feature[weekDays[currentWeekDay]],5),
openCloseStatus == "Opens soon", "⋅ " + LEFT($feature[weekDays[currentWeekDay]],5),
openCloseStatus == "Closes soon:", RIGHT($feature[weekDays[currentWeekDay]],5) + " ⋅ " + nextOpening,
"⋅ " + nextOpening)

 

Final thoughts

Once you’ve built the pop-ups to your heart's content you can further highlight them by using configurable app templates. Click here to see how I’ve extended the above web map using the NearBy configurable app.

Nearby Access Canberra GIF

 

Tips - Make sure to take advantage of Test your expressions feature to check whether return values look correct. If you have admin privileges to your computer you could also adjust time/date to test various return values based on opening hours.

Test Expressions

Challenge - As you may have figured out, these expressions are not time-zone aware. And in most instances this wouldn't be a problem - as the intended maps and apps are localised.

But, I'd still love to hear your thoughts around how you'd go about this. Please use the comments section below for ideas.

 

Cheers! - Gee Fernando

oliver_burdgis

Mobile photos to webmap

Posted by oliver_burdgis Jan 22, 2020
Getting geotagged photos into a webmap needn't be a pain. Using snap2map you can accomplish this quite easily. I find it really useful when taking photos on site or in the field. Let me know what you think in the comments below and please share the video.
geotagged photos

For those new to this series, "This Week's Picks" is a (loosely) biweekly blog where I share some of my favorite ArcGIS Online content with you.

 

If you are interested in earlier posts, they’re archived here: This Week's Picks - ArcGIS Online: Archive 

 

--------------------

 

 

 

I'll admit, I'm on my phone more than I would like to be - but I'm not just scrolling Instagram and taking selfies. I regularly read story maps (which I should mention are mobile-ready by default), and I checked public safety apps habitually during last year's California fire season. Straightforward observation of the world around us indicates that I'm not the only one making good use of their unlimited data contract. And like me, most people are probably doing a lot more than scrolling Instagram. 

 

What if they were looking at an ArcGIS web app that you had built? What if you had configured it with mobile in mind and the UX/UI and functionality were excellent on a smaller screen?

 

The picks for this week may help change both of the above questions from rhetoric to reality.  

 

***Note: this post covers web apps accessed in mobile browsers through a URL, not native apps. To build native apps for iOS and Android you will need AppStudio for ArcGIS***

 

ArcGIS Experience Builder: Build Apps for Multiple Screen Sizes

 

ArcGIS Experience Builder takes advantage of modern web technologies to amplify Web AppBuilder's out of the box mobile capabilities. Crucial functionality is the ability to configure the same app differently for mobile and desktop. The Esri YouTube user "GeoDev" goes through some crucial steps in this video, from customizing widget layouts to different elements on the page so that your app looks great and performs on multiple screen sizes. Creating links between different pages is shown as well. Though the video is for Beta 1 it is still very informative. 

 

Additional References:

 

 

Configurable App Templates: Configure Apps with Mobile in Mind

 

Beth Romero recently posted this really helpful blog on how to create great apps for mobile with Esri's configurable app templates. Pop-ups, symbology and testing methods, among other ideas, are covered. 

 

Additional References:

 

 

Operations Dashboard: Configure Dashboards for Mobile

 

Derek Law published this in-depth blog  on optimizing dashboards for mobile use. From general best practices to maps, legends and interactivity, this is a must-read before jumping into mobile dashboard configuration. 

 

Additional References:

 

 

--------------------

 

I hope the above resources provided some helpful tips on configuring ArcGIS web apps with mobile in mind! Let me know in the comments below  if there are any outstanding questions. Thanks for reading and stay tuned for This Week's Picks - ArcGIS Enterprise and This Week's Picks - ArcGIS Pro!

 

If you're interested, I'd love to connect on LinkedIn You can follow me on Twitter too. I regularly post / tweet GIS(ish) content to these platforms.

 

See you again in a couple weeks,

 

-Peter

For those new to this series, "This Week's Picks" is a (loosely) biweekly blog where I share some of my favorite ArcGIS Online content with you.

 

If you are interested in earlier posts, they’re archived here: This Week's Picks - ArcGIS Online: Archive 

 

--------------------

 

 

It's the time of year for resolutions, goals, and new beginnings. But for This Week's Picks we are not quite ready to begin 2020 yet, and wanted to highlight the most viewed ArcGIS Online Content of 2019. This list excludes the "What's New" and Map Viewer Beta posts. Thanks to Kelly Gerrow for suggesting this idea. 

 

Most Viewed ArcGIS Blogs in 2019

 

In 2019, the most popular blogs tended to cover map authoring workflows: 

 

  1. Heat Mapping in Two Simple Steps
  2. Adding and using photos and images in ArcGIS Online
  3. Visualizing population migration by where people filed their taxes
  4. Create Custom Field Calculations Using Arcade Expressions
  5. Using images as custom point symbols
  6. Combining Arcade and HTML for a Real-life Pop-up Display

 

Thanks to our blog authors Julia Holtzclaw, Lisa Berry and Bern Szukalski!

 

Most Viewed GeoNet Blogs in 2019 (estimated)

 

The most popular GeoNet Blogs in 2019 continue the theme of map authoring workflows, with some administrative flavors mixed in:

 

  1. Conditional Field display with Arcade in Pop Ups 
  2. Overlapping Features in Pop-Ups Quick Introduction to Using FeatureSets with Arcade 
  3. ArcGIS Online Implementation Guide 
  4. Show Attachments in Pop-ups with Arcade Expressions 
  5. How to be an ArcGIS Online Administrator 
  6. This Week's Picks - ArcGIS Online: Archive 

 

Thanks to our GeoNet contributors Kelly Gerrow, Jennifer Bell, Molly Zurn, Rachel Guttmacher and Derek Law!

 

Most Viewed Tech-focused YouTube Videos (estimated, unranked)

 

Web Map and app authoring is present again here, but more focused on the data side of things:

 

 

And one final thanks to Esri Canada for always producing stellar ArcGIS Online videos, and Kelly Gerrow, Matt Payne & Jeremy Bartley!

 

--------------------

 

I hope the above picks provided a bit of insight into what content was popular in 2019! Let me know in the comments below  if there are any outstanding questions. Thanks for reading and stay tuned for This Week's Picks - ArcGIS Enterprise and This Week's Picks - ArcGIS Pro

 

If you're interested, I'd love to connect on LinkedIn. You can follow me on Twitter, too. I regularly post / tweet GIS(ish) content to these platforms.

 

Happy new year and see you again in a couple weeks!

 

-Peter

For those new to this series, "This Week's Picks" is a (loosely) biweekly blog where I share some of my favorite ArcGIS Online content with you.

 

If you are interested in earlier posts, they’re archived here: This Week's Picks - ArcGIS Online: Archive 

 

--------------------

 

 

There is a chance that if you’re reading this, you might have contacted Esri Technical Support before and spoken or emailed with one of my colleagues. It goes without saying that Esri Support Analysts are wizards at solving technical problems involving GIS, but what some folks don’t know is that they are also the engine behind the Support site’s Knowledge Base (KB). 

 

That’s why this week I want to highlight three new(ish) Technical Support-written Knowledge Base articles that get into some lesser-known ArcGIS API for Python and Arcade functionality.

 

Clone Hosted Feature Services between ArcGIS Online Organizations

 

“The best-laid plans of mice and men often go awry…” and suddenly, it’s a requirement to transfer Hosted Feature Layers, Web Maps, Apps and maybe even surveys and dashboards to a different ArcGIS Online organization. This would be a daunting task, but the ArcGIS API for Python’s Clone Items method makes it easier. This KB article (written by yours truly, I know - shameless plug) provides a Jupyter Notebook and standalone Python script code sample to get you started. 

 

Additional References:

 

 

Automate ArcGIS Online Hosted Feature Service Downloads

 

Unintentionally overwriting a layer or accidentally deleting a Hosted Feature Service are mistakes that many of us have made in ArcGIS Online. With the ArcGIS API for Python, it is possible to automate local backups of your Hosted Feature Services for when these situations unexpectedly come up. See the code sample in Munachiso Ogbuchiekwe's KB article.

 

Additional References:

 

 

Step-by-Step: Calculate a Field in ArcGIS Online with Arcade

 

In This Week's Picks - ArcGIS Online #3, I highlighted Arcade resources focused on pop-ups, symbology and labeling. To round things out, Hanushrie Gopalkrishnan's support KB article demonstrates how to use a simple expression to calculate a field based on the values of two existing fields. 

 

Additional References:

 

 

--------------------

 

I hope the above KB articles provided some helpful tips on the ArcGIS API for Python and Arcade! Let me know in the comments below if there are any outstanding questions. Thanks for reading and stay tuned for This Week's Picks – ArcGIS Enterprise and This Week's Picks – ArcGIS Pro

 

If you're interested, I'd love to connect on LinkedIn. You can follow me on Twitter, too. I regularly post / tweet GIS(ish) content to these platforms.

 

Happy holidays and see you in 2020!

-Peter