Book Image

GeoServer Cookbook

By : Stefano Iacovella
Book Image

GeoServer Cookbook

By: Stefano Iacovella

Overview of this book

Table of Contents (17 chapters)
GeoServer Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

WFS versus feature access


If you open the capabilities panel for the ArcGIS service again, you will note that there is an option called feature access. This lets you enable the feature streaming to a client.

With this option enabled, your clients can acquire features and symbology information to ArcGIS and render them directly on the client side. In fact, feature access can also be used to edit features, that is, you can modify the features on the client and then post the changes on the server.

When you check the Feature Access option, many specific settings appear. In particular, you'll note that by default, the Update operation is enabled, but the Geometry Updates is disabled, so you can't edit the shape of each feature.

If you want to stream features using a standard approach, you should instead turn on the WFS option. ArcGIS for Server supports versions 1.1 and 1.0 of WFS. Moreover, the transactional option, also known as WFS-T, is fully supported.

As you can see in the previous screenshot, when you check the WFS option, several more options appear. In the lower part of the panel, you'll find the option to enable the transaction, which is the editing feature. In this case, there is no separate option for geometry and attributes; you can only decide to enable editing on any part of your features.

After you enable the WFS, you can access the capabilities from this address:

$ curl -XGET 'http://localhost/arcgis/services/SampleWorldCities/MapServer/WFSServer?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities' -o capabilitiesArcGISWFS.xml

Also, a request for features is shown as follows:

$ curl -XGET "http://localhost/arcgis/services/SampleWorldCities/MapServer/WFSServer?service=wfs&version=1.1.0&request=GetFeature&TypeName=SampleWorldCities:cities&maxFeatures=1" -o getFeatureArcGIS.xml

This will output a GML code as a result of your request. As with WMS, the syntax is the same. You only need to pay attention to the difference between the service and the contained layers:

<wfs:FeatureCollection xsi:schemaLocation="http://localhost/arcgis/services/SampleWorldCities/MapServer/WFSServer http://localhost/arcgis/services/SampleWorldCities/MapServer/WFSServer?request=DescribeFeatureType%26version=1.1.0%26typename=cities http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
    <gml:boundedBy>
        <gml:Envelope srsName="urn:ogc:def:crs:EPSG:6.9:4326">
            <gml:lowerCorner>-54.7919921875 -176.1514892578125</gml:lowerCorner>
            <gml:upperCorner>78.2000732421875 179.221923828125</gml:upperCorner>
        </gml:Envelope>
    </gml:boundedBy>
    <gml:featureMember>
        <SampleWorldCities:cities gml:id="F4__1">
            <SampleWorldCities:OBJECTID>1</SampleWorldCities:OBJECTID>
            <SampleWorldCities:Shape>
                <gml:Point>
                    <gml:pos>-15.614990234375 -56.093017578125</gml:pos>
                </gml:Point>
            </SampleWorldCities:Shape>
            <SampleWorldCities:CITY_NAME>Cuiaba</SampleWorldCities:CITY_NAME>
            <SampleWorldCities:POP>521934</SampleWorldCities:POP>
            <SampleWorldCities:POP_RANK>3</SampleWorldCities:POP_RANK>
            <SampleWorldCities:POP_CLASS>500,000 to 999,999</SampleWorldCities:POP_CLASS>
            <SampleWorldCities:LABEL_FLAG>0</SampleWorldCities:LABEL_FLAG>
        </SampleWorldCities:cities>
    </gml:featureMember>
</wfs:FeatureCollection>