| Package | com.esri.ags.tasks.supportClasses |
| Class | public class Query |
| Inheritance | Query flash.events.EventDispatcher |
The text property will search the display field of your layer, it is a short hand for a where clause of:
where YourDisplayField like '%SearchText%'.
See also
| Property | Defined By | ||
|---|---|---|---|
| geometry : Geometry [read-only]
The geometry to apply to the spatial filter. | Query | ||
| maxAllowableOffset : Number [read-only]
The maximum allowable offset used for generalizing geometries returned by the Query operation. | Query | ||
| objectIds : Array [read-only]
The object IDs of this layer/table to be queried. | Query | ||
| outFields : Array [read-only]
Attribute fields to include in the FeatureSet. | Query | ||
| outSpatialReference : SpatialReference [read-only]
The well-known ID of the spatial reference for the returned geometry. | Query | ||
| relationParam : String [read-only]
The spatial relate function that can be applied while performing the query operation. | Query | ||
| returnGeometry : Boolean [read-only]
If true, each feature in the FeatureSet includes the geometry. | Query | ||
| spatialRelationship : String [read-only]
The spatial relationship to be applied on the input geometry while performing the query. | Query | ||
| text : String [read-only]
Shorthand for a literal search text on the display field, equivalent to:
where YourDisplayField like '%SearchText%'. | Query | ||
| timeExtent : TimeExtent [read-only]
The time instant or the time extent to query. | Query | ||
| where : String [read-only]
A where clause for the query. | Query | ||
| Constant | Defined By | ||
|---|---|---|---|
| SPATIAL_REL_CONTAINS : String = esriSpatialRelContains [static]
Part or all of a feature from feature class 1 is contained within a feature from feature class 2. | Query | ||
| SPATIAL_REL_CROSSES : String = esriSpatialRelCrosses [static]
Two polylines cross if they share only points in common, at least one of which is not an endpoint. | Query | ||
| SPATIAL_REL_ENVELOPEINTERSECTS : String = esriSpatialRelEnvelopeIntersects [static]
The envelope of feature class 1 intersects with the envelope of feature class 2. | Query | ||
| SPATIAL_REL_INDEXINTERSECTS : String = esriSpatialRelIndexIntersects [static]
The envelope of the query feature class intersects the index entry for the target feature class. | Query | ||
| SPATIAL_REL_INTERSECTS : String = esriSpatialRelIntersects [static]
Part of a feature from feature class 1 is contained in a feature from feature class 2. | Query | ||
| SPATIAL_REL_OVERLAPS : String = esriSpatialRelOverlaps [static]
Features from feature class 1 overlap features in feature class 2. | Query | ||
| SPATIAL_REL_RELATION : String = esriSpatialRelRelation [static]
Allows specification of a spatial relate function. | Query | ||
| SPATIAL_REL_TOUCHES : String = esriSpatialRelTouches [static]
The feature from feature class 1 touches the border of a feature from feature class 2. | Query | ||
| SPATIAL_REL_WITHIN : String = esriSpatialRelWithin [static]
The feature from feature class 1 is completely enclosed by the feature from feature class 2. | Query | ||
| geometry | property |
geometry:Geometry [read-only] The geometry to apply to the spatial filter. The spatial relationship as specified by spatialRelationship is applied to this geometry while performing the query. The valid geometry types are Extent, MapPoint, Multipoint, Polyline, or Polygon.
This property can be used as the source for data binding.
public function get geometry():GeometrySee also
| maxAllowableOffset | property |
maxAllowableOffset:Number [read-only] | Since : | ArcGIS API for Flex 2.0 |
The maximum allowable offset used for generalizing geometries returned by the Query operation. The units are the same as the returned features. Requires ArcGIS Server 10.0 or above.
This property can be used as the source for data binding.
public function get maxAllowableOffset():Number| objectIds | property |
objectIds:Array [read-only] | Since : | ArcGIS API for Flex 2.0 |
The object IDs of this layer/table to be queried. Requires ArcGIS Server 10.0 or above.
This property can be used as the source for data binding.
public function get objectIds():Array| outFields | property |
outFields:Array [read-only] | Since : | Note that with ArcGIS Server 10.0 the wildcard no longer implicitly implies returnGeometry=true. |
Attribute fields to include in the FeatureSet. Fields must exist in the layer or table. You must list the actual field names rather than the alias names. Returned fields are also the actual field names. However, you are able to use the alias names when you display the results.
For optimal performance, limit the output fields to only those you expect to use.
Each query must have access to the Shape and Objectid fields for a layer, but your list of fields does not need to include these two fields.
To return all fields, specify the wildcard "*" as the value of this parameter. In this case, the query results include all the fields.
This property can be used as the source for data binding.
public function get outFields():Array
myQuery.outFields = ["CITY_NAME","AGE_UNDER5","AGE_5_17","AGE_18_64","AGE_65_UP"];
myQuery.outFields = ["*"];| outSpatialReference | property |
outSpatialReference:SpatialReference [read-only] The well-known ID of the spatial reference for the returned geometry. If not specified, the geometry is returned in the spatial reference of the map.
This property can be used as the source for data binding.
public function get outSpatialReference():SpatialReference
<esri:Query id="query" outSpatialReference="{myMap.spatialReference}" text="{qText.text}" returnGeometry="true">| relationParam | property |
relationParam:String [read-only] The spatial relate function that can be applied while performing the query operation. An example for this spatial relate function is "FFFTTT***". This is used if spatialRelationship is SPATIAL_REL_RELATION ("esriSpatialRelRelation"). For more information on this spatial relate function please refer to the documentation for the spatial relate function.
This property can be used as the source for data binding.
public function get relationParam():String| returnGeometry | property |
returnGeometry:Boolean [read-only]
If true, each feature in the FeatureSet includes the geometry.
Since the geometry makes up a significant portion of the response, only use when you plan to use the geometry of the feature, for example, to include them on a map.
The default value is false.
This property can be used as the source for data binding.
public function get returnGeometry():Boolean| spatialRelationship | property |
spatialRelationship:String [read-only] The spatial relationship to be applied on the input geometry while performing the query. See constants below for possible input values.
The default value is SPATIAL_REL_INTERSECTS.
This property can be used as the source for data binding.
public function get spatialRelationship():StringSee also
| text | property |
text:String [read-only]
Shorthand for a literal search text on the display field, equivalent to:
where YourDisplayField like '%SearchText%'.
The search text is case sensitive.
This parameter is ignored if the where parameter is specified.
You can determine what the display field is for a layer using the ArcGIS Services Directory.
This property can be used as the source for data binding.
public function get text():String| timeExtent | property |
timeExtent:TimeExtent [read-only] | Since : | ArcGIS API for Flex 2.0 |
The time instant or the time extent to query. Set the TimeExtent's startTime and endTime to the same time to define a time instant. Requires ArcGIS Server 10.0 or above.
This property can be used as the source for data binding.
public function get timeExtent():TimeExtent| where | property |
where:String [read-only] A where clause for the query. Any valid SQL where clause operating on the fields in the layer is allowed, for example:
Strings must always be enclosed in single quotes in queries. For example:
query.where = "STATE_NAME = 'California'".
Strings are case sensitive in expressions. For feature classes and tables, you can use the UPPER or LOWER function to set the case for a selection. For example:
query.where = "UPPER(STATE_NAME) = 'RHODE ISLAND'".
The wildcards you use to conduct a partial string search also depend on the data source you are querying.
For example, in a file-based or ArcSDE geodatabase data source, this expression would select
Mississippi and Missouri among USA state names:
query.where = "STATE_NAME LIKE 'Miss%'".
The percent symbol (%) means that anything is acceptable in its place - one character, a hundred characters,
or no character.
The wildcards you use to query personal geodatabases are asterisk ( for any number of characters
and question mark (?) for one character.
The decimal point (.) is always used as the decimal delimiter, regardless of your locale or regional settings.
The comma cannot be used as a decimal or thousands delimiter in an expression.
You can query numbers using the equal (=), not equal (<>), greater than (>), less than (<), greater than or equal to (>=), less than or equal to (<=), and BETWEEN operators. For example:
query.where = "POP2000 > 350000".
Other examples:
query.where = "OBJECTID BETWEEN 1 AND 10".
query.where = "STATE IN ('CA','OR')".
query.where = "NOT (STATE IN ('KY','WV'))".
query.where = "POCTEL1 IS Null".
What constitutes "valid" SQL depends on the backend database for a specific REST endpoint. The backend can be a Personal Geodatabase, File Geodatabase, Shapefile, or SDE Geodatabase (of different databases). Depending on the type and database, the SQL might be slightly different, especially for dates.
Refer to the documentation of your DBMS for a list of supported functions.
This property can be used as the source for data binding.
public function get where():StringSee also
| SPATIAL_REL_CONTAINS | Constant |
public static const SPATIAL_REL_CONTAINS:String = esriSpatialRelContainsPart or all of a feature from feature class 1 is contained within a feature from feature class 2.
| SPATIAL_REL_CROSSES | Constant |
public static const SPATIAL_REL_CROSSES:String = esriSpatialRelCrossesTwo polylines cross if they share only points in common, at least one of which is not an endpoint. A polyline and an polygon cross if they share a polyline in common on the interior of the polygon which is not equivalent to the entire polyline. Cross is a Clementini operator.
| SPATIAL_REL_ENVELOPEINTERSECTS | Constant |
public static const SPATIAL_REL_ENVELOPEINTERSECTS:String = esriSpatialRelEnvelopeIntersectsThe envelope of feature class 1 intersects with the envelope of feature class 2.
| SPATIAL_REL_INDEXINTERSECTS | Constant |
public static const SPATIAL_REL_INDEXINTERSECTS:String = esriSpatialRelIndexIntersectsThe envelope of the query feature class intersects the index entry for the target feature class.
| SPATIAL_REL_INTERSECTS | Constant |
public static const SPATIAL_REL_INTERSECTS:String = esriSpatialRelIntersectsPart of a feature from feature class 1 is contained in a feature from feature class 2.
| SPATIAL_REL_OVERLAPS | Constant |
public static const SPATIAL_REL_OVERLAPS:String = esriSpatialRelOverlapsFeatures from feature class 1 overlap features in feature class 2.
| SPATIAL_REL_RELATION | Constant |
public static const SPATIAL_REL_RELATION:String = esriSpatialRelRelationAllows specification of a spatial relate function.
| SPATIAL_REL_TOUCHES | Constant |
public static const SPATIAL_REL_TOUCHES:String = esriSpatialRelTouchesThe feature from feature class 1 touches the border of a feature from feature class 2.
| SPATIAL_REL_WITHIN | Constant |
public static const SPATIAL_REL_WITHIN:String = esriSpatialRelWithinThe feature from feature class 1 is completely enclosed by the feature from feature class 2.
var query:Query = new Query(); query.where = "STATE_NAME = 'Alaska' AND TYPE = 'city'"; query.returnGeometry = true; query.outFields = ["CITY_NAME","AGE_UNDER5","AGE_5_17","AGE_18_64","AGE_65_UP"];