The following provides an example for creating a new file geodatabase, adding features and domains, publishing the feature class as a hosted service to ArcGIS Online, and adding it to a web map for field applications.


Design Considerations

In part 2 of this class, we are investigating how geofences can be used in a web application. One possibility is to design our own geofences through a field survey using geospatial data collection tools (e.g., Collector or QuickCapture).

As a design challenge, the first goal is to brainstorm what data need collecting.

Geofences are by definition virtual areas; therefore, I could collect polygon features; however, are there any other geometries that matter?

I may be interested in knowing whether someone is in proximity of a feature of interest, which is best represented by a point.

I may also be interested in knowing if someone is within a particular distance of a road, sidewalk, or path, which would benefit me to collect a line feature as well.

As many of you already know, spatial data are not just vector geometries, but also constitute the essential attribute data as well. When it comes to field applications, your goal is to capture the world as you encounter it. What do you expect to encounter? How do you characterize it? What attributes both serve as important descriptors of the geometries and provide functionality for a web application?

One of the first steps would be to look at an example web application to see what information is used.

In this example, let’s say I want a user to “activate” my geofences whereby entering them causes the geofence to become visible on their web map (it is invisible to the user initially), revealing the geofence’s geometry and filling with a given color, effectively creating a pseudo color-by-numbers. Maybe the user has to activate the geofences in a particular order. The specific order is hinted to the user via a popup with some text that tells them where to go next. I envision my use walking around and having shapes filled with color appearing on their map.

To facilitate all this, my features will likely need the following attributes:

Table 1. Common fields for feature classes.
Attribute Description
OrderNum The correct order in which geofences are to be activated; note that I am not relying on the FID such that I can easily change the order at a later time.
FillColor The fill color I wish my geofence area to be.
HintText The hint text for the popup.
IsEnabled A field to turn specific features on and off; for example, to create custom maps or if a feature is giving me trouble.
Name I may want to give each geofence a meaningful name for easy reference.

Creating a New File Geodatabase in ArcGIS Pro

Like the shapefile, the file geodatabase is an Esri creation and is designed to work with ArcGIS suite of software. Because the mobile applications for field collection we are focusing on are also Esri products, these steps will work.

For those without access to Esri products, you can learn more about geodatabases here and more about domains here and here.

  1. Create a workspace folder (e.g., C:\Workspace\Project)
  2. Start ArcGIS Pro
  3. Open a new blank project (e.g., Geofence)
  4. In Catalog, under Folders, find the project folder Geofence
  5. Right-click the project folder and select New --> File Geodatabase
  6. Right-click the new geodatabase and rename it “geofence_[YOURINITIALS]” (e.g., geofence_twd.gdb)
  7. Right-click on your geodatabase and select “Edit Metadata”
  8. Enter your geodatabase information (see below for my example metadata) and don’t forget to click the purple Save icon when you are done
    • Title: Davis’s Geofencing File Geodatabase
    • Tags: Advanced, GIS, Geofence, W&M
    • Summary: A file geodatabase for storing geometries for a field survey of geofencing features.
    • Description: This file is a part of W&M Advanced GIS class for the spring semester of 2020. The goal of this project is to collect geometries that can be used in a story-telling web application using geofences.
    • Credits: Dr. Davis, Center for Geospatial Analysis, William & Mary, Williamsburg, VA.
    • Appropriate Scale Range: between Buildings (1:5000) and City (1:50,000)

Adding a Feature Class to Your File GDB

Create a new Feature Class in your geodatabase. You may create multiple feature classes within a single geodatabase. In this example, I am going to start with creating a point feature class for storing my points of interest (POI).

For more information on the basics of creating a feature class within a geodatabase in ArcGIS Pro, see here.

  1. Right-click on the geodatabase in the Catalog and select New --> Feature Class
  2. Enter the information in the New Feature Class window
    • Name: landmarks
    • Alias: POI
    • Feature Class Type: Point
    • Geometry Properties: (leave both options unchecked)
      • M values are measurement values (for more, see here)
      • Z values are elevation values (for more, see here)
  3. Click “Next”
  4. Fields
    • Leave fields as they are for now, which is likely just OBJECTID and SHAPE
  5. Click “Next”
  6. Choose the feature’s spatial reference (should default to the map CRS)
    • Projected Coordinate Systems
      • State Plane
        • NAD 1983 (Meters)
          • NAD 1983 StatePlane Virginia South FIPS 4502 (Meters)
            • EPSG:32147
  7. Click “Next”
  8. Leave XY tolerance values as default
    • “it is best to use the default x,y tolerance values in all but extreme cases” (for more on XY tolerance, see here)
  9. Click “Next”
  10. Leave Resolution as default
  11. Click “Next”
  12. Leave database storage configuration as default
  13. Click “Finish”

For each feature class in your geodatabase, make certain you use the same coordinate system. Import the coordinate system from an existing layer to ensure it is the same across all your layers.


Adding Additional Fields

Create new fields (attributes) for your feature class. One the most challenging parts of creating fields is deciding the correct data type and size/length. This can be especially tricky for text fields where you may run out of characters if you made a poor design decision for your attribute.

  1. Right-click “landmarks” feature class in the Catalog and select Design --> Fields
  2. At the bottom of the table, “Click here to add a new field”
  3. Enter a new field for the closest trail name
    • Field Name: NAME
    • Alias: Name
    • Data Type: Text
    • Allow NULL values: No (unchecked)
    • Domain: (leave blank)
    • Default Value: (leave blank)
    • Length: 100
  4. Enter a new field for surveyor’s name (initials)
    • Field Name: SURVYR
    • Alias: Surveyor
    • Data Type: Text
    • Allow NULL values: No (unchecked)
    • Domain: (leave blank)
    • Default value: (your initials)
    • Length: 4
  5. Enter a new field for field notes
    • Field Name: NOTES
    • Alias: Notes
    • Data Type: Text
    • Allow NULL values: Yes (checked)
    • Default value: (leave blank)
    • Length: 255
  6. Enter a new field for the timestamp
    • Field Name: DATETIME
    • Alias: Date
    • Data Type: Date
    • Allow NULL values: No (unchecked)
    • Domain: (leave blank)
    • Default Value: (leave blank)
  7. Click “Save” in the Fields ribbon

Adding Optional GPS Receiver Fields

Create additional fields for recording the GPS receiver data1. Note that these fields only really work with point-based geometries.

  1. Enter a new field for GPS receiver name
    • Field Name: ESRIGNSS_RECEIVER
    • Data Type: String or Text
    • Alias: Receiver Name
    • Allow NULL values: Yes
    • Default value: (leave blank)
    • Length: 50
  2. Enter a new field for GPS receiver’s horizontal accuracy
    • Field Name: ESRIGNSS_H_RMS
    • Data Type: Double
    • Alias: Horizontal accuracy
    • Allow NULL values: Yes
    • Default value: (leave blank)
  3. Enter a new field for GPS latitude
    • Field Name: ESRIGNSS_LATITUDE
    • Data Type: Double
    • Alias: Latitude
    • Allow NULL values: Yes
    • Default value: (leave blank)
  4. Enter a new field for GPS longitude
    • Field Name: ESRIGNSS_LONGITUDE
    • Data Type: Double
    • Alias: Longitude
    • Allow NULL values: Yes
    • Default value: (leave blank)
  5. Enter a new field for GPS fix time
    • Field Name: ESRIGNSS_FIXDATETIME
    • Data Type: Date
    • Alias: Fix time
    • Allow NULL values: Yes
    • Default value: (leave blank)
  6. Click “Save”

Creating Domains

Create and apply domains for your fields. These will be used in Collector for creating the selection boxes for attributes (i.e., saves you from having to type).

  1. In the Catalog, right-click on your geodatabase and select Design --> Domains
  2. In Domains ribbon, click on “New Domain”
  3. Create a domain for surveyor initials
    • Domain Name: Surveyor
    • Description: Surveyor initials
    • Field Type: Text
    • Domain Type: Coded Value Domain
    • Split Policy: Default Value
    • Merge Policy: Default Value
    • Coded Values: as needed; see example below. Remember: it’s a good idea to have a miscellaneous/other/unknown domain values to catch unexpected results when you are out in the field. When you encounter these, make sure you include something in your NOTES field to explain the unique situation.
      • Code: TWD
      • Description: T. Davis
      • Code: MISC
      • Description: Other
  4. Create a domain for the date and time
    • Domain Name: DateTime
    • Description: Date and time of survey
    • Domain Type: Range
    • Field Type: Date
    • Split Policy: Default Value
    • Merge Policy: Default Value
    • Minimum value: 2020-01-01 00:00:00
    • Maximum value: 2020-12-31 23:59:59
  5. Click “Apply”
  6. Click “OK”

Apply domains to fields and set default values.

  1. In the Catalog, right-click “landmarks” and select Design --> Fields
  2. Double-click the domain box for row SURVYR
    • For Domain, select “Surveyor”
    • For Default Value, type: [YOURINITIALS]
  3. Select DATETIME
    • For Domain, select “DateTime”

Enabling Attachments

Adding attachments to your feature class adds support for a variety of file types (e.g., photos). This is accomplished through a geoprocessing tool, “Enable Attachments.”

First, right-click on the feature class, “landmarks”, and select “Add to Current Map.”

Then go to geoprocessing tools: Data Management --> Attachments --> Enable Attachments.


Assigning Symbology

Create meaningful symbology for the various features in your map.

  1. Beginning with a new empty map, click on File --> Add Data --> Add Data... (or click on the Add Data icon, ) and add the feature(s) from your geodatabase
  2. In the Table of Contents, list by source
  3. Right-click your feature class and select “Properties…”
  4. Click on Symbology tab
  5. Under Show, click Categories and select “Unique values”
  6. Under Value Field, select the appropriate field
  7. Click “Add All Values”
  8. Update Symbol and Label as desired

Note that 3D marker symbols are not currently supported in ArcGIS Online and therefore cannot be used with Collector.


Publishing as a Service

A personal file geodatabase can be published to ArcGIS Online as a hosted service for editing online, sharing with other users, and accessing with Collector.

  1. In ArcGIS Pro, from the Catalog, right-click the feature class you want to share and select “Add to Current Map”
  2. In the Contents pane, right-click the layer and select Sharing --> Share As Web Layer
  3. Provide the layer with a summary and tags (if you haven’t already).
  4. Select the web folder you wish to save it to.
  5. Choose who to share the layer with (e.g., Groups)
  6. Update the layer metadata, for example:
    • Summary: A file geodatabase for storing features for field litter surveys.
    • Tags: Collector, GPS, Litter, Catawba
    • Description: This file is a part of Catawba College’s ENV 3599 Intermediate GIS/Field GPS spring semester 2018 litter survey project. The goal of this project is to use GPS receivers to survey campus litter and perform analyses using GIS geospatial tools.
  7. You may receive a warning that “Layer does not have a feature template.” You may ignore this warning as a default template will be created for you.
  8. Log into ArcGIS online to edit the layer settings, such as editing, updating, sync’ing, and downloading.
  9. Click on Sharing and select our group (i.e., ENV 3599)
  10. Click on Analyze at the top of the window and check to make certain no error messages appear (red x’s)
  11. Click Publish

Enabling Edits, Sync and Export

In ArcGIS Online, find the newly create hosted feature class. Click on Settings in the top menu and scroll down until you see Feature Layer (hosted).

Check the boxes next to Enable editing and Enable Sync (you may also check the other two boxes for tracking feature creation and updates).

Scroll down to the bottom and check the box next to Export Data. This will allow you to download the hosted feature class as a shapefile in ArcGIS Pro.


Creating a Web Map

To use a hosted feature service with Collector, it must first be incorporated into a web map, which may be accomplished in ArcGIS Online.

  1. Open a web browser and go to https://arcgis.com
  2. Log in with your ESRI account details
  3. Click on Content
  4. Find your published Feature Layer; note there should also be a Service Definition file with the same name
  5. Click the more details button next to your feature layer (i.e., ...) and select “Add to a new map”
  6. In the “Find address or place” search bar in the top right, type your location (e.g, “Williamsburg, VA”)
  7. Click the suggestion option and zoom over your area of interest (this will be the default extents)
  8. Click Details at the top to open the Contents panel on the left
  9. Click on layer name to open the dropdown
  10. Click on the more options button (i.e., ...) and select “Rename”
  11. Rename your layer
  12. optional Zoom in closer to a starting location or area of interest and click on “Bookmarks” and “Add Bookmark”
    • Title the bookmark
    • Click the close box to close the bookmarks menu
    • Zoom out
    • Click on Bookmarks and select the bookmark you just created to zoom back in
    • You can create other bookmarks if you wish; these will be available to you in Collector
  13. Here, you may also change the basemap style (currently set to Topographic)
  14. Click Edit in the menu at the top and select Manage at bottom of the panel on the left
  15. When your map is ready, click Save --> Save As
  16. Enter the information for your map
    • Title: please include your initials in the title
    • Tags: Collector, GPS, AdvGIS, W&M
    • Summary: A web map for field surveying.
  17. Click “Save Map”

Share your map.

  1. Click on Home --> Content in the top left of the web map to return to your Content page
  2. Next to your map, click the lock icon to open the Share window, check the box next to our AGOL group and click “OK” to share

Arcade

Arcade is a new secure and portable expression language with the goal of being able to run across all ArcGIS products (mobile, desktop and cloud)2.

The benefit of Arcade is its ability to create new derived attributes as on-the-fly calculations, rather than using the field calculator on a new field. This is handy for simple operations like changing the units of a field or calculating averages across fields without the overhead of storing the results in the database3.


  1. https://doc.arcgis.com/en/collector/windows/create-maps/gps-map-prep.htm↩︎

  2. https://blogs.esri.com/esri/arcgis/2016/12/19/introducing-arcade/↩︎

  3. https://blogs.esri.com/esri/arcgis/2016/12/15/use-arcade-expressions-to-map-your-ideas/↩︎