Select to view content in your preferred language

Ability to add a definition query to data while adding to a map

379
7
05-07-2025 09:07 AM
Status: Needs Clarification
Labels (1)
jamesw
by
Occasional Contributor

I often have to pause drawing of the map while adding large datasets so that I can apply a definition query to avoid crashing the application or encountering significant loading times.

I would like to be able to add a definition query to a layer/table while adding it to the map using some kind of geoprocessing tool interface.

7 Comments
AlfredBaldenweck

Yes! I'd love to be able to just add the data that I care about.

SSWoodward
Status changed to: Needs Clarification

Thanks for this Idea @jamesw, does the Make Feature Layer GP tool meet the need here? Make Feature Layer allows you to create a new layer in your map and apply a definition query before the layer is added.

jamesw
by

Hi @SSWoodward - the Make Feature Layer GP tool is basically the workflow that I have in mind, but instead of creating a new feature layer, adding an existing layer with a definition query. For example, when I'm working with a regional dataset, I'll add it and filter to my specific location using a definition query, but I don't actually need (or want) a distinct new feature class that then I'd need to manage. This conceptual workflow keeps projects current when centralized datasets are updated.

I hope that's clear - I'm happy to explain more if needed. I appreciate the suggestion about that tool!

SSWoodward

The Make Feature Layer GP tool takes in a feature class, the data in the data source, and returns a feature layer, the objects that you see in the contents pane of a map.  The tool will not make a distinct new feature class.  The source data remains untouched with no need to merge or manage classes, it creates the memory representation of the feature class, the feature layer, in your map with the definition query applied.   No new data is created.

JohnGuilfoyle
I do this frequently since I work with many different counties.
I import the a saved Layer configured to a default dataset source. Then
it's easier to update the source and Definition Query so I never open
unnecessary data.

SSWoodward

Thanks @JohnGuilfoyle,

Saving a configured feature layer as a layer file (.lyrx) does allow map layers to be easily brought into other maps and projects without being reconfigured as long as they have access to the data source. 

The make feature layer GP tool will also take an .lyrx file, or even another feature layer, as input if you want to apply a definition query to pre configured data without loading the whole dataset. 

AlfredBaldenweck

Perhaps slightly adjusting the Idea so that we could get "Make Feature Layer" available when we right-click the feature class in the Catalog Pane? Once clicked, it would auto-populate with the feature class as input. Perhaps adding an optional parameter for which map to add the feature layer would be helpful, as well.

Layer files are great, but I've often wished for this functionality to be present in the Catalog.