Before performing edit operations, you need to carefully consider the source data you are working with. To start, ensure your data source has the exact schema necessary for your editing requirements. Some things to consider are the geometry type of your features, relevant data types for attributes, whether your application will need to work in an offline environment, and so on. Another important consideration is whether your application will need more advanced behavior such as subtypes, contingent values, or attribute rules. If data sources and their associated schema have already been defined and created for your application, your focus would be to perform edits in an ArcGIS Maps SDK for Qt application. However, it is possible that you might be required to create the source data that will be used in your application. The following topic covers scenarios that might require your consideration before performing edits.
Creating feature services
Feature services provide the symbology, feature geometry, and set of attribute fields (schema) for your features. Feature services contain service layers (feature data) and tables (nonspatial, tabular data) that you edit via a feature table for both online and offline feature service workflows. Feature services allow for scalable multi-client editing for data which changes over time. For more information about feature services, see What is a feature service? in the ArcGIS Enterprise documentation.
Before you build an app that performs feature service editing, you need a feature service that exposes the layers you want to edit. There are various ways to publish a feature service.
-
You can log in to your organization's portal and publish features from a variety of data sources such as CSV files, GeoJSON, shapefiles, feature collections, or file geodatabases. All these options and their steps are outlined in the publish hosted feature services topic in the ArcGIS Online documentation.
-
You can publish a feature service using ArcGIS Pro to ArcGIS Online or ArcGIS Enterprise. For offline workflows, you must enable the Feature Access capability and ensure that the service is sync-enabled. For more information, see Prepare data for offline use documentation.
-
You can create a feature layer using the ArcGIS Location Platform site. Log in to the site using your ArcGIS Online or free ArcGIS Location Platform account account. Access the Layers tab and click the Create New Layer button. For offline workflows, follow the instructions to create the new feature layer ensuring that you have checked the box to enable the layer to be taken offline to allow it to be viewed, edited, and synchronized. After creating a layer, you can add data to it in the ArcGIS Online Map Viewer.
However you publish your service, REST URLs (endpoints) are created to both a map service and a feature service. Use these URLs to reference the services in your app. The map service endpoint can be used for read-only access to features (viewing only), so make sure to reference the feature service endpoint for editing. Offline editing workflows require sync-enabled feature services. A sync-enabled feature service allows you to generate a geodatabase for offline use and gives you the ability to sync your local edits back to the service.
Using feature collections
Feature collections are static collections of features stored as JSON inside the map or a referenced portal item. Many ArcGIS Online operations create feature collections, such as adding Map Notes to your map, importing shapefiles, importing GPX files or sharing analysis results as items. There are two representations of feature collections that are important to understand when it comes to editing and saving features.
-
Feature collections in a map - feature JSON is saved in a single map as a feature collection layer.
-
Feature collections as portal items - feature JSON is saved as a portal item. These feature collections can be referenced in multiple maps.
The workflow for editing the features for both types of feature collections is the same. However, there are differences when persisting the edits so that other users can see them. Feature collections in a map persist when the map is saved. Others who open the map will see the edited features. Feature collections stored as portal items are not saved when the map is saved, you must update or save a portal item to ensure that others will see the edited features.
Feature collections should not be used for multi-user editing scenarios, as clients could easily hold on to older versions of the feature collection and overwrite each other's changes. Use feature services for these types of workflows.