Questions tagged [definition-query]

A request that examines feature or tabular attributes based on user-selected criteria and displays only those features or records that satisfy the criteria.

Filter by
Sorted by
Tagged with
12
votes
3answers
2k views

Create Layer from Selected Features tool: How is the list of features stored?

In ArcGIS Desktop, there is a tool called Create Layer from Selected Features. Using this tool, I can convert a selection to a layer in ArcMap. It's my guess that there is a "list of features" that ...
11
votes
3answers
19k views

Setting Definition Query on ArcPy layer from shapefile for ArcMap

I am trying to determine options to set a layer definition query using ArcPy. I know that it is possible when using arcpy.mapping.ListLayers(). However, in this scenario I am loading in ...
11
votes
3answers
1k views

Using Label classes vs Definition queries - which performs the best?

Which would provide the best performance for working within ArcMap with very large datasets stored in an ArcSDE geodatabase? Multiple label classes using complex SQL queries to label specific features,...
10
votes
3answers
1k views

Querying for underscore character in ArcMap?

For a standard LIKE query against an Oracle-based ArcSDE feature class, the underscore character represents a single character wildcard when used with a string. I'm trying to impose a definition ...
10
votes
3answers
2k views

Commenting Out Definition Queries in ArcGIS Desktop?

I use Definition Queries a lot in my daily GIS life, but one of the many things I've found annoying about ArcMap is the inability to comment out Definition Queries. I'd like to have this option as ...
10
votes
1answer
3k views

Referring to NaN or ±∞ (special floating point values) in ArcMap definition queries?

I have by chance discovered how ArcMap displays special floating point values to the user. +∞ (positive infinity) is displayed as 1.#INF –∞ (negative infinity) would supposedly be displayed as -1.#...
8
votes
1answer
2k views

PostGIS query vs QGIS filter

I have a PostGIS dataset with around 3 million shapes. I only need to view about 1,500 of these shapes at any given time, but the shapes I need to see depends on which feature is selected in a ...
8
votes
1answer
879 views

ArcObjects with Left Join

I'm expecting an ArcObjects code which is equivalent to SQL left join. For example: I have the below SQL code, it's simple join to fetch the records from the both tables based on the ChecklistId ...
7
votes
2answers
7k views

How do you construct a definition query to return only those features in the current month without hard coding the date?

I have a feature class containing a date field within a 9.3.1 File Geodatabase. There are "duplicate" features contained within this layer, one feature for each month over the past few months. ...
6
votes
1answer
6k views

Using the MOD expression on an SQL Feature Class is not possible?

I use the MOD expression quite frequently in my definition queries in ESRI to extract fields that are divisible by a specific vale for example: MOD( [contour], 50) = 0 OR contour = MOD(0, 50) ...
6
votes
2answers
13k views

Selecting max value from group using ArcGIS definition query?

In ArcGIS 10 I am trying to do a Definition Query that will select the records that are the max values from a specific group. Here is what I have tried in the Query Builder but I am getting an "the ...
5
votes
3answers
1k views

How can I parse hundreds of *.lyr files for their Definition Queries?

I have ~600 lyr files that reference a table on an SDE database that has about 20,000,000 records. Some of these *lyr files have an incorrect definition query applied or is missing the query entirely....
5
votes
1answer
20k views

Definition Query to exclude certain values and return remaining values

I have been trying to create a Definition query to symbolize a set of water features. I cannot edit the .shp file and I want to exclude a multiple values. I have tried using NOT but have had no luck. ...
5
votes
2answers
1k views

Removing definition query in ArcPy?

I have created one script which set a defination query at certain location in script. I use lyr.definitionquery = "some expression" After running the script i want to remove the definition query . ...
5
votes
1answer
775 views

Why does updating Definition Query on layer in ArcGIS 10.1 SP1 no longer allow access to all unique values in dataset?

In ArcMap 10, setting a definition query on a layer would display only the subset of features: To add more features to the query would simply involve clicking Get Unique Values to list all the values ...
5
votes
1answer
667 views

Can I edit shapefile while using a definition query in QGIS? [duplicate]

Is it possible to edit shapes while using a "definition query" or "query builder" in QGIS? I'm trying to do this in the same way I used to in ArcGIS. Thanks!
4
votes
1answer
153 views

Debugging definition queries in ArcMap?

Troubleshooting and debugging ArcMap defintion queries that go beyond a basic single statement can be very frustrating. Statements that work on their own easily break when combined. How can this pain ...
4
votes
1answer
11k views

Applying a definition query to date field for feature in file geodatabase

Is it possible to apply a definition query to show data for today, yesterday and two days ago for a field where the data type is 'Date'? I have a script that downloads MODIS fire data and wish to ...
4
votes
1answer
3k views

Definition Query Current Date SQL Server Native Syntax Error 10.2?

I have this definition query that worked for a layer from a file geodatabase. Now the same query will not work from the same layer in an SDE. I am getting a 'SQL Server Native Client Syntax' error. ...
4
votes
1answer
8k views

Using Not Equal to Wildcard in ArcMap Definition Query?

I'm attempting to use a definition query in order to display only a subset of data. I have a large CAD drawing that I have imported into my map. I do not need many of the lines from the .dwg file to ...
4
votes
1answer
3k views

Using output statistics in ArcGIS REST API query?

I am using an API to pull in some Web Mapping Service Layer data to my script. The API query has a max count limit of 1000 on returned features per request. There are 2 attributes I am trying to use ...
4
votes
2answers
6k views

Definition Query with Current_Date?

I have a date field called ExprDate and I want to set a definition query to select all records from today's date plus the next 7 days. This is what I have: ExprDate >= CURRENT_DATE +7 The ...
4
votes
1answer
1k views

Building a Definition Query using Sub-queries with multiple conditions

Background Since layer selections can't be be published as a map service, I need to duplicate N layers and write definition queries for each to satisfy my needs. I can't create new standalone layers ...
4
votes
1answer
80 views

Not able to update the “ACTION” field

Currently I am working on a GIS project where I have to update a field in a layer with some values to get my work done. Because the manual efforts are time consuming hence I added a custom addin to my ...
4
votes
1answer
676 views

Automatically create new layers from a single dataset using definiton query for unique values in a field

I would like to automatically display a featureclass as different layers based on a specific field. I've seen a few tools online and on XToolsPro under the category of Split by Attributes, but they ...
4
votes
1answer
6k views

add definition query to layers in a group

I'm trying to develop a python code that will apply the same definition query to all layers in a specified group. I currently have a working code that will apply a definition query to all layers in ...
4
votes
1answer
80 views

Is it better to use a single layer with symbol classes or multiple layers with definition queries?

I use symbology classes to display my data most of the time. I think I have noticed a performance hit when using symbol classes on large datasets, although it might just be in my mind. That got me to ...
4
votes
1answer
1k views

How to make SQL definition query in ArcGIS to show only unique values (hide duplicates)?

I have a vector file with field of type LONG. Some values of this field are duplicates. Is it possible to make such SQL definition query in ArcGIS 10.3 to show only unique values without duplicates? ...
3
votes
2answers
1k views

Why is Definition Query not returning any records?

I am currently working on a mapping project and only need 8 tenements out of many to appear. I have gone into the query builder to complete this and unfortunately it will not work. Into the builder a ...
3
votes
4answers
2k views

Definition Query expression limits in ArcGIS 10.2.2

I have a large database in ArcGIS 10.2.2, with over 2 500 000 point vectors. Each point has a unique number code. I want to spatially subset my data, so that I can extract only points with a specific ...
3
votes
1answer
850 views

Area of polygon split by a line

I need a query that return the area of two polygons that have been split by a line. This is what I did so far: SELECT ST_Area(ST_Split(surface.geom, limite_a.geom)) from surface, limite_a where ...
3
votes
1answer
50 views

Selecting and displaying all of items with same value in attribute table using ArcMap

One of the columns in my attribute table is entitled NAICS_1 and I'm supposed to display only the objects with an NAICS_1 of a specific value. How do I filter the attribute table using ArcMap to only ...
3
votes
1answer
82 views

Several QGIS layers sharing single shapefile

Is it possible for several QGIS layers to share a single attribute file, but each layer containing a different set of features from that one shapefile based on the value of an attribute?
3
votes
1answer
104 views

Applying Definition Query for multiple features using ArcPy?

I'm trying to apply the following code to extract features that contain these letters 'MW' within the field called 'CODE' for multiple layers. But I'm getting a SyntaxError for line 5 (defintion query)...
3
votes
1answer
1k views

Passing Python List into Layer Definition Query

I am trying to cursor search through items in a field in a feature class. I then append them to a list called 'distList'. I want to pass the list into layers definition query as follows: "Field1" in ...
3
votes
2answers
242 views

Greater Than/Less Data Driven Page Definition Query?

I'm using data driven pages where each page is representing a series of points for a particular year. The problem I have is that I want to not only show the points for a particular year, I want to ...
3
votes
3answers
767 views

Show labels for features that fall outside of inset data frame

I'm working with a scripted Mapbook in ArcMap; There are several pages that require an inset map to show detail of a cluster of points in the main data frame. The cluster of points comes from one ...
3
votes
1answer
4k views

Definition Query then Zoom to Layer using ArcPy?

I'm trying to create something in here. I want to have an automated process of doing a DEFINITION QUERY then ZOOM TO LAYER with one step. the concept is like that, a dialog comes up with one form ...
3
votes
1answer
576 views

SQL check if first value in line is number

In the layer definition query in ArcGIS 10.4 I want to only use objects that look like 1/12 Main Street 12-2 Side Street etc and not ones that have Main Street Side Street Is this possible? So ...
3
votes
1answer
3k views

ESRI File Geodatabase - Trying to use CURRENT TIME in Definition Query

Is it me, or are the date functions in the file geodatabase a total nightmare. Anyway, I am trying to set up a fairly simple definition query that contains a subquery with a date comparison. My ...
3
votes
1answer
668 views

Creating definition query on layer excluding decimal values in ArcGIS for Desktop?

I am working on a layer of spot height in ArcGIS 10.3. The attribute table of this layer contains a field called 'Elevation' wich one provide the altitude of these spots height. These values can be ...
3
votes
1answer
699 views

Extracting area from map and making this new layer?

It is probably the most simplest thing to most people, but I am only starting out in the GIS world. I have a map of Ireland but my focus is on one particular county. I want to 'crop' the rest of ...
3
votes
1answer
308 views

definition query and mosaic dataset from gdb ArcMap 10.1 SP1

I have a Python AddIn Combobox to select a value from the drop-down list. This value changes the definition query of the layers in mxd. This works fine for "normal" feature classes, not for a mosaic ...
3
votes
1answer
3k views

Passing Selection from Combo Box into Definition Query using Python AddIn?

I am trying to pass the users selection into a definition query in an addin combo box python script. Basically, I have a feature class with a field called "SITE". I build a python list from that ...
3
votes
0answers
130 views

Definition queries deleting themselves in ArcMap? [closed]

After switching to ArcMap 10.2 I've noticed that my definiton queries will seemingly randomly remove themselves. I have no idea what triggers the deletion since I have noticed it after reordering ...
3
votes
2answers
445 views

Using PostGIS functions in ArcGIS Desktop for Layer Definition Query?

I am connecting ArcGIS Desktop 10.2 to Postgis 2.0.3 with PostgreSQL 9.2.4. No SDE. I can load data with no problems and access the data in ArcMap. However I can't seem to use PostGIS functions within ...
2
votes
3answers
414 views

ArcGIS Desktop 10.3 - definition query to exclude integers starting with certain values

I have an integer field in a polygon shapefile that I want to definition query out everything number that beings with 18. These numbers aren't sequential and are of any length, ie I want to exclude ...
2
votes
2answers
377 views

Graphic clipping of Data Driven Pages to index feature that defines each page?

I wonder if there is a way to cut all the data in each polygon separately when using data driven pages?
2
votes
2answers
999 views

Writing Python Def Query for multiple layers [closed]

I have Three layers in a .mxd, all three layers have a common value I can use, but a different Label in each Layer. As an example, the Value I want to use is "100" In Layer A, the Value is in [Name] ...
2
votes
1answer
700 views

Performing definition query against Polyline shape field in ArcGIS Desktop?

I have joined two polyline shapefiles together that represent two months worth of data. I'm now trying to find any changes to the shape of the records between the two months (added vertices, deleted ...