GET_FEATURES

Used in

REQUEST  

Servers

Query  Feature  

Parent elements

REQUEST 

Syntax

<GET_FEATURESAttribute Description Table
     attributes="true | false" [true]
     beginrecord="integer" [0]
     checkesc="true | false" [false]
     compact="true | false" [false]
     envelope="true | false" [false]
     featurelimit="integer" [all features]
     geometry="true | false" [true]
     globalenvelope="true | false" [false]
     outputmode="binary | xml | newxml" [binary]
     skipfeatures="true | false" [false]
>

     (r)<LAYER... />
     (r)<QUERY... /> [Or]
     (r)<SPATIALQUERY... /> [Or]
     <ENVIRONMENT... />
     <WORKSPACES... /> [Image Services only]

</GET_FEATURES >
(r): Attribute or child element is required.

Description

Requests features as a compressed binary stream from the Feature Server or requests attribute data in ArcXML format from the Query Server.

Restrictions


Notes


Attribute Descriptions for GET_FEATURES

AttributeUsage
attributesDetermines whether attribute data for selected features is returned in the response.
beginrecordIndex of first extracted record.
checkescUsed to determine if the returned data should include escaped characters for ampersand, single quote, double quote, less than, and greater than. For example, if the value for SUB_REGION is "P&NW", then:

  • If checkesc="false", in the response the value of SUB_REGION is "P&NW".
  • If checkesc="true", the value of SUB_REGION is "P&amp;NW".
compactSwitches geometry to compact form in the response. See Using GET_FEATURES and FEATURES for more details. Setting compact to "true" means the geometry requires less bandwidth by the request or response. However, performance may be better when compact="false", even though the requests and responses are longer.
envelopeUsed to request the bounding envelope of each returned feature.
featurelimitMaximum number of returned features.
geometryRequests feature coordinates.
globalenvelopeWhen set to "true", the overall envelope for all the features returned is included in the response. Since the number of features returned depends on beginrecord and featurelimit, only the actual records extracted based on featurelimit are included in the overall envelope. Note that in order for the global envelope to be returned, subfields in the SPATIALQUERY must include either #SHAPE# or #ALL#.
outputmodeIf outputmode is binary, data is compressed into a binary stream. If the value of "xml" is used, data is returned in ArcXML format. This format uses a shorthand format that is faster to parse in an HTML client. If "newxml" is used, the data is returned in a longer format. See Using GET_FEATURES and FEATURES for more details.
skipfeaturesWhen set to "true", only the number of features is returned without including any information on individual features. The number of features returned depends on beginrecord and featurelimit. To get the total number of features in a layer, a query can be specified with an empty where clause. Note that even when skipfeatures is set to "true", the query is executed and features are actually extracted before they are counted. This attribute is valid only when outputmode is "xml" or "newxml".
Back to top 

Examples for GET_FEATURES

Example 1: When a layer from the service is queried.
<?xml version="1.0" encoding="UTF-8"?>
<ARCXML version="1.1">
<REQUEST>
  <GET_FEATURES featurelimit="25" beginrecord="0" outputmode="xml" geometry="false" envelope="true" compact="true">
    <LAYER id="4" />
    <SPATIALQUERY subfields="#ALL#" where="NAME  =  'Los Angeles'" >
    </SPATIALQUERY>
  </GET_FEATURES>
</REQUEST>
</ARCXML>

Example 2: When a dynamic layer is queried.
<?xml version="1.0" encoding="UTF-8" ?>
<ARCXML version="1.1">
  <REQUEST>
    <GET_FEATURES featurelimit="25" beginrecord="0" outputmode="newxml" geometry="false" envelope="true">
      <LAYER type="featureclass" id="10" >
        <DATASET name="counties" type="polygon" workspace="shp_ws-2" />
      </LAYER>
      <SPATIALQUERY subfields="#ALL#" where="POP1999 &gt; 5000000" />
    </GET_FEATURES>
  </REQUEST>
</ARCXML>

Example 3: When using projection elements.
<?xml version="1.0" encoding="UTF-8" ?>
<ARCXML version="1.1">
  <REQUEST>
    <GET_FEATURES featurelimit="25" beginrecord="0" outputmode="xml" geometry="true" envelope="true" compact="true">
      <LAYER id="4" />
      <SPATIALQUERY subfields="#ALL#" where="POPULATION > 10000000" >
        <FILTERCOORDSYS id="53030" />
        <FEATURECOORDSYS id="53030" />
        <SPATIALFILTER relation="area_intersection">
          <ENVELOPE minx="-11395772" miny="930558" maxx="-3878142" maxy="6419621"/>
        </SPATIALFILTER>
      </SPATIALQUERY>
    </GET_FEATURES>
  </REQUEST>
</ARCXML>

Example 4: When a dynamic layer with COORDSYS is used in the request.
<?xml version="1.0" encoding="UTF-8" ?>
<ARCXML version="1.1">
<REQUEST>
  <GET_FEATURES featurelimit="5" beginrecord="0" outputmode="xml" geometry="false" envelope="true">
    <LAYER id="40" type="featureclass" >  
      <DATASET name="country" type="polygon" workspace="shp_ws-0" />
      <COORDSYS id="4326" />
    </LAYER>
    <SPATIALQUERY subfields="CNTRY_NAME POP_CNTRY #SHAPE#" where="POP_CNTRY  > 100000000">
      <FILTERCOORDSYS id="54030" />
      <FEATURECOORDSYS id="54030" />
      <SPATIALFILTER relation="area_intersection">
        <ENVELOPE minx="-11395772" miny="930558" maxx="-3878142" maxy="6419621"/>
      </SPATIALFILTER>
    </SPATIALQUERY>
  </GET_FEATURES>
</REQUEST>
</ARCXML>

Example 5: When using a dynamic buffer layer (European cities) and dynamic target layer (countries) to select features. In this example, both layers reference a new workspace.
<?xml version="1.0" encoding="UTF-8" ?>
<ARCXML version="1.1">
  <REQUEST>
    <GET_FEATURES featurelimit="25" beginrecord="1" outputmode="xml" geometry="false" envelope="false">
      <WORKSPACES>
        <SHAPEWORKSPACE name="shp_ws-5" directory="<path to EUROPE ESRIDATA>" />
        <SHAPEWORKSPACE name="shp_ws-6" directory="<path to WORLD ESRIDATA>" />
      </WORKSPACES>
      <LAYER type="featureclass" id="40">  <!-- cities in Europe directory -->
        <DATASET name="cities" type="point" workspace="shp_ws-5" />
      </LAYER>
      <SPATIALQUERY subfields="#ALL#" >
        <BUFFER distance="800" bufferunits="miles">
          <TARGETLAYER id="41" type="featureclass" >  <!--countries in world directory-->
            <DATASET name="country" type="polygon" workspace="shp_ws-6" />
          </TARGETLAYER>
          <SPATIALQUERY subfields="CNTRY_NAME" />
        </BUFFER>
        <SPATIALFILTER relation="area_intersection" >
          <ENVELOPE minx="24.239598278335" miny="61.1549497847919" maxx="26.492109038737" maxy="63.3859397417503" />
        </SPATIALFILTER>
      </SPATIALQUERY>
    </GET_FEATURES>
  </REQUEST>
</ARCXML>

Back to top