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 is a cartographer who’s been at Esri since 2003. She finds and shares best practices for mapping and analysis with ArcGIS, which leads her to publish widely and present world-wide.

Connect:

Next Article

Your Living Atlas Questions Answered

Read this article