Many organizations are now leveraging enterprise related data with ArcGIS Online and Collector for ArcGIS, or considering adopting it. There are four scenarios that you may adapt into your organization’s needs. Explore the first two scenarios—viewing related data in ArcGIS Online and editing features with related data in ArcGIS Online—in part one of this two-part blog series.
In the database world, relationships are handled by Relational Database Management Systems (RDBMS) such as Oracle, Microsoft SQL Server and PostgreSQL. And in the geodatabase world, on the Esri platform, enterprises work with SDE.
How could you manage all those important relationships between tables in an SDE geodatabase, with even feature classes in the picture? How would your database users, editors and data collectors access related data with various Esri products? Well, this blog is all about answering to these two questions.
I’ll talk about workflows for different scenarios that you may apply to leverage your related data in SDE geodatabase, whether you simply want users to view the data, or you require field personnel to collect data online or offline. In this blog, I’ll start within ArcGIS for Desktop, discussing how to prepare and publish services, then move onto ArcGIS Online Web maps and Web applications.
For simplicity purposes, this blog post only demonstrates one-to-many relationships between feature classes and tables. Be aware that geodatabases also support other types of cardinalities as well as relationships between feature class and feature class, between table and table.
So it begins!
Scenario #1: View related data in ArcGIS Online
In my SQL Server SDE geodatabase demo, I have a point feature class called Hydrants, and two tables – Inspections and Violations. The feature class has a field Facility_Identifier, and both tables contain a field Facility_ID, which corresponds to the Facility_Identifier of fire hydrants. One hydrant may have many inspection records or many violation records.
My goal is to allow users that don’t have access to SQL Server or ArcGIS for Desktop to view the up-to-date hydrant data, as well as the related, up-to-date inspection and violation records.
This can be achieved through two simple on-the-fly relates and a map service. Just remember to add the feature class and related tables to ArcMap, and register the SDE geodatabase with ArcGIS for Server before publishing the service. Also note that not only is feature service not required for viewing data, but also it doesn’t support in-memory relates.
After the map service is published, log in to ArcGIS Online, and add the service REST URL to a new Web map. When pop-up is enabled for the Hydrants layer, I can go ahead and click on a hydrant.
Viewing hydrant attributes and related data.
The hydrant attributes window pops up, where I can also Show Related Records from either the Inspections table or the Violations table. The related records will open in a table on the bottom. Everything works smoothly. Optionally, I may create a Web application and share with the user group.
Scenario #2: Edit features with related data in ArcGIS Online
Still working with the same SDE geodatabase, now I have editors who will update hydrant data in ArcGIS Online. (Field personnel will edit related inspection and violation records.) You may recall from a few paragraphs back, feature service doesn’t support in-memory relates, but is required for editing data online. A solution to solve this dilemma is relationship class.
There are simple and composite relationship classes. The main difference is that simple relationship is between peer and peer, while composite relationship is between parent and child, and child is dependent on parent. For this scenario, I’ll work with simple relationship class, while composite relationship class will have same behaviours in ArcGIS Online.
Prior to creating a relationship class, I add Global IDs to the feature class and two tables. Global IDs are always unique and preferable to be primary key, while Facility Identifiers may be entered multiple times by accident. Then I add a new GUID field called Hydrant_Global_ID to each table, in accordance with GlobalID in the feature class.
Two simple relationship classes are created, from the feature class, using GlobalID field as primary key, to each table, using Hydrant_Global_ID field as the foreign key.
So the keywords for this scenario are: relationship class, global ID and feature service. When publishing the service, leave Sync operation as disabled, as we’re not going offline yet.
Log in to ArcGIS Online and add the feature service to a new Web map. What is different from adding a map service? Well, more operations can be done with the Hydrants layer: changing symbology, creating labels, routing to features, and of course, editing.
Editing hydrant data in an ArcGIS Online Web map.
It’s optional to create a Web App for the hydrant editors, either a configurable app with edit functions, or using Web AppBuilder to add an Edit widget.
Editing hydrant data with the Edit widget.
In my next blog, we’ll continue working with the Hydrants feature class and its two related tables, and look into Collector for ArcGIS to find out how to edit features as well as related data, either online or offline.
About the Author
Jing Yan is an Enterprise Support Consultant for Esri Canada, providing technical support to ArcGIS Enterprise users. She holds a master’s degree in planning from Dalhousie University and a GIS Advanced Diploma from the Centre of Geographic Sciences. Besides her passion for GIS, she also likes to write novels, enjoy the arts, play competitive sports, travel and collect mugs.More Content by Jing Yan