Web feature layer query patterns

Data is queried in web feature layers with either page-based querying or tile-based querying.

Page-based querying

In ArcGIS Pro, most querying used during drawing and editing is accomplished by using a page-based query known as pagination. This technique requests subsets of data, known as pages, rather than requesting all data within one single query. By using these pages, smaller requests can be sent and returned in a reasonable amount of time which improves application responsiveness and user experience.

The size of pages depends on the maxRecordCount property associated with the feature service. This is based on the Maximum records returned by server parameter when publishing a feature service. This value is then used with the resultRecordCount parameter during query requests.

For more information, see Service parameters.

As pages are filled, the query responses include the exceededTransferLimit property. If the exceededTransferLimit property is true in the response, it indicates that more records are available and additional pages will be requested. These requests continue until exceededTransferLimit is false or if this property is absent in the query response.

The pages use the resultOffset value to determine the starting record for each page. As additional pages are requested, the resultOffset value is increased and used to indicate the number of skipped records and the next record that should start the page (resultOffset + 1). For example, if the page size is set to 2000, the second page request will have a resultOffset value of 2000 and the page will include the next available 2000 records to fill the page.

For more information, see Query (Map Service/Layer).

Note:

When not using the resultOffset and resultRecordCount parameters, the exceededTransferLimit property may also be included in the query results. In this case, the property will be true only if the number of records exceeds the maxRecordCount value configured by the server administrator.

Tile-based querying

Tile-based querying divides a map extent into tiles used to display features within the map. This also includes the caching of tiles on the server so they can be returned rather than the server having to recompute the map display. To use tile-based queries, a service layer must have the supportsQueryWithCacheHint property equal to true. This allows a request using the cacheHint parameter, which indicates whether the service should cache query results.

The querying occurs through a tiling scheme that generates multiple levels of detail that are associated with various map scales. The initial level of detail used is based on the map scale when data is loaded. The tiles at this initial level of detail will be used unless there are too many features within a tile. If there are too many features within a tile, that tile drops down to the next level and makes a request. If needed, this dropping down of levels will occur a total of three times from the initial level of detail. As responses are returned, the tiles are cached. Although tile-based querying generates more queries to the server, the requests are lightweight and use the cached tiles to still provide optimized performance.

Note:

If the grid tile has too many features to return in one request, a notification to zoom in to a smaller area will appear.

Setting a visible scale range on layers can minimize the occurrence of these notifications.

For more information, see Layer (Feature Service).