QueryParameters

Parameters to perform a query on a dataset. These parameters provide attribute, spatial, and temporal criteria that you can use to filter features. You can define attribute criteria using a standard SQL expression based on the available attribute fields, spatial criteria using a geometry and a spatial relationship (such as within, contains, intersect), or temporal filters using a single date/time, or a range. You can also control how the results are sorted and whether to return geometry.

In addition to querying features in a table, you can also use these parameters to count specific features, calculate the extent of features, select features in layers, and populate service-based tables. If the query method produces a set of features, they are returned in a FeatureQueryResult.

Different query parameter objects are available to query data sources such as related features (RelatedQueryParameters), statistical information (StatisticsQueryParameters), and portals (PortalQueryParameters). Specialized query parameters also exist for working with utility networks and routing.

Since

200.1.0

See also

(QueryParameters)

FeatureLayer.selectFeatures

(QueryParameters, SelectionMode)

(QueryParameters, Boolean, MutableListImpl)

Constructors

Link copied to clipboard
constructor()

Creates a new query parameters object.

Properties

Link copied to clipboard

The geometry used to filter the results. The geometry that (along with the QueryParameters.spatialRelationship) defines features to be included in the query.

Link copied to clipboard

The maximum allowable offset.

Link copied to clipboard

The maximum number of features the query should return. For consistent ordering of results when using pagination, provide a value for QueryParameters.orderByFields. Note that if you provide a maximum features value to support paging of results, you must also set a QueryParameters.resultOffset value. Otherwise, the result may contain local features in place of server features if they satisfy the query. To ensure strict paging of server features, specify both maximum features and QueryParameters.resultOffset.

Link copied to clipboard

The object ids of the features to query for.

Link copied to clipboard

The fields by which query results will be ordered. Results can be sorted by one or more fields. Each OrderBy instance includes a field name and whether to sort by that field in ascending or descending order. If a service-based table is being queried it must support advanced queries.

Link copied to clipboard

The spatial reference of the feature results' geometry. If not specified, geometries are returned in the spatial reference of the service.

Link copied to clipboard

The starting offset of results to fetch. This is useful for paging through results. For consistent ordering of results when using pagination, you should also provide a value for the QueryParameters.orderByFields. Note that if you provide a result offset to support paging of results, you must also set a QueryParameters.maxFeatures value. Otherwise, the result offset is ignored.

Link copied to clipboard

True if geometry values are returned in the results, otherwise false. This is needed when you want to display the features on a map or a scene. When querying non-spatial data, results do not include geometry.

Link copied to clipboard

The spatial relationship that (along with the QueryParameters.geometry) defines features to be included in the query. The default spatial relationship is SpatialRelationship.Intersects.

Link copied to clipboard

A span of time used to query features in a time-aware feature layer. You can apply a temporal filter on any FeatureLayer that supports time filtering (FeatureLayer.supportsTimeFiltering). Set the TimeExtent.startTime and TimeExtent.endTime to query features across a span of time. A single point in time can be queried by setting them to the same time value.

Link copied to clipboard

The attribute expression that defines features to be included in the query. The where clause should follow standard SQL syntax similar to that discussed in the document https://pro.arcgis.com/en/pro-app/latest/help/mapping/navigation/sql-reference-for-elements-used-in-query-expressions.htm#GUID-940733A1-D6D1-4200-B290-24CA2E1056D4