FeatureTable
.
Perform statistical analyses such as average, count, maximum, and standard deviation on a feature table by
defining a StatisticType
on a StatisticDefinition
. Use a combination of attribute, spatial,
and temporal criteria to filter the features to be analyzed. If no filters are defined, all features in the
table are included in the statistical query. You can also control how to group the results.
- Since:
- 100.2.0
- See Also:
-
Constructor Summary
ConstructorDescriptionStatisticsQueryParameters
(Iterable<StatisticDefinition> statisticDefinitions) Creates statistics query parameters using one or moreStatisticDefinition
. -
Method Summary
Modifier and TypeMethodDescriptionGets the geometry used to filter the results.Gets a list of fields by which statistical query results will be grouped.Gets a list of fields by which statistical query results will be ordered.Gets the spatial relationship that (along with thegetGeometry()
) defines features to be included in the query.Gets the definition of statistics (input field, output name, statistic type) to include in the statistical query of a table.Gets the time extent that defines features to be included in the statistics query.Gets the attribute expression that defines features to be included in the statistics query.void
setGeometry
(Geometry geometry) Sets the geometry used to filter the results.void
setSpatialRelationship
(QueryParameters.SpatialRelationship spatialRelationship) Sets the spatial relationship that (along with thesetGeometry(Geometry)
) defines features to be included in the query.void
setTimeExtent
(TimeExtent timeExtent) Sets the time extent that defines features to be included in the statistics query.void
setWhereClause
(String whereClause) Sets the attribute expression that defines features to be included in the statistics query.
-
Constructor Details
-
StatisticsQueryParameters
Creates statistics query parameters using one or moreStatisticDefinition
.- Parameters:
statisticDefinitions
- aIterable
containingStatisticDefinition
instances- Throws:
IllegalArgumentException
- if statisticDefinitions is null, or empty- Since:
- 100.2.0
-
-
Method Details
-
getGeometry
Gets the geometry used to filter the results.The geometry that (along with the
getSpatialRelationship()
) defines features to be included in the statistical query.- Returns:
- the geometry used to filter the results, or null if none
- Since:
- 100.2.0
-
setGeometry
Sets the geometry used to filter the results.The geometry that (along with the
getSpatialRelationship()
) defines features to be included in the statistical query.- Parameters:
geometry
- the geometry used to filter the results- Throws:
IllegalArgumentException
- if geometry is null- Since:
- 100.2.0
-
getSpatialRelationship
Gets the spatial relationship that (along with thegetGeometry()
) defines features to be included in the query.The default spatial relationship is
QueryParameters.SpatialRelationship.INTERSECTS
.- Returns:
- the spatial relationship that (along with the
StatisticsQueryParameters.getGeometry()
) defines features to be included in the query. - Since:
- 100.2.0
-
setSpatialRelationship
Sets the spatial relationship that (along with thesetGeometry(Geometry)
) defines features to be included in the query.The default spatial relationship is
QueryParameters.SpatialRelationship.INTERSECTS
.- Parameters:
spatialRelationship
- the spatial relationship that (along with theStatisticsQueryParameters.setGeometry()
) defines features to be included in the query.- Throws:
IllegalArgumentException
- if spatialRelationship is null- Since:
- 100.2.0
-
getWhereClause
Gets the attribute expression that defines features to be included in the statistics query.The where clause should follow standard SQL syntax similar to that discussed in the document SQL reference for query expressions used in ArcGIS.
If the where clause includes dates, they must be correctly formatted based on the geodatabase datasource used in the service. Refer to Dates and time for date formats expected by different data sources.
ArcGISFeatureTable
objects expect that anyField.Type.GLOBALID
orField.Type.GUID
parameters in the where clause are formatted as: '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'. All characters are uppercase, wrapped in curly braces and surrounded by single quotes.- Returns:
- a string of the attribute expression that defines features to be included in the statistics query.
- Since:
- 100.2.0
-
setWhereClause
Sets the attribute expression that defines features to be included in the statistics query.The where clause should follow standard SQL syntax similar to that discussed in the document SQL reference for query expressions used in ArcGIS.
If the where clause includes dates, they must be correctly formatted based on the geodatabase datasource used in the service. Refer to Dates and time for date formats expected by different data sources.
ArcGISFeatureTable
objects expect that anyField.Type.GLOBALID
orField.Type.GUID
parameters in the where clause are formatted as: '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}'. All characters are uppercase, wrapped in curly braces and surrounded by single quotes.- Parameters:
whereClause
- the where clause string for filtering features- Throws:
IllegalArgumentException
- if whereClause is null- Since:
- 100.2.0
-
getGroupByFieldNames
Gets a list of fields by which statistical query results will be grouped.By default the list is empty. Adds valid field names to group the statistical query result. It will affect the result of
StatisticRecord.getGroup()
.- Returns:
- a mutable list of fields by which statistical query results will be grouped
- Since:
- 100.2.0
-
getOrderByFields
Gets a list of fields by which statistical query results will be ordered.Results can be sorted by one or more fields. Each
QueryParameters.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.- Returns:
- a mutable list of fields for sort orders
- Since:
- 100.2.0
-
getStatisticDefinitions
Gets the definition of statistics (input field, output name, statistic type) to include in the statistical query of a table.By default, the list is the same as the definition list constructing the object. Adds or removes a statistic definition to the list to decide the final statistical query result. The list cannot be empty.
- Returns:
- the definition of statistics (input field, output name, statistic type) to include in the statistical query of a table
- Since:
- 100.2.0
-
setTimeExtent
Sets the time extent that defines features to be included in the statistics query. The time extent can be null to indicate an infinite extent.- Parameters:
timeExtent
- the time extent- Since:
- 100.3.0
-
getTimeExtent
Gets the time extent that defines features to be included in the statistics query.- Returns:
- the time extent, or null if no time extent is set
- Since:
- 100.3.0
-