- Before beginning this tutorial
- Set up an enterprise geodatabase
- Create a database user
- Author a map document to support feature services and web editing
- Prepare your enterprise geodatabase for publishing
- Publish a map service with feature access enabled
- Consume the feature service in a web application
- Further reading
Web-based editing allows a larger group of people to add to and improve on your data. These include fieldworkers, analysts in other departments of your company, or crowd-sourced volunteers who may be able to make valuable contributions to your data given a user-friendly editing interface.
In this tutorial, you'll create an enterprise geodatabase to manage shoreline bird sightings submitted by volunteers on the web. The process of performing web editing is the final step of a larger workflow. This tutorial demonstrates how to do the following:
Set up an enterprise geodatabase using a database platform such as PostgreSQL, Microsoft SQL Server, or Oracle.
Author a map document that supports web editing. This involves designing the map document so you can publish a feature service. The feature service allows users to add and edit bird sightings in your enterprise geodatabase over the web. This is a key component to any web editing workflow.
Prepare your enterprise geodatabase for publishing a feature service to an ArcGIS GIS Server site. This involves connecting to the ArcGIS Server site and registering your database with the server.
Publish your map document as a map service with the Feature Access capability enabled. This creates a feature service endpoint through which clients, such as web applications, can access and edit the bird sightings in your map.
Consume the feature service in a web application. In this tutorial, you'll use Map Viewer Classic to quickly edit, update, and delete bird sightings in your map.
Before beginning this tutorial
If you just installed ArcGIS Server, read the following before you begin this tutorial:
- For details on how to configure your ArcGIS Server site, see the Deploy section of the ArcGIS Server help.
- If you're new to enterprise geodatabases and database management, see Geodatabase administration.
- If you don't have prior experience with feature services, see Feature services
Set up an enterprise geodatabase
You can publish feature services using data from an enterprise geodatabase to an ArcGIS Server site in the ArcGIS GIS Server role. That's because enterprise geodatabases are designed to be edited simultaneously by multiple users, which is the situation you'll encounter in this tutorial. Enterprise geodatabases support a variety of database platforms.
For the purposes of this tutorial, you need to set up an enterprise geodatabase to store the features you create and edit. If you have an existing supported database platform that contains an enterprise geodatabase, proceed to the next section. If you don't, you need to create an enterprise geodatabase by installing an appropriate database platform on your machine. Before doing so, make sure that your operating system and license level of ArcGIS Server and ArcGIS Desktop support the database platform you want to install.
The following topics describe the configuration process for each database platform. They also include links to associated topics that describe how to create an enterprise geodatabase and properly configure it for your organization. Once you install the appropriate database platform and create a geodatabase, proceed to the next section in this tutorial.
Create a database user
Once you have an enterprise geodatabase, create a database user for the purposes of this tutorial. This user must have privileges to create data. You'll use the same database user to manage edits. To create a user who can create data in the enterprise geodatabase, connect to your geodatabase as the database administrator, create a database user, and reconnect to the database as the new user.
Connect to the database and create a user
- In ArcCatalog or the Catalog window in ArcMap, expand the Database Connections folder and double-click Add Database Connection .
The Database Connection dialog box appears.
- From the Database Platform drop-down list, choose the type of database with which you want to connect.
- Enter the appropriate database properties and authentication credentials to connect to the database. If you need help, see Database connections in ArcMap to learn how to enter the correct information to connect to your database.
You must connect as a database administrator to create a user. If you do not know the database administrator's credentials, ask your database administrator to create the user for you.
- Click OK.
The connection to your database appears in the Database Connections node .
- Right-click your new database connection and click Administration > Add User.
This starts the Create Database User geoprocessing tool.
- On the Create Database User dialog box, provide a new database user name and database user password, for example, User: editor, Password: tutorial.
- Click OK.
The new user is created in the database and has been granted the privileges necessary to create tables and feature classes.
Reconnect to the database as the new user
- In ArcCatalog or the Catalog window in ArcMap, expand the Database Connections folder and double-click Add Database Connection .
- On the Database Connection dialog box, provide the authentication credentials for the user you created in the previous section.
- Click OK.
You are now connected to the database as the new user.
- In the Database Connections folder , delete the first connection you established to your database.
This helps eliminate confusion when specifying your database connection file later in the tutorial.
Author a map document to support feature services and web editing
After you have a user who can create data for this tutorial, you can begin authoring a map document to support the feature service you'll use for web editing.
In this section of the tutorial, you'll do the following:
- Create an attribute domain to enforce data integrity.
- Create a feature class to represent bird sightings.
- Create feature attachments so users can add external media to their bird sightings.
- Define a layer renderer and symbology.
- Add a basemap for context.
- Add bird sightings to your map.
To get started, follow the steps in the sections below.
Create an attribute domain
To enforce data integrity when editing, configure an attribute domain to limit the sightings added to your database to a few specific bird types.
- Start ArcMap, open a new empty map document, and save the map document.
The map document does not have to be saved in a location that is visible to the ArcGIS Server account.
- In the Catalog window, expand the Database Connections folder .
- Right-click your database connection and click Properties .
- On the Database Properties dialog box, click the Domains tab.
- In the Domain Name field, click the first cell and type Type.
- In the Description column next to the domain name, click the first cell and type Bird Type.
- In the Domain Properties section, click the cell next to Field Type and choose Long Integer.
- Click the cell next to Domain Type and click Coded Values.
- In the Coded Values section, click the first cell under Code and type 0.
- In the Description column next to the code, click the first cell and type Alcid/Pelagic.
- Type the remaining bird types in the Coded Values section from the following table:
Code Description 1
Diving Bird
2
Gull/Tern
3
Raptor
4
Shorebird
5
Wading Bird
6
Waterfowl
7
Unknown
- Click OK.
Create a feature class
In this section, you'll create a point feature class that represents the various types of birds you'll use in your bird sightings feature service. This includes defining the spatial reference of the feature class and assigning your domain to a new field in the feature class table. To get started, follow these steps:
- In the Catalog window, right-click your database connection and click New > Feature Class.
- On the New Feature Class dialog box, type shoreline_birdsightings in the Name field.
- From the Type drop-down list, choose Point Features. Click Next.
- In the coordinate system search box, type web mercator (auxiliary sphere) and click Search .
- In the results list, choose WGS 1984 Web Mercator (auxiliary sphere). This is the same coordinate system used by ArcGIS Online and allows you to seamlessly overlay your feature service with ArcGIS basemap services. Click Next.
- In the XY Tolerance panel, accept the defaults and click Next.
- In the Configuration Keyword panel, accept the defaults and click Next.
- In the Field Properties panel, in the Field Name column, click the cell below SHAPE and type TYPE.
- In the Data Type column, click the cell below Geometry and choose Long Integer.
- Edit the properties of the field by clicking the cell to the right of Domain and choosing Type.
This specifies that the field only accepts the values defined in the Type domain you created earlier in the tutorial.
- In the Field Name column, click the cell below the TYPE field and type COMMENTS.
- Specify the data type of the COMMENTS field to be Text.
- Click Finish.
Your feature class is created and automatically added to the table of contents.
Create feature attachments
In this section, you'll add feature attachments to your feature class. An attachment is a media file, such as an image, PDF, or video, that you associate with a feature when it's created or edited. For example, when a user adds a shoreline bird sighting to the database, they can attach a photograph of the bird for additional context. When someone clicks the feature in a map, he or she can view the attachment.
- In the Catalog window, expand the connection to your enterprise geodatabase.
- Right-click the shoreline_birdsightings feature class and click Manage > Create Attachments.
ArcMap adds a new table to contain the attached files and a relationship class to manage the link between the features and their attachments.
Define a layer renderer and symbology
In this section, you'll define a layer renderer and symbology for the various bird types in your feature class. The way you symbolize your features is important, because features display on the web using the symbology defined in the map document.
- In the ArcMap table of contents, click List by Drawing Order .
- Right-click the shoreline_birdsightings layer and click Properties .
- On the Layer Properties dialog box, click the Symbology tab.
- Under Show, click Categories > Unique values.
This specifies that you'll use a unique value renderer for all the features in the feature class.
- In the Value Field drop-down list, choose type.
- Click Add All Values.
Each bird type is added to the list.
- Uncheck the check box next to the <all other values> symbol.
- Double-click the symbol next to the Alcid/Pelagic bird type.
- On the Symbol Selector dialog box, type alcid in the search field and click Search .
- Select the Alcid/Pelagic Bird symbol and increase its size to 25.
- Click OK.
The symbol is applied to the Alcid/Pelagic bird type.
- Based on the following criteria, use the symbol search to specify the symbology for the remaining bird types:
- When you finish specifying the symbology, click OK on the Layer Properties dialog box.
The symbology appears in the ArcMap table of contents.
Bird type | Search criteria | Symbol | Size |
---|---|---|---|
Diving Bird | diving bird | 25 | |
Gull/Tern | tern | 25 | |
Raptor | raptor | 25 | |
Shorebird | shorebird | 25 | |
Wading Bird | wading bird | 25 | |
Waterfowl | waterfowl | 25 | |
Unknown | question mark (In the results list, choose the ESRI_Optimized style.) | 25 |
Add a basemap for context
For context, add a basemap to your map document from ArcGIS Online.
- From the main menu in ArcMap, click File > Add Data > Add Basemap.
- Choose Light Gray Canvas as the basemap and click Add.
The basemap is added to your map display.
- Zoom in to an area of interest, for example, a familiar coast or shoreline, and save your map document.
Add features to your map
Now that you symbolized your features appropriately and added a basemap for context, set up the proper editing environment and add features to your map.
- In ArcMap, display the Editor toolbar by clicking Customize > Toolbars > Editor from the main menu.
- On the Editor toolbar, click Editor > Options.
- On the Editing Options dialog box, click the Versioning tab.
- Because the data in your geodatabase does not participate in versioning, uncheck Edit a version of the database with the ability to undo and redo.
Disabling this option allows you to edit data that is not versioned.
- Click OK.
- On the Editor toolbar, click Editor > Start Editing.
A default feature editing template is created based on the symbology of the editable layers in your map document. You'll use this feature template in the next step to add features to your map.
- On the Editor toolbar, click Create Features .
- In the Create Features window, select a bird type and add it to the map.
- On the Editor toolbar, click Attributes .
- In the Attributes window, add a comment and attachment to the feature you created. You can search the web for a picture of the bird you chose, save it as an image, and add it as an attachment.
- In the table of contents, right-click the shoreline_birdsightings layer and click Open Attribute Table.
- In the Table window, verify that your feature and comments are included in the table. Close the table when you're finished.
- Repeat steps 7–12 to add another bird sighting to your map.
- On the Editor toolbar, click Editor > Stop Editing. When prompted to save your edits, click Yes.
- Save your map document.
Prepare your enterprise geodatabase for publishing
Now that you created and edited your map document, you're ready to prepare your enterprise geodatabase for publishing. To do so, do the following:
- Remove the basemap layer.
- Connect to the ArcGIS Server site.
- Register your database with the ArcGIS Server site.
To get started, follow the steps in the sections below.
Remove the basemap layer
You cannot publish a basemap as part of a service, so you need to remove the basemap before publishing a feature service.
- In the ArcMap table of contents, right-click the basemap and click Remove.
- Remove the reference layer.
- Save your map document.
Connect to ArcGIS Server
ArcMap must have access to the ArcGIS Server site to which you will publish.
- In the Catalog window in ArcMap, expand the GIS Servers node.
- Double-click Add ArcGIS Server .
- Click Publish GIS services and click Next.
- For Server URL, type the URL of the ArcGIS Server site to which you want to connect.
The default is https://gisserver.domain.com:6443/arcgis. The URL varies depending on the Web Adaptor configuration. See Components of ArcGIS URLs for additional URL examples.
- In the Server Type drop-down list, make sure ArcGIS Server is selected.
- For the purposes of this tutorial, accept the default staging folder location.
- If your server administrator has enabled security for your site, provide your user name and password. Click Finish.
A publisher connection to ArcGIS Server is created in the GIS Servers node.
Register your database with ArcGIS Server
Because your map document references data residing in an enterprise geodatabase, register the enterprise geodatabase with ArcGIS Server to provide the ArcGIS Server site with access to the enterprise geodatabase and the data referenced by your map document.
- In the Catalog window, right-click your publisher connection to ArcGIS Server and click Server Properties.
- On the ArcGIS Server Properties dialog box, next to the Registered Databases panel, click Add .
- On the Register Database dialog box, provide a unique name for the registered database.
Names can be alphanumeric and contain spaces, for example, Shoreline Bird Sightings GDB.
- In the Publisher database connection section, click Import.
- On the Browse for a Database Connection dialog box, click the Look in drop-down list and choose Database Connections.
- Select the connection to your database and click Select.
- In the Server database connection section of the Register Database dialog box, make sure the Same as publisher database connection check box is checked.
This specifies that both ArcMap users and web users accessing the feature service can view and manipulate the data in the bird sightings geodatabase simultaneously. Learn more about registering your data with ArcGIS Server.
- Click OK.
Your enterprise geodatabase is registered with the ArcGIS Server site and appears on the Registered Databases dialog box.
- Click OK to close the ArcGIS Server Properties dialog box.
Publish a map service with feature access enabled
Now that you prepared your data and map, you can publish your map document with the Feature Access capability enabled. This creates a feature service endpoint to your map service through which clients, such as web applications, can access and edit the features in your map.
To publish your map document with the Feature Access capability enabled, follow these steps:
- From the main menu in ArcMap, click File > Share As > Service.
- In the Share as Service window, choose Publish a service. Click Next.
- In the Publish a Service dialog box, choose the publisher connection to ArcGIS Server you set up earlier in the tutorial.
- By default, the name of the map document dictates the service name. Instead of using the default, type Shoreline_BirdSightings. Click Next.
- By default, services are published to the root folder (root) of ArcGIS Server. Accept the default location and click Continue.
The Service Editor dialog box appears. Use Service Editor to choose what users can do with your feature service and to control how the server exposes your feature service.
- Click the Capabilities tab.
By default, mapping and KML are enabled.
- Choose Feature Access.
Enabling this option creates a feature service associated with your map service. The associated feature service allows clients to perform feature editing over the web.
- In the left pane of the Service Editor dialog box, click Feature Access and review the URLs, operations, and properties enabled for your feature service. For the purposes of this tutorial, you can accept the default values because editing is enabled by default when you publish a feature service.
- In the left pane of the Service Editor dialog box, click Item Description and enter the following summary and tags for your service:
- Summary: The Shoreline Bird Sightings feature service allows users to add common shoreline bird sightings to a map, attach photographs to sightings, and input comments.
- Tags: shoreline, bird, sighting
- Click Publish .
Your feature service is published to the ArcGIS Server site.
- When the service publishes successfully, click OK on the Service Publishing Result message.
You're ready to consume your shoreline bird sightings feature service in a web application.
Consume the feature service in a web application
In this section, you'll use Map Viewer Classic in ArcGIS Online to add, update, and edit features in your bird sightings enterprise geodatabase over the web. You can deploy Map Viewer Classic directly through the ArcGIS Server Service Directory. It does not require any configuration or programming to get Map Viewer Classic up and running.
To get started, follow these steps:
- Open a web browser and browse to the ArcGIS Server Services Directory. Typically, this is located at http://gisserver.domain.com:6080/arcgis/rest/services.
You can also access the Services Directory by opening the shortcut installed with ArcGIS Server.
- In the services list, click Shoreline_BirdSightings (FeatureServer).
On the Shoreline_BirdSightings (FeatureServer) page, the bird sightings feature service is listed along with its supported operations.
- Click View In: ArcGIS Online Map Viewer.
A new window or tab opens, displaying the service in Map Viewer Classic. The display is zoomed to the features you added previously to ArcMap.
- At the top of Map Viewer Classic, click Edit.
The bird types you symbolized appear in the Add Features pane.
- Take some time to pan and zoom, add features to the map, delete features, modify feature geometry, and add attachments. Optionally change the basemap.
- To verify that edits to your features are reflected in your enterprise geodatabase, switch back to your ArcMap document. In ArcMap, click the View menu and click Refresh.
The features you added to your web map appear in the map display in ArcMap.
- Optionally save the web map. To do so, you must sign in with your ArcGIS organization credentials.
Further reading
Now that you've successfully tested your feature service using Map Viewer Classic, consider how you can use and share your feature service in other ArcGIS clients:
- ArcGIS Enterprise also has a Map Viewer Classic. You can share your feature service with a portal organization of which you're a member and allow others to edit the feature service in Map Viewer Classic.
- In ArcGIS Online and ArcGIS Enterprise, you can create a customized web mapping application using the application templates. These templates can be deployed on your organization's web server.
- ArcGIS API for JavaScript offers the most advanced web mapping capabilities and customization options. If you're comfortable programming using this API, you can create a rich editing experience for your users on the web using a feature service identical to the one you created in this tutorial.
Remember that web-based editing allows external users to add to and improve on your data. By exploring one or all of the ArcGIS clients listed above, you have additional options that can help you tailor your editing scenario for a specific purpose, goal, or organizational strategy.