Selection to Definition Query

10090
40
11-15-2013 07:46 AM
Status: Under Consideration
Labels (1)
PatrickMoulden
Occasional Contributor

Add a tool (w/ gui preferably) to get the attribute values for a set of selected features and use them in an interactive definition query dialog box which would allow the user to select which attributes to use for the querry and how to use them.  If this is set up in gui it could also be used to visually analyse for trends within the selected data.

40 Comments
DanielMakridakis
A definition query is adaptive to the data so if any new data is added or removed that stratify the query the displayed features would adjust accordingly. To create a selection into a query would mean your definition query would be a list of the selected Object IDs.
 
If you want to create a layer from your current selection just right click on the layer in the TOC and choose Selection> Create layer from selected features.
 
This brings up a different idea that I will now post, which is, I wish you could add, merge, and remove records from layers that were created from “Create layer from selected features”. Often I create a layer from selection, do a few things, realize its missing some data, and either have to re-do the whole selection including these missing features or make a new layer and then do some kind of select by location to select all from the parent layer that’s in the 2 subsets. Or I created a layer from selection and realize there are a few features i wish werent in there and have to re-do the whole thing to remove them. If it was a complicated selection this can be time consuming and produce further user errors during the replication.
GISAnalyst3
I can't believe this wasn't done a long time ago. In the attribute table it's easy to show only selected features, so why would anyone think that this isn't something you would optionally want the map to reflect? There are many instances where a selection query won't do the job.

Another useful variation would be the ability to optionally have the attribute table list only the features currently visible on the map.
JHayes
by
I'm right there with you.  Life would be so much easier sometime if we had this option!  We need this option!
JakubSisak
I made an Addin for that:  Make Query from Selection
DebiMartin
I would like to make a selection from a dataset to be symbolize, non selected would not available and  or create a definition query from a selection set.
MattWilkie3

@chris_fox-esristaff the first part of the idea is display only the selected records, but the second part is the ability to later inspect that selection and possibly alter it, as well save and share it. Copying the selection into a definition query would allow that, while creating a layer from selection does not.

Also in my experience the redraw performance of def-query layers is markedly faster than selection-set layers, especially for image services.

CécileDELIMAL_-_PAPILLON

Hi Jakub, 

How can we get your addin ?

Thanks!

MichaelVolz

Jakub:

Is this an ArcMap Addin?

If so, do you have plans to make this for Pro as well?

MattWilkie3

A further limitation of Selections that Def Queries don't have is that many operations ignore the features/rows in "Selection from layer xxxxx" and read straight from the source table anyway. 

ErinKenna

So I usually do this;

- Select features

- Make Layer from Selected Features

- With the new selection layer, set the symbology to Unique Values and a relevant field like id or name. (I don't use ObjectID because future edits may mess things up).

- Group all the symbols into a single group.

- Go to Labels and 'Create Label Classes from Symbology'.

- The new label class (or classes depending on what you did with your symbology) will have generated SQL.

- I then copy the SQL back to my original layer and delete the selection layer.

Once your used to it this used to be really quick in ArcMap. Still possible in Pro but requires a few more clicks.

Also ArcMap used to generate a nice SQL `IN` expression where Pro now does more verbose `AND`s.

I'll sometimes use this method to generate part of what I require. e.g. generate the SQL for a NOT statement to exclude features or combine it with some other SQL clause to further subset the set.

Some sort of tool or button would be very useful.