ArcMap

Setting a Definition Query in ModelBuilder

Question: I’m currently finishing up a model which performs many different operations on a single raster. Ultimately it will convert the raster to a polygon where I may use it in my maps. In my last step of the model, I am trying to “Clip (analysis)” my polygon (produced by the Raster to Polygon tool) based on a coverage layer. This coverage layer however has a field in it which defines accessible areas.

Areas that are accessible have a “Y” in the field, those that don’t, are empty. In the past, if I only wanted to work with areas that had access, I was able to set the coverage’s Definition Query to = “Y”. Since I’m so used to working in this manner I thought I’d be able to achieve the same thing in ModelBuilder but this appears not to be the case.

As I didn’t even know if this was workable I thought I’d “Ask a Cartographer”. Is this even workable aim for ModelBuilder? Am I trying to go about it the wrong way?

Answer: You can use the Make Feature Layer tool available in the Layers and Table Views toolset of the Data Management Toolbox. With this, you can achieve the same result as with a definition query. The tool allows you to use an expression to create a subset of the data. Note that the layer created by tool is temporary and will not persist after your ArcMap session ends unless you save the document.

Formerly a Mapping Center Ask a Cartographer  Q & A.

About the author

Dr. Aileen Buckley has been making maps since she was an undergraduate student. She has a Bachelors in Geography and Spanish from Valparaiso University, a Masters in Geography from Indiana University, and a Ph.D. in Geography from Oregon State University. She is a senior product engineer on the Living Atlas team, and her work focuses on determining and sharing best practices for mapping and analysis with modern GIS. She publishes and presents world-wide on many aspects of mapping and GIS. She is a co-author of Map Use: Reading, Analysis, Interpretation, and she is a co-editor for the Atlas of Oregon. Aileen is a former president of CaGIS (the U.S. cartographic association) and is actively involved with the International Cartographic Association in which she is the lead delegate for the United States.

Connect:

Next Article

Send email from pop-ups

Read this article