ArcIMS services, by design, have no limits on the number of features that can be selected or queried. Users can inadvertently or maliciously request unlimited numbers of features. Feature queries do not have scale dependencies. This means that all features for a layer can be requested even if the layer is not displayed on the map for a given scale. Some common ways a user can request many or all records for a layer are:
Fortunately, ArcIMS has several built in ways to set limits to the number of requested feaures when making GET_FEATURES requests.
A global feature limit can be set in the Spatial Server configuration files limiting the number of requested features from all layers in all services. By default, the feature limit is 2000 for queries made to Image and ArcMap Image Services. No upper limit is set for Feature Services. For ArcMap Image Services, this is the only place on the server to limit the number of requested features. Higher values can lead to slower performance. More importantly, when many large queries are executed they may block and prevent shorter queries from executing until completion of the excessively long queries. In addition, large responses can hang a client viewer.
If you do not wish to set a global limit on the number of features returned, or you want to refine the feature limit, it is possible to set limits on a layer by layer basis for Image and Feature Services. A feature limit cannot be set in the map document for ArcMap Image Services.
Setting a feature limit in a configuration file is implemented via the SPATIALQUERY element. Instructions for adding this element can be found in Adding SPATIALQUERY.
The third way in which the number of features can be limited is to set a feature limit when requesting data from a client. In many cases, you may want to limit the number of returned features to something manageable. For example, you many want to return only 10 records at a time and allow users to page for the next or previous 10 records. Instructions for specifying the number of features in a request is covered in more details in the ArcIMS customizing guides.
The hierarchy for all the feature limit settings are as follows:
The HTML Viewer has several safeguards in place to protect against bad queries or queries that return too many features. First, a layer must be turned on and must be visible for the given scale before any features can be queried. Second, although all features may be selected on a map, a request returns records for only 25 features at a time.
These constraints have been placed at the application level. Other applications or users who understand how to send requests to an ArcIMS Servlet Connector can bypass these HTML Viewer safeguards. Therefore, although you may not run into too many problems with requests from an HTML Viewer, you need to protect your site from these other users and applications.
A good example of another client that uses the same Servlet Connector as the HTML Viewer is ArcMap. Unlike the HTML Viewer, ArcMap does not limit the number of returned features. In addition, the layer does not need to be visible or within scale range for features to be selected.
You can limit the number of features drawn on a map when using an Image Service: This is done by setting a parameter in the Image Server configuration file. When you set this parameter, the value affects all layers in all Image Services. Therefore, the value should be larger than the maximum number of features you would expect to be drawn in your largest layer. In other words, if a layer draws 1,000 features, and this is appropriate, you would want to set the feature limit greater than 1,000.
Setting this parameter should only be necessary if for some reason you have many features in a layer and cannot set scale dependencies for some reason. Ideally, each layer in a map configuration file should be displayed only at the appropriate scale. However, to prevent users from requesting large amounts of data from dynamic layers, setting a limit may be appropriate depending on the size of your data sets.
Choosing the appropriate feature limit depends on the service type, performance considerations, and data sensitivity among other factors.
Image and Feature Services have more flexibility for setting feature limits. In addition to setting a global feature limit, you can set feature limits on each layer in a map configuration file. Thus, you can set the global feature limit to a fairly large number. You can set the feature limit on each layer depending on the expected use of the layer.
Windows: <ArcGIS Installation Directory>\ ArcIMS\Server\etc
UNIX and Linux: $AIMSHOME/etc
|<PARAMETER name="featurelimit" value="2000" />|
Windows: <ArcGIS Installation Directory>\ArcIMS\Server\etc
UNIX and Linux: $AIMSHOME/etc
|< name="imagefeaturelimit" value="-1" />|