Publish the inspection layer
As a public works officer, you manage geographic data on hydrants in Naperville in addition to tables for inspection information and observed violations. First, you'll relate the Hydrants layer to the inspection tables using a relationship class, so information added to the tables is automatically associated with the hydrants. Then, you'll publish your layer from ArcGIS Pro to ArcGIS Online or ArcGIS Enterprise to share with your workforce.
Download and explore the data
First, you'll download the hydrant inspection data and familiarize yourself with its contents.
- Open ArcGIS Pro.
- If prompted, sign in using your licensed ArcGIS account or an ArcGIS Enterprise named user account.
If you don't have ArcGIS Pro or an ArcGIS account, you can sign up for an ArcGIS free trial.
ArcGIS Pro opens. It contains a list of project templates under the heading Blank Templates. If you've created a project before, it'll include a list of recent projects under the heading Recent Projects.
- Under Blank Templates, click Catalog.
The Catalog template creates a project with no maps associated. This option is best if you're planning to open an existing map.
- In the Create a New Project window, name the project Hydrant Inspections.
By default, the project is saved to the ArcGIS folder, located in the Documents folder on your computer's drive C. To save the project elsewhere, browse to a different location.
- Make sure the Create a new folder for this project box is checked and click OK.
The project opens and displays the Catalog view. In this view, you can manage and browse data.
Now you'll begin adding data for your project. The hydrant data you already have is shared with you in ArcGIS Online. You'll search for and load this data in ArcGIS Pro.
- In the Catalog pane, click Portal and click All Portal. In the search box, type hydrant inspection owner:Learn_ArcGIS and press Enter.
If you've used ArcGIS Pro before, your interface may be arranged differently. If necessary, open the Catalog pane by using the ribbon's View tab. In the Windows group, click Catalog Pane.
If your organization doesn't allow you to search outside of it, you won't get results. You'll need to go to the ArcGIS Online group Manage a Mobile Workforce and download the Hydrant Inspection Data map package by Learn_ArcGIS. In your blank project in ArcGIS Pro, on the Insert tab, in the Project group, click Import Map and browse to the downloaded file.
- Right-click the Hydrant Inspection Data search result and choose Add and Open.
The map package is downloaded and extracted to a geodatabase. A map tab named Layers is added to the project. It has one layer, Hydrants, and two stand-alone tables, Inspections and Violations, that are in the map package. The Hydrants layer is a point layer showing hydrant locations in Naperville, Illinois. The tables are for hydrant inspections and for violations observed during inspections. You'll explore the data in more detail before proceeding.
If you don't see hydrants on the map, right-click the Hydrants layer and choose Zoom to Make Visible.
- In the Contents pane, right-click the Hydrants layer and choose Attribute Table.
The attribute table opens. It contains information about each hydrant, such as its unique facility identification number, its flow rate, and whether it is operable.
- Close the attribute table. In the Contents pane, right-click the Inspections table and choose Open.
The Inspections table only has field names. There is no actual data because there have been no inspections yet. The fields indicate the common elements an inspector checks, such as water pressure and necessary maintenance. There is also a field for the hydrant's unique facility identification number.
- Close the Inspections table and open the Violations table.
Like the Inspections table, the Violations table is empty except for field names.
- Close the Violations table.
Each hydrant may have multiple inspections over time, and each inspection may uncover multiple violations. These relationships can be managed in ArcGIS Pro using relationship classes. A relationship class contains properties that define how objects in one item relate to objects in another item. The map package you opened already contains one relationship class, which you can find in the geodatabase where the data is stored.
- In the Contents pane, right-click the Hydrants layer and choose Properties.
- In the Layer Properties: Hydrants window, click Source to see the path to the geodatabase created for the map package. Select the folder the geodatabase is stored in (not including the name of the geodatabase), press Ctrl+C to copy it, and click OK.
By default, the package is downloaded to Documents\ArcGIS\Packages in a folder starting with HydrantInspectionData. Inside that folder, the v103 folder contains the geodatabase. You'll copy the folder path through v103, for example, C:\Users\YourName\Documents\ArcGIS\Packages\HydrantInspectionData_8C75EB5F-53B1-455E-AB22-D6450E1A88EC\v103.
- On the ribbon, click the Insert tab. In the Project group, click Connections and click Add Database.
- In the Select Existing Geodatabase window, paste (or browse to) the folder where the geodatabase was created for the map package. Select hydrantinspections.gdb and click OK.
- In the Catalog pane, click the Project tab, expand the Databases section, and expand the hydrantinspections geodatabase.
The geodatabase contains four items: the layers and tables you explored earlier, and a relationship class called InspectionToViolations. As the name indicates, it establishes a relationship between the Inspections table and the Violations table. The tables can be managed individually while remaining related. In Collector for ArcGIS, these relationships can be used to display related data automatically.
Create a relationship class
The geodatabase already includes a relationship class between the Inspections and Violations tables. You also want to relate the Hydrants layer to the Inspections table. That way, information about inspections can be accessed by selecting individual hydrants.
- In the Catalog pane, right-click the hydrantinspections geodatabase, point to New, and choose Relationship Class.
The Create Relationship Class geoprocessing tool opens in the Geoprocessing pane. In this pane, you'll set the parameters of the relationship class.
- For the origin table, click the drop-down arrow and choose Hydrants. For the destination table, click Inspections.
- Next to Output Relationship Class, click Browse.
The Output Relationship Class window opens.
- Under Project, click the Databases folder and double-click the hydrantinspections geodatabase. For Name, type HydrantToInspections.
- Click Save.
- For Cardinality, choose One to many (1:M).
Cardinality describes how many objects in the origin class can relate to how many objects in the destination class. Relationships can be one to one, one to many, or many to many. Because each hydrant can have many inspections, the cardinality is one to many.
In the next step, you'll set the attribute field in the origin and destination that the relationship will be based on (called a key field) in order to associate the right hydrant with the right inspection record. You should choose a field that has a unique value for every feature and will have the same value in both the origin and the destination. Generally, an ID field will work. When you looked at the Hydrants and Inspections tables, both tables had a field for the unique facility identification number of the hydrant. You'll use these Facility ID fields as your keys.
- If necessary, for the Origin Primary Key field, choose FACILITYID. For the Origin Foreign Key field, choose FACILITYKEY.
The fields have different names here than in the tables because the tables use aliases to make the field names more readable.
The FACILITYID field contains a unique identification number for each hydrant.
- Click Run.
The new relationship class is added to the geodatabase. The Hydrants layer and Inspections table are now related. By extension, the Hydrants layer is indirectly related to the Violations table, because the Violations table is already related to the Inspections table. Collector supports this kind of relationship nesting up to three levels.
Before you publish the Hydrants layer and its related tables, you'll confirm the relationship on the map.
- Save the project, then exit and restart ArcGIS Pro, and open the project.
- On the Map tab, in the Selection group, click Attributes.
The Attributes pane opens.
- In the Attributes pane, click Select one or more features and click the center of any hydrant on the map to view its attributes.
The Attributes pane shows the attribute data of the selected feature.
- Near the top of the Attributes pane, under Hydrants, click the arrow next to the five-digit identifier to expand it.
The relationships of the feature are listed. Currently, the hydrants only show the name of the table to which they are related. If there were any actual inspections for that hydrant, you would be able to see them here.
If the arrow does not display, save the project, close and restart ArcGIS Pro, then re-open the project and continue.
- Close the Attributes and Geoprocessing panes.
- Save the project.
Publish the data
Now that you've created a relationship class, you'll publish the Hydrants layer, as well as the Inspections and Violations tables, to ArcGIS Online or ArcGIS Enterprise. Make sure your related tables are in the table of contents before you publish your layer. That way, both tables will be published along with the Hydrants layer.
- In the Contents pane, click Hydrants.
- On the Share tab, in the Share As group, click Web Layer.
The Share As Web Layer pane opens. You can use this pane to set the parameters of your web layer before you publish it. You'll want to make sure your web layer is published with feature access instead of tiled mapping in order to preserve the individual hydrant features. You'll also confirm that editing is enabled so your mobile workers can edit the layer.
- For the web layer name, type Hydrants and add your name at the end (use underscores; spaces are prohibited in the name).
The name must be unique within your organization. If you use a name that someone else in the organization has already used, you'll receive an error message.
- Verify that Layer Type is set to Feature.
- Near the top of the Share As Web Layer pane, click Configuration.
- Under Layer(s), next to Feature, click Configure Web Layer Properties.
- Under Operations, check Enable editing and allow editors to and Enable sync. Under Enable editing and allow editors to, verify that Add, update, and delete features is selected.
Checking these boxes allows people to edit the features (including the table data) of your published feature class.
- Click Publish.
Messages along the bottom of the panel report on the publishing. After a minute or two, a message tells you the web layer has been published successfully.
It's recommended that you click Analyze before publishing a web layer. This gives you a chance to view and resolve warnings and errors that may impact the publication process.
- Close the Share As Web Layer pane.
- Save the project and close ArcGIS Pro.
You've downloaded your hydrant data and the tables for inspections and violations. You also related those tables to the hydrants using relationship classes. After that, you published the layer and the tables to ArcGIS Online or ArcGIS Enterprise.
Create a map for inspections
Previously, you published a layer for fire hydrant inspections to ArcGIS Online or ArcGIS Enterprise. Next, you'll add that layer to a web map. Then, you'll configure the layer's pop-up to show inspections in chronological order. Finally, you'll share your layer and map so your workers can access them.
Add the layer to a map
Before you can send your field crew to inspect hydrants, you need to add your hydrants layer to a web map.
- If necessary, sign in to your ArcGIS organizational account.
- At the top of your organization's home page, click Content.
When viewing all your content, the My Content tab includes two items titled Hydrants_yourname. One is a service definition that contains the drawing specifications for your published service. The other is a feature layer you can add to a map.
- Click the title of the Hydrants_yourname feature layer to view its item page.
On the item page, you'll see the information about the layer, including the summary you provided when publishing the layer in the previous lesson.
- Click the drop-down arrow next to Open in Map Viewer and choose Add to new map.
A map containing the layer opens. Zoom to the Hydrants layer in necessary.
Your default extent may differ from the example depending on your monitor size and resolution.
In the Contents pane are four items: the Hydrants yourname layer; the Topographic basemap; and the Inspections and Violations tables. Their layer names are a little confusing, however. You'll change them to something more readable before continuing.
- Point to the Hydrants yourname layer. Click More Options and choose Rename.
- Rename the layer Hydrants and click OK.
- Rename the Hydrants yourname - Inspections table to Inspections. Rename the Hydrants yourname - Violations table to Violations.
Configure the layer's pop-up
Next, you'll configure the pop-up of the Hydrants layer to show data from the Inspections table. You'll adjust the pop-up's sort options so inspections appear in chronological order.
- Zoom in on the map so that individual hydrant features become distinguishable. Click any hydrant to view its pop-up.
The pop-up shows the attribute information of the Hydrants layer. The formatting is good enough, but there is some information your workforce won't need to see. You also want to make sure you can access related inspections for each hydrant through the pop-up, although currently those tables don't have any records (you'll add records in the next lesson).
- Close the pop-up.
- In the Contents pane, point to the Hydrants layer. Click the More Options button and choose Configure Pop-up.
- For Pop-up Title, type Facility ID: (including the trailing space) before the field value to give it context.
- In the Pop-up Contents section, below the list of field attributes, click Configure Attributes.
- In the Configure Attributes window, in the Display column, if necessary, uncheck OBJECTID and GlobalID and click OK.
At the bottom of the Configure Pop-up pane are options for showing related data. Show related data is checked by default. There are also options for how related data is sorted.
- In the Related Data section, click Sort Options.
The Sort Options window opens. You'll sort the inspections data chronologically.
- For Field, choose Inspection Date. For Order, choose Ascending.
- Click OK in the Sort Options window. At the bottom of the Configure Pop-up pane, click OK.
- Click any hydrant to view its updated pop-up.
Save and share the map
Now that you've created the map, you'll save and share it. To ensure you share it only with your field workforce, you'll create a group to which you can invite specific members.
- On the ribbon above the map, click Save and choose Save As.
- For the title, type Hydrant Inspections and Violations.
- For the tags, add hydrants, inspections, violations, Naperville, and Illinois.
- For the summary, type A map of fire hydrants and hydrant inspection information in Naperville, Illinois.
- Click Save Map.
The name change is reflected on the map. Now that your map is saved, you'll share it with your workforce. First, you'll exit the map and create a group. Groups allow you to choose who sees the group's content, so you can ensure only your workforce has access to the information.
- At the top of the map, click the Home menu and choose Groups.
The Groups page opens, which shows the groups (if any) of which you are a member.
- Click Create group.
A new page opens, allowing you to set the parameters of your group.
- Name your group Naperville Hydrant Inspectors. For the summary, type Content for hydrant inspectors in Naperville, Illinois. Add search tags that describe the group's content and geography, like the ones you used for the map.
You can drag or upload a thumbnail image. Good ideas for thumbnails are logos or crests of the town or department with which the group is associated. You probably don't have the Naperville city crest, so you can leave the thumbnail blank.
- For Who can view this group, click Only group members.
By making your group private, only users you invite can join and view the group's content. Accept the default for the remaining questions.
- At the bottom of the page, click Create Group.
The group is created. It has no items and no members other than you. If you want to invite members to the group, click Invite Users at the top of the page.
If using ArcGIS Online, you can invite members both inside and outside of your ArcGIS Online organization. As long as your field inspectors have ArcGIS Online accounts, you can invite them to your group.
Next, you'll share your web map with the members of the group.
- At the top of the page, click Content.
- Click Add Item to Group.
- In the Add Item to Group pane, for the Hydrant Inspections and Violations web map and the Hydrants_yourname feature layer. Click Add Item.
- Close the Add Item to Group pane.
- Click Content.
- In the Content pane, for the Hydrant Inspections and Violations web map and the Hydrants_yourname feature layer., click the Shared with group button.
- Click Overview.
In the Overview pane, verify group details and recently added content.
The Hydrant Inspections and Violations web map and Hydrants layer are now accessible through the group.
You've created a web map to collect inspection records and shared the map with your field workforce.
Inspect a hydrant
Previously, you created a map to collect hydrant inspection information. Next, you'll use Collector for ArcGIS to test how your map functions in the field by adding an inspection and a violation to a hydrant feature.
Download Collector for ArcGIS
First, you'll download Collector for ArcGIS as a free app on your smartphone or tablet. Collector allows you to remotely edit data in a shared map. Because it can be accessed from a mobile device, field workers can input the results of their on-site inspections directly into your GIS, eliminating pen and paper from the process.
- On your smartphone or tablet, find Collector for ArcGIS on
Google Play or the Amazon Appstore (for Android devices), the App Store (for iPad and iPhone), or the Microsoft Store (for Windows 10 devices).
Your experience may differ depending on whether you use the Android, iOS, or Windows version of Collector. The steps and images here are for Collector on an iPhone.
- Download and install the free app.
Open the map in Collector
Next, you'll open the Hydrant Inspections and Violations map in Collector.
- Open Collector for ArcGIS.
- If you aren't signed in, sign in to your ArcGIS organizational account.
After you sign in, a list of your maps opens. If you have only a few maps, the Hydrant Inspections and Violations map may be easy to locate in the list. If you have many maps, it may be more difficult. In case the map is not easy to locate, you'll access the map through the Naperville Hydrant Inspectors group.
- Scroll to the bottom of the list of maps to see your groups.
For Android users, tap the Menu button to view your groups.
- Tap Naperville Hydrant Inspectors.
A list of maps in that group opens. Only the Hydrant Inspections and Violations map is in the group, so it is the only map listed.
- Tap the map to open it.
If you have location services turned on, the map opens to your current location, regardless of the map content. You're probably not in Naperville, so you'll navigate there.
- Tap the Search button.
- Type Naperville in the search bar and tap Search.
Naperville, Illinois, is the first search result.
- Tap the result for Naperville to zoom to the center of the city.
- In the panel at the bottom of the map, tap the close button to close the search results and tap Cancel in the search panel to close it.
Add an inspection to a hydrant
Now that you've opened your map and navigated to Naperville, you'll perform a mock inspection of a hydrant.
- Tap any hydrant on the map.
The tapped hydrant is selected on the map. A panel opens, showing information about the hydrant.
For Android users, tap a hydrant once to select it, then tap the pop-up to expand it.
- Scroll the panel to view more of the hydrant's details.
The details include the information in the feature's attributes and actions you can take with the feature. Below the attribute information and before the actions is a section titled Related that includes inspections. For Android users, under the Inspections section, you will see options to View an inspection or to add a New inspection.
- Tap Inspections to view existing related inspection records or create new ones.
The panel shows a button to add an inspection as well as a list of inspections related to the hydrant you've tapped. Since there aren't any inspections yet, none are listed.
- Tap Add.
For Android users, under Inspections, tap New.
The Inspections form opens. It contains the fields in the Inspections table. Swipe up to view the form full screen.
- Tap the Pressure (PSI) field.
The field becomes editable.
- Enter a value of 60 (a standard PSI value for fire hydrants) and tap Next.
- Add data to the other fields. (You may have to scroll down to see some of the fields, including Inspection Date.)
This is a test, so the values you add aren't important. Most fields require only a yes or no. When you add an inspection date, the title of the form changes to include it.
- Tap Submit to send the updates.
For Android users, tap the checkmark button to save your inspection and return to the hydrant's details.
You return to the map. The hydrant feature is still selected and the new inspection form is displayed.
- Close the inspection form, and close the Inspections panel to see the hydrant's details again. Scroll down to the Related section and tap Inspections to view the inspections on the hydrant.
For Android users, under Inspections, tap View.
The inspection appears as part of a list, marked by its date. If you add more inspections, they will be organized chronologically.
Add a violation to your inspection
You published your hydrants layer to also include a table for violations observed during inspections. The Violations table does not have a direct relationship to the Hydrants layer, but it is indirectly related to it through the Inspections table. Next, you'll add a test violation to the hydrant.
- On the list of the hydrant's inspections, tap the inspection you just added.
The inspection's form and available actions display in the panel. All of the values you inputted for the inspection are shown. Below the attribute information and before the actions is a section titled Related that includes violations. For Android users, the section is titled Violations.
- Tap Violations to view existing related violation records or create new ones.
For Android users, under Violations, you can select View to see all existing records or select New to add a new record.
The panel shows a button to add a violation as well as a list of violations related to the inspection you've tapped. Since there aren't any violations yet, none are listed.
- Tap Add.
For Android users, tap New.
A form containing the fields in the Violations table opens.
- Fill out the four fields (it doesn't matter what you enter).
- Tap Submit.
For Android users, tap the checkmark button to submit the violation. Then, tap View to review the submission.
You see the new violation as well as information about the inspection and hydrant to which it is related.
In this lesson, you converted a fire hydrant inspection process from a paper form to a digital one. First, you created a relationship class between a layer of fire hydrants in Naperville, Illinois, and an empty table with fields for inspection data. Then, you published the layer to ArcGIS Online or ArcGIS Enterprise and used it to create a web map. Finally, you opened the web map in Collector for ArcGIS and added a test inspection and violation. The inspection you added was automatically updated to the web map. You can access the data through both Collector and the original web map in your ArcGIS organization.
You can find more lessons in the Learn ArcGIS Lesson Gallery.