Hướng dẫn sử dụng phần mềm arcgis Informational, Transactional
WFS services support simple features from Esri sources, such as shapefiles and geodatabases. However, if you're going to enable transactions on the service (WFS-T), all data that you want to edit must be stored in a workgroup or enterprise geodatabase. This tutorial demonstrates the workflow to be used when working specifically with versioned data. Show
Before beginning this tutorialIf you've just installed ArcGIS Server, you need to complete some preparatory steps before you can connect to the server and publish services:
Deciding between a geodata service or a map serviceWith WFS services, you have the option of publishing a geodata service or a map service. There are a few differences to be aware of when selecting the type of service you're going to create. The following sections summarize the functionality available with map and geodata services to help you identify which type of service best suits your requirements. Geodata serviceA WFS geodata service allows you to access a workgroup, enterprise, or file geodatabase through the Internet or any OGC-compliant WFS client. When creating a WFS service from a geodata service, it's important to keep in mind that all the feature classes in the geodatabase will be exposed in the service. Geodata services are useful in situations where you need to access geodatabases in remote locations. For example, a company may want to set up enterprise geodatabases to manage data in its Los Angeles and New York offices. Once created, each office can publish its enterprise geodatabase on the Internet using a geodata service. Map serviceA WFS map service represents a map document that you've made available to others through the Internet or any OGC-compliant WFS client. Map services with WFS functionality give you a lot of control over the data that's published through the service. The following are common reasons why you might set up a map service:
There are also some limitations associated with WFS map services. Consider the following when publishing a WFS service from a map document:
Preparing data for a WFS-T serviceBefore creating a WFS service with read and write access, there are some initial requirements to set up your data:
Follow these steps to prepare your data for a WFS-T service with versioned data:
If you're creating a map service, continue to the section below. If you're creating a geodata service, continue to the section below. For map servicesTo ensure that the map service publishes the appropriate data when it's created, your map document must be updated so that it references the newly created WFS version.
For geodata servicesTo ensure that the geodata service publishes the appropriate data when it's created, the connection properties of the geodatabase must be updated so that they reference the new WFS version that has been created.
Publishing a WFS-T service to ArcGIS ServerTo get started publishing a WFS-T service, follow these steps:
Consuming the WFS serviceOnce you've published a WFS service, it can be used in any client that supports WFS 1.1.0 and the Simple Features profile of GML, including web browsers. A web browser is one of the simplest clients of a WFS service. You can request information through HTTP, and the responses or exceptions are returned through the browser. Follow these steps to access WFS services through a web browser:
GetCapabilitiesThis request will return all feature types and functionality available through the service in GML format. To use the GetCapabilities operation, copy and paste the WFS service URL into the address bar and add ?request=getcapabilities to the end of the URL. URL example: http://gisserver.domain.com:6080/arcgis/services/wfs_services/enterprise_wfs/GeoDataServer/WFSServer?service=WFS&request=GetCapabilities The following graphic is an example of functionality returned by the GetCapabilities operation: GetCapabilities also returns a list of all available feature classes and tables: DescribeFeatureTypeThis request describes the field information about one or more features in the WFS service. This includes the field names, field types, allowed minimum and maximum field values, and any other constraints set on a field of the feature classes or tables. To use the DescribeFeatureType operation, copy and paste the WFS URL into the address bar and add ?SERVICE=WFS&REQUEST=DescribeFeatureType&VERSION=1.1.0 to the end of the URL. This will return all the field information about each of the feature types and tables available in the feature service. URL Example: http://gisserver.domain.com:6080/arcgis/services/wfs_services/enterprise_wfs/MapServer/WFSServer?SERVICE=WFS&REQUEST=DescribeFeatureType&VERSION=1.1.0 Adding filters You can also specify a single feature class or table for which you want the field information by appending the following request to the end of the URL with the name of the feature type or table: ?SERVICE=WFS&REQUEST=DescribeFeatureType&TypeName= For more information about the different filters available with WFS services, see . In the following example, the DescribeFeatureType request is used to identify the field information for the feature type called continent: URL example: http://gisserver.domain.com:6080/arcgis/services/wfs_services/enterprise_wfs/GeoDataServer/WFSServer?SERVICE=WFS&REQUEST=DescribeFeatureType&typeName=Continent&VERSION=1.1.0 GetFeatureThis request returns information about specific feature types available through the WFS service. To use the GetFeature operation in a web browser, copy and paste the WFS URL into the address bar and add ?request=getFeature&typename= URL example: http://gisserver.domain.com:6080/arcgis/services/wfs_services/enterprise_wfs/MapServer/WFSServer?service=WFS&request=getfeature&typename=cities Adding filters You can also add filters in the request to refine the results that are returned. For example, you can request all the cities that are within a specified coordinate range. In the following example, two cities are located within a specified coordinate range. For more information about the different filters available with WFS services, see the topic . URL example: http://gisserver.domain.com:6080/arcgis/services/wfs_services/enterprise_wfs/MapServer/WFSServer?service=WFS&request=GetFeature&typeName=cities&BBOX=46.90,-76.21,42.12,-72.88 Using the Data Interoperability extension to connect to a WFS serviceThe ArcGIS Data Interoperability extension allows you to read and write data in data formats other than ArcGIS. You can use the Interoperability Connection tool in ArcCatalog or the Catalog window in ArcGIS Desktop to connect directly to external Esri data formats, including WFS services. Once the connection is made, the data source will appear under the Interoperability Connection entry in the Catalog tree. A connection is just like any other dataset in that you can add it to the table of contents or use it in geoprocessing tools. Managing edits made through a WFS-T service with versioned dataIt's important to create an efficient workflow for managing edits made through a WFS-T service. Assuming you have followed the recommended method of creating a separate WFS version for WFS-T editors to work with, the system that you have set up should look similar to the following diagram: Web editing with a WFS-T service using versioned data.In this example, WFS-T editors and ArcMap editors use versions so that each group can have their own isolated view of the geodatabase to work with. ArcMap editors are directly editing the default version through ArcMap. WFS-T editors are accessing the WFS service over the Internet. This allows WFS-T editors to make edits on the WFS version that was created as a child of the default. To learn more about versions, see in the desktop help system. To keep the two versions in sync, a process can be run regularly to update the WFS version with edits from the default version and to update the default version with the edits from the WFS version. This is a two-step process in the editing workflow of any versioned system called reconcile and post. This process can be automated, or it can be administered by an editor (depending on his or her permissions) or database administrator. To learn more about the reconcile and post process, see . When run, the reconcile operation will pull updates from the default version into the current editing session on the WFS version. Conflicts may occur if edits have been made to the same features in both versions. You can either set up conflict resolution to be automatic or choose to resolve each conflict manually through the conflict resolution dialog box. After handling any conflicts, the post operation can be run. This process merges changes from the WFS version into the default version. The whole reconcile and post process is summarized in the following diagram. Here, the WFS version pulls updates from the default version during reconcile. After incorporating the changes, the WFS version posts its updates to the default version using the post operation. At this point, the default and WFS versions both have the same content. The reconcile and post process between the default and WFS versions.Once the reconcile and post process is complete, both versions are up-to-date with the most current representation of the features, and WFS editors can continue making edits again. It's important to note that if there are outstanding locks when reconcile and post is run, the system will not allow the process to succeed. This is a safeguard to prevent conflicts between features locked by WFS-T clients and features changed through the reconcile and post process. Also, running reconcile and post will lock the WFS-T version to prevent any lock and transaction calls from being made by WFS-T editors during the reconcile and post process. To accommodate this safeguard, it's recommended that the reconcile and post process be run at well-established times that all WFS-T editors have prior knowledge of. This will allow the editors to get their changes posted to the database. Administrators may also need to manually remove locks from the locks table before the reconcile and post. |