Using MOD to filter data

(How to just show every-other elevation contour, etc.)

 

Back to the   GIS Tutorials & Help Page...                         Back to the   SAL Home Page...

 

 

Often a GIS data set may contain too much data (too many features). In many cases, a simple Defination Query can be used to 'filter' the data (e.g., "State_Name" = 'Iowa', to show only census blocks in the state of Iowa). In other cases, a numerical filter is desired, such as when wishing to show only certain elevation contour lines. In these cases, the MOD operator can be used.

 

~ ~ ~ ~ ~

 

Given a contour file with contours every 10 m, here's how to show only every other contour (or every 5th contour, etc.).

  • In ArcMap, add the 10m contour lines to the .mxd
  • Open the Layer Properties and select the Definiation Query tab
    • Click on the Query Builder button
    • In the Query Builder, create the following query
    • MOD ("CONTOUR", 20) = 0 (this is assuming the field name for your contour elevations is "CONTOUR")
    • Optionally click Verify to test the query
    • Click OK to close the Query Builder dialog box
    • Click OK to apply the query and close the Layer Properties
  • This should limit the data to only those features where the MOD of the contour elevations and 20 = 0 (that is, where the contour elevation divided by 20 is 0)
  • Open the attribute table to check to see that only elevations divisible by 20 are still included (e.g., 20, 40, 60, 80...)

A similar process can be used to show only contours 50, 100, 150, etc,: MOD("CONTOUR", 50) = 0

OR to show only contours 100, 200, 300...: MOD("CONTOUR", 100) = 0

 

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

 

 

 

 

Back to the   GIS Tutorials & Help Page...                         Back to the   SAL Home Page...