Map Service QueryFeatureCount method

Queries and returns the number of the features that meet the query filter selection criteria for the specified layer id.

 

QueryFeatureCount(string MapName, int LayerID, QueryFilter QueryFilter)

 

Parameter

Description

MapName

The name of the map (data frame) that contains the layer associated with the LayerID parameter.

LayerID

The layer id of the layer to query.

QueryFilter

An attribute or spatial query that defines the selection criteria for the layer associated with the LayerID parameter.

 

Return Value

 

An integer value indicating the number of features that meet the selection criteria. A SOAP exception will be thrown when the SQL expression in the query filter is invalid.

 

Remarks

 

The value returned is not restricted by limitations on the maximum number of results returned by a map service.

 

The methods QueryFeatureData, QueryHyperlinks, Find and Identify are restricted in the maximum number of results they can return. Currently, no method is available to return the maximum result count. To confirm that your application code has not encountered the limit, use this method to return the total result count and compare it to the number of results from the restricted methods. If the result from this method is greater, you have surpassed the result limit. See the QueryFeatureIDs method discussion for information on working with result sets that exceed the map service limit.

 

To determine which SQL query parameters can be used with a layer, use the GetSQLSyntaxInfo method.

 

The query filter will override any layer definition queries defined in the map service or defined via the LayerDescription.DefintionExpression property. To apply both query filters, the layer definition query expression and the new query filter will need to be combined for use with this method.

 

 

Examples

C#

VB.NET

Java