Scale is one of the most important factors to consider when representing data on a map. As mentioned in the ‘Creating a Multi-scale Geological Map’ blog it is important not to confuse the message of your map by including too much data.
There are several ways of controlling scalable visibility, including:
- Using separate datasets of appropriate resolutions
- Using the layer properties in ArcMap to control visibility for each layer (or group layer)
However, these methods have limitations, e.g. the layer properties method requires that all the data is either on or off. This may not be appropriate for the type of data being viewed.
A more flexible approach to controlling visibility of data is to use definition queries.
What is a definition query?
Definition queries are where clause expressions built in Structured Query Language (SQL). They select a subset of features from a feature layer in order to limit the number and type of features displayed.
Here’s a simple example: I have a map containing a layer pointing to a feature class representing petroleum surface infrastructure. The attribute table contains infrastructure types allowing the user to select infrastructure by type.
I only want to see those types labelled as ‘FPSO’
The definition query tab in the layer properties provides an interface to construct expressions to filter data:
- Pane listing attributes for the feature class
- Key pad are containing controls to help create the expression
- Pane listing the unique values found in the field selected in 1
So in this example I am filtering the layer to only show features where: TYPE = ‘FPSO’
For more information on definition queries and displaying subsets of data take a look at the Esri ArcGIS help page.
Lots of data slows my map document!
Another great use-case for definition queries is to control the performance of a map document.
Contour data consists of many linear features that can take a while to render.
An example
The International Bathymetric Chart of the Arctic Ocean (IBCAO) is a raster dataset of the Arctic Ocean area. This dataset has a relatively coarse resolution (500m resolution) so is good for a general representation of the area’s regional bathymetry.
Using the contour tool in the Spatial Analyst toolbox I created a contour dataset derived from this raster dataset at a 10m interval.
For more information on definition queries and displaying subsets of data take a look at the Esri ArcGIS help page.
Full extent of the whole IBCAO data (symbology classified to only show bathymetric data) extent underlain with ESRI’s Imagery Basemap. Displayed in Lambert Azimuthal Equal Area Projection and the WGS84 datum.
The interval used for the contour operation produces too much detail when viewed at regional scales, such as that shown in figure below. This high resolution can be seen where the continental shelf drops down towards the south west and a block of line data makes it impossible to see any detail. It also takes an age to render!
Using a definition query it is possible to show every nth feature. This provides the flexibility to show the density of features I feel is suitable for visualising the data at my chosen map scale.
If needed this definition query can be used on several copies of a layer (pointing to the same contour data) but with a different definition query applied, each of which is visible at a particular scale range.
The definition query
The modulo operation (described as “Mod” in VB) finds the remainder when dividing one number by another, and can be used to display every Nth feature.
Mod(ATTRIBUTEVALUE, N)=0
For example:
Mod(Contour, 50)=0
This will display every feature where the Contour value divided by 50 produces no remainder. So if a contour interval of 1m is present in the source data then every 50th feature will be displayed, or a contour interval of 50m.
View of dataset with every 5th line being displayed through use of the definition query
Using definition queries in this way can really speed up the display of this kind of data, and so can prove very useful in your ArcGIS work.
Watch this blog as a video: Using Definition Queries to Improve ArcMap Performance
By Simon Kettle, GIS Consultant, Exprodat.