LAYER

Used in

CONFIG  REQUEST  RESPONSE  

Servers

Image  Query  Feature  Extract  Geocode  

Parent elements

GET_EXTRACT  GET_FEATURES  GET_GEOCODE  GET_IMAGE  LAYERS  MAP 

Syntax

<LAYERAttribute Description Table

     When parent element is MAP, GET_IMAGE, GET_EXTRACT:
     (r)id="string"
     (r)type="featureclass | acetate | image"
     maxscale="string"
     minscale="string"
     name="string"
     visible="true | false" [true]

     When parent element is LAYERS in a GET_IMAGE request or map configuration file:
     (r)id="string"

     When parent element is LAYERS in an IMAGE response:
     (r)featurecount="string"
     (r)id="string"
     (r)name="string"

     When parent element is GET_FEATURES (referencing an existing layer), GET_GEOCODE:
     (r)id="string"

     When parent element is GET_FEATURES (Image Service using a dynamic layer):
     (r)id="string"
     (r)type="featureclass"

     When parent element is MAP:
     disable_prerender_clipping="true | false" [false]
     ignore_scale_for_query="true | false" [false]
>


     When parent element is MAP, GET_IMAGE, or GET_EXTRACT and LAYER type="featureclass" - Image and Extract Servers:
     (r)<DATASET... />
     <COORDSYS... />
     <DENSIFY... />
     <QUERY... /> [Either SPATIALQUERY or QUERY but not both]
     <SPATIALQUERY... /> [Either SPATIALQUERY or QUERY but not both]
     (m)<EXTENSION... /> [Only valid with MAP]
     <GROUPRENDERER... /> [Or]
     <SCALEDEPENDENTRENDERER... /> [Or]
     <SIMPLELABELRENDERER... /> [Or]
     <SIMPLERENDERER... /> [Or]
     <VALUEMAPLABELRENDERER... /> [Or]
     <VALUEMAPRENDERER... /> [Or]

     When parent element is MAP or GET_IMAGE and LAYER type="image":
     (r)<DATASET... />
     <COORDSYS... />
     <IMAGEPROPERTIES... />
     <RASTER_RENDERER... /> [Only valid with MAP]

     When parent element is MAP or GET_IMAGE and LAYER type="acetate":
     (r)(m)<OBJECT... />

     When parent element is GET_FEATURES (referencing an existing layer), GET_GEOCODE:
          No Child Elements

     When parent element is GET_FEATURES (Image Service using a dynamic layer):
     (r)<DATASET... />

     When parent element is LAYERS:
          No Child Elements

</LAYER >
(r): Attribute or child element is required.
(m):  Child element can be used multiple times.

Description

LAYER can be used in several ways depending on its context:

Parent element is Description
MAP Defines a layer used in the service.
GET_IMAGE
GET_EXTRACT
Defines an additional layer in the request.
GET_FEATURES Defines a layer for querying features.
LAYERS in LEGEND Identifies which layers in a service or request should not be included in the legend.
IMAGE Returns information on layers in the map including ID, name and number of features.

Restrictions


Notes


Attribute Descriptions for LAYER


When parent element is MAP, GET_IMAGE, GET_EXTRACT:
AttributeUsage
idUnique ID for a layer. The ID can be any combination of alpha and numeric characters. If used in a request to extract data, the characters must be in English and valid for a filename unless the extract EXTENSION for the layer is used.
maxscaleMaximum scale to display map using a relative scale such as 1:24000. Scale can also be calculated as the number of map units per pixel.
minscaleMinimum scale to display map using a relative scale such as 1:24000. Scale can also be calculated as the number of map units per pixel.
nameLayer name. Can be an alias.
typeSpecifies layer type. Use "featureclass" for shapefiles and ArcSDE vector layers. Use "image" for raster image files, GRIDs, and ArcSDE raster layers. Use "acetate" for adding graphics on top of the map.
visibleSpecifies layer visibility.

When parent element is LAYERS in a GET_IMAGE request or map configuration file:
AttributeUsage
idID as specified in map configuration file or the request. For a legend list to be valid, the ID used must have a match in the map configuration file or the request.

When parent element is LAYERS in an IMAGE response:
AttributeUsage
featurecountFor shapefile and ArcSDE layers, counts the number of features shown on the map. For image layers, counts the number of images present in the map. For acetate layers, counts the number of times OBJECT is used in a layer.
idID as specified in map configuration file or request.
nameName as specified in map configuration file or request.

When parent element is GET_FEATURES (referencing an existing layer), GET_GEOCODE:
AttributeUsage
idID as specified in map configuration file. For a request to be valid, the ID used in the request must have a match in the map configuration file.

When parent element is GET_FEATURES (Image Service using a dynamic layer):
AttributeUsage
idUnique ID for a layer. The ID can be any combination of alpha and numeric characters.
typeSpecifies layer type. The only valid value is "featureclass".

When parent element is MAP:
AttributeUsage
disable_prerender_clippingWhen set to "true", features are not clipped to the visible extent. When using ArcSDE layers, in some situations due to the size and complexity of data, performance is slow during GET_IMAGE requests when compared to using shapefile data. In this situation, clipping can be disabled, which may help performance while drawing features. This attribute can only be used in map configuration files when setting up the service.
ignore_scale_for_queryWhen set to "true", a spatial query works in an image request outside the visible scale range of that layer, and selected features are displayed. When set to "false", selected features cannot be renderered outside the scale. This attribute is valid only when in a map configuration file.
Back to top 

Examples for LAYER

Example 1: When in CONFIG.
<?xml version="1.0" encoding="UTF-8"?>
<ARCXML version="1.1">
  <CONFIG>
    <ENVIRONMENT>
      <LOCALE country="US" language="en" variant="" />
      <UIFONT color="0,0,0" name="Arial" size="12" style="regular" />
      <SCREEN dpi="96" />
    </ENVIRONMENT>
    <MAP>
      <PROPERTIES>
        <ENVELOPE minx="-178.21" miny="18.92" maxx="-66.96" maxy="71.41" name="Initial_Extent" />
        <MAPUNITS units="decimal_degrees" />
        <FILTERCOORDSYS id="4326" />
        <FEATURECOORDSYS id="4326"/>
      </PROPERTIES>
      <WORKSPACES>
        <SHAPEWORKSPACE name="shp_ws-0" directory="<path to USA ESRIDATA>"/>
      </WORKSPACES>
      <LAYER type="featureclass" name="CITIES" visible="true" id="2">
      <DATASET name="CITIES" type="point" workspace="shp_ws-0" />
      <SIMPLERENDERER>
        <SIMPLEMARKERSYMBOL type="square" width="5" />
      </SIMPLERENDERER>
      </LAYER>
    </MAP>
  </CONFIG>
</ARCXML>

Example 2: Map configuration file where layers with ID of "0" and "1" are removed from the legend list.
<?xml version="1.0" encoding="UTF-8"?>
<ARCXML version="1.1">
  <CONFIG>
    <ENVIRONMENT>
      <LOCALE country="US" language="en" variant="" />
      <UIFONT color="0,0,0" name="Arial" size="12" style="regular" />
      <SCREEN dpi="96" />
    </ENVIRONMENT>
    <MAP dynamic="true" >
      <PROPERTIES>
      <ENVELOPE minx="-180.0" miny="-90.0" maxx="180.0" maxy="90.0" name="Initial_Extent" />
      <MAPUNITS units="decimal_degrees" />
      <FILTERCOORDSYS id="4326" />
      <FEATURECOORDSYS id="4326"/>
      <LEGEND title="Legend" font="Arial" autoextend="true" columns="1" width="170" height="300" backgroundcolor="255,255,0" >
        <LAYERS>
          <LAYER id="0"/>
          <LAYER id="1"/>
        </LAYERS>
      </LEGEND>
      </PROPERTIES>
      <WORKSPACES>
        <SHAPEWORKSPACE name="shp_ws-0" directory="<path to WORLD ESRIDATA>" />
        <SHAPEWORKSPACE name="shp_ws-2" directory="<path to USA ESRIDATA>" />
        <SHAPEWORKSPACE name="shp_ws-3" directory="<path to CANADA ESRIDATA>" />
      </WORKSPACES>
      <LAYER type="featureclass" name="WORLD30" visible="true" id="0">
        <DATASET name="WORLD30" type="polygon" workspace="shp_ws-0" />
        <SIMPLERENDERER>
          <SIMPLEPOLYGONSYMBOL filltype="solid" fillcolor="0,153,255" />
        </SIMPLERENDERER>
      </LAYER>
      <LAYER type="featureclass" name="CNTRY94" visible="true" id="1">
        <DATASET name="CNTRY94" type="polygon" workspace="shp_ws-0" />
        <SIMPLERENDERER>
          <SIMPLEPOLYGONSYMBOL filltype="solid" fillcolor="255,255,153" />
        </SIMPLERENDERER>
      </LAYER>
      <LAYER type="featureclass" name="United States" visible="true" id="2">
        <DATASET name="STATES" type="polygon" workspace="shp_ws-2" />
        <SIMPLERENDERER>
          <SIMPLEPOLYGONSYMBOL filltype="solid" fillcolor="255,0,0" />
        </SIMPLERENDERER>
      </LAYER>
      <LAYER type="featureclass" name="Canada" visible="true" id="3">
        <DATASET name="province" type="polygon" workspace="shp_ws-3" />
        <SIMPLERENDERER>
          <SIMPLEPOLYGONSYMBOL filltype="solid" fillcolor="0,153,0" />
        </SIMPLERENDERER>
      </LAYER>
      <LAYER type="featureclass" name="World Cities" visible="true" id="4">
        <DATASET name="CITIES" type="point" workspace="shp_ws-0" />
        <SIMPLERENDERER>
          <SIMPLEMARKERSYMBOL color="102,0,102" width="8.0" />
        </SIMPLERENDERER>
      </LAYER>
    </MAP>
  </CONFIG>
</ARCXML>

Example 3: When used with LAYERS to remove layers with ID of "0" and "1" from the legend list.
<?xml version="1.0" encoding="UTF-8"?>
<ARCXML version="1.1">
  <REQUEST>
    <GET_IMAGE>
      <PROPERTIES>
        <LEGEND title="Legend" font="Arial" autoextend="true" columns="1" width="170" height="300" backgroundcolor="255,255,0" >
          <LAYERS>
            <LAYER id="0"/>
            <LAYER id="1"/>
          </LAYERS>
        </LEGEND>
        <DRAW map="false"/>
      </PROPERTIES>
    </GET_IMAGE>
  </REQUEST>
</ARCXML>

Example 4: Identifying a layer by its ID in a GET_FEATURES request.
<?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 5: When DATASET is used as a child element of a dynamic layer in a GET_FEATUREs request. (Valid with Image Services only)
<?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" />
      </LAYER>
      <SPATIALQUERY subfields="#ALL#" where="POP_CNTRY &gt; 100000000" />
    </GET_FEATURES>
  </REQUEST>
</ARCXML>

Example 6: IMAGE response showing details on layers in the requested ArcIMS service.
<?xml version="1.0" encoding="UTF8"?>  
<ARCXML version="1.1">  
  <RESPONSE>  
    <IMAGE>  
      <ENVELOPE minx="-180" miny="-135" maxx="180" maxy="135" />  
      <LAYERS>  
        <LAYER name="CNTRY94" id="0" featurecount="165" />  
        <LAYER name="STATES" id="1" featurecount="51" />  
        <LAYER name="province" id="2" featurecount="12" />  
      </LAYERS>  
      <OUTPUT file="c:\arcims\output\world_MYCOMPUTER3633699.jpg" url="http://mycomputer.domain.com/output/world_MYCOMPUTER3633699.jpg" />  
    </IMAGE>  
  </RESPONSE>  
</ARCXML>  

Back to top