BUFFER

Used in

REQUEST  

Servers

Image  Query  Feature  

Parent elements

QUERY  SPATIALFILTER  SPATIALQUERY 

Syntax

<BUFFERAttribute Description Table

     When using Feature Server:
     (r)distance="double"
     bufferunits="decimal_degrees | miles | feet | kilometers | meters" [MAPUNITS defined in PROPERTIES]

     When using Image Server:
     (r)distance="double"
     bufferunits="decimal_degrees | miles | feet | kilometers | meters" [MAPUNITS defined in PROPERTIES]
     project="true | false" [true]
>


     When parent element is SPATIALFILTER:
          No Child Elements

     When parent element is SPATIALQUERY:
     <SPATIALQUERY... />
     <TARGETLAYER... />

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

Description

Builds a buffer region around selected features.

Restrictions


Notes


Attribute Descriptions for BUFFER

AttributeUsage
bufferunitsSpecifies units that apply to buffer.
distanceBuffer area width in buffer units.
projectGenerated buffers are projected if FEATURECOORDSYS is in the map configuration file or a request. If project is set to false, the buffer is not projected.

Known limit. When projecting buffers and TARGETLAYER is used, FEATURECOORDSYS and FILTERCOORDSYS must be explicitly defined inside TARGETLAYER even if they are included in the map configuration file. Otherwise, the buffer will not project as expected. The coordinate system elements do not need to be included in a request when TARGETLAYER is not present.
Back to top 

Examples for BUFFER

Example 1: When 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="2" /> <!-- states -->
      <SPATIALQUERY subfields="#SHAPE# NAME">
        <BUFFER distance="1" >
          <TARGETLAYER id="4" /> <!-- cities -->
          <SPATIALQUERY subfields="NAME" />
        </BUFFER>
        <SPATIALFILTER relation="area_intersection" >
          <ENVELOPE minx="-16154208.3772906" miny="-4165319.9729724" maxx="-4904885.23874079" maxy="4271672.38093997" />
        </SPATIALFILTER>
      </SPATIALQUERY>
    </GET_FEATURES>
  </REQUEST>
</ARCXML>

Example 2: When in a GET_IMAGE request. Shows selected features and buffer. Note in this example that the DATASET fromlayer is "CITIES". This refers to the LAYER id in the map configuration file, not the LAYER name.
<?xml version="1.0" encoding="UTF-8"?>
<ARCXML version="1.1">
  <REQUEST>
    <GET_IMAGE>
      <PROPERTIES>
        <ENVELOPE minx="867805.08306143" miny="6771243.45626185" maxx="1576642.8482793" maxy="7302871.78017525"/>
      </PROPERTIES>
      <LAYER type="featureclass" name="theBufferTarget" visible="true" id="buffertarget">
        <DATASET fromlayer="CITIES"/>
        <SPATIALQUERY>
          <BUFFER distance="100" bufferunits="miles">
            <TARGETLAYER id="CITIES"/>
          </BUFFER>
          <SPATIALFILTER relation="area_intersection">
            <ENVELOPE minx="867805.08306143" miny="6771243.45626185" maxx="1576642.8482793" maxy="7302871.78017525"/>
          </SPATIALFILTER>
        </SPATIALQUERY>
        <SIMPLERENDERER>
          <SIMPLEMARKERSYMBOL color="255,0,0" />
        </SIMPLERENDERER>
      </LAYER>
      <LAYER type="featureclass" name="theBuffer" visible="true" id="buffer">
        <DATASET fromlayer="CITIES"/>
        <SPATIALQUERY>
          <BUFFER distance="100" bufferunits="miles" />
          <SPATIALFILTER relation="area_intersection">
            <ENVELOPE minx="867805.08306143" miny="6771243.45626185" maxx="1576642.8482793" maxy="7302871.78017525"/>
          </SPATIALFILTER>
        </SPATIALQUERY>
        <SIMPLERENDERER>
          <SIMPLEPOLYGONSYMBOL fillcolor="100,100,100" filltype="solid" filltransparency="0.5" />
        </SIMPLERENDERER>
      </LAYER>        
    </GET_IMAGE>
  </REQUEST>
</ARCXML>

Example 3: When projecting features in the target layer or when a projected envelope or global envelope is desired.
<?xml version="1.0" encoding="UTF-8" ?>
<ARCXML version="1.1">
  <REQUEST>
    <GET_FEATURES outputmode="xml" geometry="true" envelope="true" checkesc="true" globalenvelope="true">
      <LAYER id="0" ftype="polygon" />
        <SPATIALQUERY where="STATE_NAME=&apos;Nevada&apos;">
        <BUFFER distance="0" bufferunits="miles" project="true" >
        <TARGETLAYER id="1" />
          <SPATIALQUERY subfields="CITY_NAME #SHAPE#">
            <FEATURECOORDSYS id="102008" />
            <FILTERCOORDSYS id="102008" />
          </SPATIALQUERY>
        </BUFFER>
      </SPATIALQUERY>
    </GET_FEATURES>
  </REQUEST>
</ARCXML>

Back to top