Used in
CONFIG REQUEST Servers
Image Query Feature Extract ArcMap Parent elements
SPATIALQUERY Syntax
Description
A spatial filter defines the envelope for a spatial query. The envelope can be a rectangle, point, line, polygon, or buffer.
Restrictions
- One ENVELOPE, POLYLINE, POLYGON, or MULTIPOINT element is required. Only one of these elements can be used.
- Using MULTIPOINT as a filter against a point or line layer will yield no results. Instead, a small envelope should be generated around this point. The envelope can then be used as the filter. Similarly, POLYLINE used against a point will yield no results. If desired, an envelope can be generated around the line for use as a filter.
- When using relation="envelope_intersection" on ArcSDE layers, no features are returned when
The reason is that all points and some lines do not have an associated envelope and hence cannot be used to query features using "envelope_intersection". Use relation="area_intersection" instead.
Notes
- When "area_intersection" is used with relation, all features that partially or fully fall within the area of the filter are selected. This operation can take some time. To speed up processing, "envelope_intersection" can be used instead. This method checks to see if the bounding box of the filter overlaps any bounding boxes of the features in the layer. A much quicker search results, but the features found could fall outside the area of the filter. In the examples below, an oval shape is used as the filter. When "envelope_intersection" is used, features outside the filter can be selected even though they are far outside the filter.
Shape of spatial filter to select points | Points selected when relation="area_intersection" | Points selected when relation="envelope_intersection" |
Shape of spatial filter to select polygons | No polygons are selected when relation="area_intersection" | Polygon is selected when relation="envelope_intersection" |
In general, it is recommended to use "area_intersection" to be certain you are retrieving the correct features. The value "envelope_intersection" should only be used in customized environments where you plan to retrieve a subset of features on which to run a second query using "area_intersection".
Attribute Descriptions for SPATIALFILTER
Attribute | Usage |
---|
relation | Describes spatial relation. It is recommended to use "area_intersection". See Notes section for more details. |
Back to top Examples for SPATIALFILTER
Example 1: Note in this example that the DATASET fromlayer is "Countries". 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="-180" miny="-90" maxx="180" maxy="90" />
<IMAGESIZE width="643" height="502" />
</PROPERTIES>
<LAYER type="featureclass" name="select layer" visible="true" id="300">
<DATASET fromlayer="Countries" />
<SPATIALQUERY>
<SPATIALFILTER relation="area_intersection">
<ENVELOPE maxy="30" maxx="30" miny="0" minx="0" />
</SPATIALFILTER>
</SPATIALQUERY>
<SIMPLERENDERER>
<SIMPLEPOLYGONSYMBOL fillcolor="255,255,255" filltype="cross" />
</SIMPLERENDERER>
</LAYER>
</GET_IMAGE>
</REQUEST>
</ARCXML>
|
Back to top