BUFFER | Examples |
<BUFFER |
Attribute Description Table
|
When using ArcMap or Feature Server: distance ="double" bufferunits ="decimal_degrees | miles | feet | kilometers | meters" [MAPUNITS defined in PROPERTIES] When using Image Server: 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 > | |
Bold: Attribute or child element is required. |
When using the Image Server, a feature is selected and a buffer is created around the feature. Next, the target layer is applied. All features that fall within the buffer are selected. In this example, Belgium is selected and buffered 100 miles. The resulting buffer is around Belgium only. Since the countries layer is also the target layer, all surrounding countries that fall within the buffer are highlighted. | |
When using the ArcMap Server, a feature is selected and a buffer is created around the feature. Next, the target layer is applied. All features that fall within the buffer are selected. The buffer is then applied to these features as well. In this example, Belgium is selected and buffered 100 miles. All countries within the 100-mile buffer are selected. The final 100-mile buffer is generated around all selected countries. The buffer in this example is represented by the diagonal lines. |
To buffer a region around one or more selected features, use BUFFER inside a SPATIALQUERY. In this example, the Colorado River is buffered. <LAYER type="featureclass" name="theRiverBuffer" id="RivBuf"> <DATASET fromlayer="Rivers" /> <SPATIALQUERY where="NAME='Colorado'"> <BUFFER distance="80" bufferunits="MILES" /> </SPATIALQUERY> <SIMPLERENDERER> <SIMPLEPOLYGONSYMBOL fillcolor="255,255,0" filltransparency=".3" boundarycolor="255,255,0" boundarywidth="2" /> </SIMPLERENDERER> </LAYER> | |
To select features from the same or another layer that fall within the buffer region, use TARGETLAYER as a child element. In this example, cities within 80 miles of the Colorado River are selected. (The buffer in the picture is shown for reference. With this request, only selected cities would display. To highlight the cities and show the buffer, both the following and preceding LAYER examples must be used in a request.) <LAYER type="featureclass" name="theRiverBuffer" id="RivBuf"> <DATASET fromlayer="Rivers" /> <SPATIALQUERY where="NAME='Colorado'"> <BUFFER distance="80" bufferunits="MILES" > <TARGETLAYER id="Cities" /> </BUFFER> </SPATIALQUERY> <SIMPLERENDERER> <SIMPLEMARKERSYMBOL color="255,255,0" width="6" /> </SIMPLERENDERER> </LAYER> | |
To use a buffer as a selection tool. BUFFER is used around a defined filter within SPATIALFILTER. In this example, BUFFER is used to buffer around an envelope. The inner yellow box is the original envelope. The outer yellow box is the buffer filter. Note that these boxes would not normally display; only the selected items within the filter. <LAYER type="featureclass" name="theEvelopeBuffer" id="EnvBuf" > <DATASET fromlayer="Cities" /> <SPATIALQUERY where="POPULATION > 1000000" > <SPATIALFILTER relation="envelope_intersection"> <ENVELOPE minx="-119" miny="32" maxx="-113" maxy="35" /> <BUFFER distance="100" bufferunits="MILES" /> </SPATIALFILTER> </SPATIALQUERY> <SIMPLERENDERER> <SIMPLEMARKERSYMBOL color="255,255,0" width="6" /> </SIMPLERENDERER> </LAYER> |
Attribute | Usage | Back to Top |
---|---|---|
bufferunits | Specifies units that apply to buffer. | |
distance | Buffer area width in buffer units. | |
project | Generated 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. |
Example 1: When in a GET_FEATURES request. | Back to Top |
<?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. | Back to Top |
<?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> |