Contour with barriers tool

By Charlie Frye, Esri Chief Cartographer

Not all of the new functionality for mapping and cartography was shown in the mapping section of the What’s New in 9.3 PDF that’s available on the new Resource Center. New with both the 3D and Spatial Analyst Extensions in ArcGIS 9.3 is the Contour with Barriers tool, which generates contours from a raster surface and allows you to limit the creation of the contours to either side of a barrier. This tool has several improvements over the the existing contour tool:

  • Smaller output — in my tests, the output from the Contour with Barriers tool was about half the size of what the existing contour tool produced. That means faster drawing and labeling.
  • Option for specifying index contour interval — with this option adds a field called Type and calculates values of 1 for intermediate contours and 2 for index contours. To run the tool you would specify, for example, a contour interval of 20 feet and an index contour interval of 100 feet. The old way of doing this was to add a new field and calculate it yourself using the VBScript Mod() function.
  • A new parameter for a barriers feature class — this actually applies to a lot more than cartography, but for mapping, imagine being able to use as a barrier a line feature class representing shorelines, the edge of a glacier, or the toe of a landslide. The result be contours broken at these barriers, allowing you to decide how or whether to display those contours.

Another important use of the barriers feature class is to clip contours at the study area edges when you need to create contours over a large region. With the existing contour tool, a single contour line can noodle across very large portion of the output dataset’s extent without being broken. For a large region, there can be many of these contours and they can be extremely long, especially if the area has a lot of relief and the contours are very convoluted. This effectively defeats the dataset’s spatial index, making drawing, selection, labeling, geoprocessing, etc., very slow. Using something like U.S. Public Land Survey System lines or quad sheet boundaries (installed with ArcGIS at c:program filesArcGISreference systemsusgs24q.shp) as barriers, the resulting dataset will perform much better.

There are a couple of drawbacks to the contour with barriers tool:

  • It runs in about twice the time it takes the existing contour tool to run, but that is more than mitigated by the time saved in not having to do additional geoprocessing to accomplish tasks required for cartography anyway (that is, clipping contours at barriers and attributing index contours).
  • As noted in the help, this tool does not deal with large elevation raster datasets as input and small contour intervals in the output. The next to last section of the usage tips in the online help gives you strategies to work around this limitation until it is fixed. That said, I was able to produce 50 foot interval contours from USGS 30 meter NED DEM data for the State of Washington using 1:250,000 scale quadrangle sheet boundaries in only 8 hours, thought I had to write a script to do the tiling.

At this point, I can say that the Contour with Barriers tool is usually going to be a better option from the perspective of taking the time up front to run the tool and saving time later in geoprocessing and performance.

This entry was posted in Mapping and tagged . Bookmark the permalink.

Leave a Reply


  1. dslamb says:

    I could be mistaken…

    But, the example in the photo show the contours intersecting the body of water. Water, in my experience, is generally treated as a single elevation at the water surface, so these contours should be going around the body of water rather than through it…

    Please correct me if I’m wrong.

  2. cfrye says:

    Good catch.

    The hydro data here was captured at from 2ft imagery and is considerably more detailed than the DEM (10m) that produced the contour lines.  That makes for a bad mismatch–you’re correct, I shouldn’t have done that.  

    I’ll leave it as a lesson for others to learn from; I was a little too pleased the the tool ran and produced the expected output based on the inputs, rather than getting my expectations in order, from the point of view of making a good map, in the first place.

    The reason I brought up hydro shorelines in the blog was not for the precise case of the pond in the image–but more for river polygons, which typically flow downhill. In those cases you should the interval between contours and the river’s edge taper, usually gently (exception being a waterfall) and end at the water’s edge. 

  3. siva544 says:

    How to generate contours for a selected region in a map containing data points?

  4. cfrye says:

    Zoom to the extent of your data points. Then when you are using the tool, you will need to set your geoprocessing environment settings to process the current extent or the extent of the data points dataset.

    Another way to interpret your question is that if you only have points, then you will need to first use the Spatial Analyst Extwnsioms tools for interpolating a raster surface.

    Given the potential complexity of what you may be wanting to do, please contact technical support to get help if neither of these ideas was helpful.

  5. jeff_krecic says:

    This tool simply does not work as advertised. I have tried to get this tool to create contours around a pond. What is does is cut the contours at the barrier. It does not set the elevation of the pond to the elevation of the barrier. The map example above is a joke.
    Do not use this tool to create contours around a pond or lake as the example above shows.