Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

3
votes
1answer
31 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)...
0
votes
1answer
22 views

Page definition query not turning layer on and off when driven by Definition Querried duplicate layer of index layer?

I am trying to have some labels turn on and off dynamically with the data driven page being displayed, but it is not working. First, I have a data driven index layer moving from map to map, called "...
2
votes
0answers
42 views

Create filter expression by selected elements?

Is it possible to automatically create a filter expression for the Query Builder by selected elements?
0
votes
0answers
25 views

Accessing Feature Service via ArcGIS REST API to Customize App in Operations Dashboard?

Beginner here Just learned how to construct url to access the feature services needed to build the customized app I envision in Operations Dashboard, but struggling to find a tutorial/resources ...
0
votes
1answer
69 views

Using Page Definition Query?

I'm looking to use data driven pages to automate some of my workflow, and I'm almost there for the most part. I have a layer (Chainage - 200m markers along a watercourse) that I'm trying to perform a ...
1
vote
1answer
29 views

Using ArcMap to Query and Display Data? [closed]

I have a large amount of data in Excel spreadsheets. I have been converting that data into Attribute tables to use in ArcMap. The data includes: names of locations geo-location descriptions of each ...
2
votes
1answer
139 views

Adding Not Operator in Definition Query of ArcGIS Pro?

I am using ArcGIS Pro 2.2 I want to apply a definition query saying NOT (name contains 'road%') apparently there is no option to add Not Operator in query neither there seem to be any option ...
0
votes
2answers
55 views

Attribute table in QGIS showing a subset of desired features after query builder

I'm working with some OSM data in QGIS and I want to show only those points that are schools. So I go into query builder and enter "other_tags" LIKE '%"amenity"=>"school"%'. This narrows down my ...
1
vote
1answer
214 views

Selecting multiple values from a string in ArcMap?

I have a text field containing values like "1A,2P,13,17,22,34". I want to select the values that I need by a definition query of a layer. For a single value worked using LIKE and % but I need to ...
1
vote
1answer
62 views

Definition Query - Length of Field

Is it possible to create a definition query that will return a subset of values based on a specific field length? I only want string values where length is less than or equal to 2 characters.
1
vote
1answer
520 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 ...
0
votes
2answers
39 views

Data Driven Pages Optimization for the same FC referenced twice

I have a feature class that I am referencing twice in my map, for "active" features that are "the subject" of the map page as a Feature Layer second Feature Layer that is grayed out/"inactive" on ...
2
votes
3answers
210 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 ...
1
vote
0answers
24 views

setFilterExpression not giving results because of space?

I am trying to select data based on QgsVectorLayer() getting it's features from layer.getFeatures().next() method. When I pass expression in that using QgsFeatureRequest().setFilterExpression(...
1
vote
2answers
530 views

Using ArcGIS definition query for dates?

My attribute table contains a Start date in m/dd/yyyy format. I would like to build a query that only shows data from current month forward. Does anyone know how to build a query or expression for ...
0
votes
0answers
53 views

Why might Definition Query return empty table?

I am trying to apply a definition query to an AVL table (on an enterprise geodatabase - Microsoft SQL Server 2016) that returns the most recent record for each vehicle in the table. After a little ...
0
votes
0answers
90 views

Creating script tool for definition query using user input

I have a map document with about 10 layers that I would like to create a query definition script tool to use that takes a user input as a parameter and then executes the tool. The script looks like ...
0
votes
1answer
123 views

Definition query to display only the part of a layer that overlaps with a specific polygon

I have a very large roads data set and I would like to write a definition query that displays only the roads that are inside of a polygon. This would make my export to pdf a much smaller file size. I ...
3
votes
0answers
167 views

Current date in query builder Qgis

I'm trying to put a query on a vectorlayer with the current date. The following code works, but I want the current date to be dynamic: cast ("Starttijdstip" as character) < '2018/03/01' AND '...
1
vote
1answer
159 views

Using min-max functions in definition queries of feature services

Using a feature service from ArcGIS Online, I would like to display a record wherein one of its attributes is the max of the entire records, but is unable to do so. If I am using a Feature Class from ...
1
vote
1answer
40 views

Removing select rows from display without removing from layer?

I have a layer with a field of image_quality that is marked either good, fine or poor. I also have 4 fields for sediment type: mud, gravel, boulder, outcrop. I want to display the sediment types ...
0
votes
1answer
61 views

Joining a queried table to a feature class

I have a table in a geodatabase that I would like to join to a feature class. The table contains well locations with multiple sample dates and associated data, however, I am only interested in sample ...
-1
votes
1answer
130 views

In ArcMap my Definition Query is removing all records but categorizing on symbology works properly

I have a definition query to filter an attribute in a feature class, the Attribute is joined to the dataset being queried from an Access MDB and is data type SHORT, the values it contains are 1,0, &...
0
votes
1answer
179 views

ArcMap definition query for a string contained in a longer string not working

I am trying to query records that contain a specific string within a longer string of an attribute table but it is not working. There are a few extra details to the situation. DQ is going onto a ...
0
votes
1answer
485 views

Setting simple definition query using ArcPy?

I am trying to set a definition query on a Application Lands layer in my project.mxd using arcpy. But it's not working for me. When I launch the project the query is in there but it doesn't get ...
0
votes
0answers
87 views

Customizing complex layout with data driven page?

Main Conditions: It should be in one MXD document. What i have: 1 line feature (with definition queries), 1 polygon feature (with definition queries) this is one as example in fact number of layers ...
0
votes
1answer
35 views

Definition query on GDB annotation file- ArcGIS 10.3.1

I convert Cad annotation from Autocad, into GDB annotation using "import cad annotation" tool and this part of a big attribute table: The "TextString" is the field i need to present on my map, but ...
-1
votes
1answer
449 views

Apply Definition Query to multiple feature classes using python [closed]

I'm trying to create a python script that'll apply a definition query to all 5 feature classes. Each feature class is a condominium floor footprint called "Condo_1st_level", "Condo_2nd_level", etc. ...
2
votes
1answer
80 views

Selecting features from an expression

I am having problem creating a query. I have a data map, which is organised in areas with codes (which in turn correspond to funding oportunities). I am trying to select for each code a layer. Up ...
3
votes
2answers
141 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 ...
12
votes
3answers
1k 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 ...
1
vote
2answers
256 views

How to apply a layer definition with a spatial query to a Dynamic layer?

Using the ArcGIS Server JavaScript API, it's possible to specify an attribute query in the form of a layerDefinition against a Dynamic layer. For example, the following query will restrict the layer ...
0
votes
1answer
384 views

Definition Query for records created in the past 30 days in and SQL SDE?

I am stumped as to how to get this to work in ArcMap... I have records being created ever day, and would like to be able to show records on a map that have been created within the last 2 days based ...
0
votes
1answer
136 views

Max value from two columns in ArcGIS table query?

I'm looking for a tool that will select just these certain features (mark them in a new column or just delete all other features). It´s the highest number of "OBJECTID" for every number of "arcid".
0
votes
2answers
919 views

How to exclude several values in a definition query [closed]

I need to set up the definition query for a layer to exclude several types of values for a particular field. It is a status field that that has values such as Active, Inactive, Void, Received, etc. ...
0
votes
1answer
244 views

How to display only certain features in a layer in Global Mapper?

Is there a way to restrict the records displayed on the screen from a shapefile or other layer type in Global Mapper? In ArcGIS this is called a definition query. For example if I have a text ...
1
vote
0answers
311 views

Definition Query with GETDATE()

The expression FieldData1 <= GETDATE () AND FieldData2 >= GETDATE () works well, but if FieldData1 = FieldData2 does not work. ArcGIS 10.3.1 Desktop and SQL Server 2008. Any suggestions?
0
votes
0answers
325 views

sub-querying 3 tables in definition query without join

I'm trying to select record from Table 1 which has more than one kind of 'Type' in Table 3. There is no common ID between Table 1 and Table 3. But Table 2 has LID that's common to LID in Table 1. ...
0
votes
1answer
56 views

NameError from using definition query in ArcPy?

I am having trouble getting my definition query to be defined. What am I missing? The current error is: Runtime error Traceback (most recent call last): File "<string>", line 44, in <...
3
votes
3answers
373 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 ...
4
votes
1answer
124 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 ...
2
votes
2answers
275 views

Definition Query does not work for flex application against ArcGIS Server 10.5

I have a flex 3.5 app that has been working for a great number of years. I wrote it from the ground up not basing it on the sample flex viewer. I had some server problems yesterday and took the ...
0
votes
0answers
148 views

Why does this NOT LIKE query find too many features from FileGDB and PostGIS vs a Shapefile? [duplicate]

I can't understand why the following NOT LIKE query removes not just the ones that end in '% Lake' but blank records too for certain data formats within both PostgreSQL with PostGIS and QGIS. This ...
-1
votes
1answer
273 views

Updating Page Definition Queries with Python and data driven pages?

I have several annotation features that each have a tileID field. I would like to be able to enable the page definition query and select the correct Page Name Field to match the tileID field in all of ...
1
vote
1answer
593 views

Add-In Combo Box: populate with specific field's values and pass selection to select by attribute

I checked Passing Selection from Combo Box into Definition Query using Python AddIn?, but I am still stuck on code/syntax. I created a simple add-in with a button that clips and exports tax parcels ...
2
votes
1answer
550 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 ...
1
vote
2answers
2k views

Performing Definition Query Based on Related Table?

I have a point dataset (SDE Feature Class) of locations in a city that receive inspections. I also have a table of data (File GeoDatabase Table) where there are many inspections for each point. I have ...
4
votes
1answer
4k 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) ...
1
vote
1answer
185 views

If/then statement with layer definition query

I created a short script which creates a layer from a table view, applies a definition query (hereafter DQ) to that layer, then uses that layer to generate a report. The script works perfectly except ...
1
vote
2answers
221 views

Using parentheses in query manager of ArcGIS to define query order?

I would like to make a nested query in a single table by means of parentheses in the Query Builder of ArcGIS. More specific: I only want to select those Columns which start with TR- and in those I ...