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
1 vote
1 answer
34 views

Extracting specific features using expression in QGIS [closed]

I have a field holding strings like this - 1,2,3,4,5,11,12,10 (each record contains a combination of figures from 1 to 20 separated by commas). I need to extract only the records containing in this ...
2 votes
1 answer
38 views

How to build a query in PyQGIS

I am trying to build a query and filter some features (not selection). This is my code: #Import the necessary classes from qgis.core import QgsFeatureRequest, QgsExpression # Create a ...
-1 votes
1 answer
33 views

ArcGIS Pro set Definition Query to be between two values

I am using ArcGIS Pro and want to select elevation values in a polygon layer that are greater than 0 AND less than 1500 meters. When I right-click n layer and select Properties -> Definition query ...
  • 53
1 vote
2 answers
67 views

Adding a layer to multiple maps within the same project with ArcPy [duplicate]

Using ArcGIS Pro 3.0 I am looking to apply a definition query on a feature class from a geodatabase and add it as a layer onto 3 maps. My thought was to use a for loop to loop through my maps and add ...
0 votes
1 answer
46 views

ArcMap does not apply script customized definition query in layer´s properties

I am using ArcMap 10.6 and I try to run a script in ArcMap in order to apply a certain definition query on all project layers that support definition queries. # -*- coding: UTF-8 -*- # import system ...
0 votes
2 answers
98 views

ArcPy command to get the number of features in map layer

I am looking for an ArcPy command to get the number of features in map layer. There are posts on how to check the number of features in the source of the map layer with arcpy.GetCount_management(lyr....
  • 1
2 votes
3 answers
210 views

Zooming using getLayerExtent property of MapFrame not always zooming using ArcPy with ArcGIS Pro [closed]

To see this problem: Start ArcGIS Pro 3.0.0 (or any version you wish to test) Create a new project using the Map template, call it TestProject in C:\temp and tick the checkbox to make a new folder ...
  • 64.5k
1 vote
2 answers
132 views

Filter Date field in the file geodatabase

I am reading data from a file geodatabase in my FME workspace. The data is huge and takes time to process. I have set up a query to only filter data that ends with .2022 but the workspaces are still ...
  • 17
0 votes
0 answers
17 views

Geoprocess removing table and associated joins and definition queries from map in ArcGIS Pro project

I need a table join and definition query to be preserved after a scripting tool is run that overwrites the table. When the end user opens ArcGIS Pro no maps are active or open. However, when the tool ...
  • 1,485
0 votes
1 answer
180 views

ArcGIS Pro Definition Query between two tables

Seems like I was able to do this easily a few months ago using ArcGIS Pro 2.9. I have a database table and a feature class. I need to be able to draw in a polygon for the feature class and use the ...
  • 1,485
0 votes
1 answer
122 views

Definition Query to exclude multiple values from multiple fields [closed]

I have tried multiple iterations, but nothing seems to work. Here are two of my latest attempts: NOT NPDES_NUM1 = 'IL0066265' OR NOT RCRA_ID_1 = 'IL1410175005' OR NOT RCRA_ID_1 = 'ILD006935571 This ...
  • 19
0 votes
0 answers
57 views

ArcObjects with Multiple Table Join Complex query

I'm expecting an ArcObjects code which is equivalent to SQL Query or way to do it or even if it is achievable ? For example: I have the below SQL code, it's simple join to fetch the records from the ...
2 votes
1 answer
49 views

Definition Query returning No Results using ArcGIS Pro

I have a fairly large contour feature class (about 500,000 contours) and I'm trying to select out just the 0.5m contours from the set. I can see from the attribute table that there's plenty of such ...
  • 31
0 votes
0 answers
24 views

Selecting features without specific character in Definition Query ArcMap

I am using ArcMap 10.7. I am trying to represent in the map using the Definition Query of the layer, Only features from this table of content (it includes 1500 values; the image is just an example) ...
  • 3,984
0 votes
0 answers
111 views

ArcGIS Pro Page Query doesn't hide table of attribute

I am switching to ArcGIS Pro from ArcMap and I'm facing a strange issue. Once I build spatial map series and several layers with Page Queries. The map view applies Page Query and update the layout as ...
  • 1,062
1 vote
1 answer
535 views

Set Definition Query Name in ArcPy with ArcGIS Pro

I am using ArcGIS Pro 2.9 Using ArcPy I have to initiate multiple queries every day on 60+ layers and all these queries are piling up in Definition query tab for all these layers. I am unable to ...
0 votes
1 answer
63 views

Setting up ArcPy SQL Query that allow for "one" or "both" selection

I am writing a code that will query two attributes, zoom to layer and output a map. The problem I am having is in some cases the user will likely only want to query one of the two attributes. How can ...
0 votes
0 answers
105 views

How to efficiently filter and select attributes based on conditional formatting?

I am wishing to filter my attribute table to display only certain values that meet certain criteria based on multiple column values. For example, I want to show all locations on my map that are Lost ...
  • 13
3 votes
1 answer
312 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 ...
  • 39
2 votes
0 answers
230 views

QGIS Temporal Controller - last/most recent object within a temporal frame

i am working with temporal controller for just a cluple of days - before i've been using time manager. right now i am searching for a way to display the last/latest/most recent feature within a time ...
0 votes
0 answers
150 views

When I export a layer with a definition query, it does not maintain coverage. Why is that and how can I find a way to make it do that?

I am trying to use the NHD waterbody layer in my map. As is, it is a really dense dataset, so I am narrowing it down to only show lakes (Ftype = 390). When I use the definition query, everything looks ...
1 vote
0 answers
93 views

How to save a GeoJSON layer with the select option for the items in a field in QGIS

I have a GeoJSON layers with many items. If you open the attribute table you can select an option in one field clicking over the field and the choosing one of the displayed options. The problem is ...
3 votes
1 answer
210 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?
  • 915
1 vote
2 answers
189 views

Create dynamic layer for each unique value

I'm new to ArcPy. I'm trying to write a script that will loop through the unique values in a field in a FC and create dynamic layers, with definition queries, for each unique value. Each of the ...
  • 1,014
0 votes
1 answer
92 views

Filter layer by using symbology as toggle in ArcMap

Is there a way to customize ArcMap 10.7.1 so that users can filter layers by simply clicking the layer's symbology in the table of contents?   For example, is there a way to add a toggle/checkbox to ...
  • 1,014
4 votes
4 answers
2k views

Creating definition query from selected features using ArcGIS Pro

I have a layer with 2000 or so points, and I selected 50 of them (with no attributes in common, they were randomly chosen). Now I want to make a definition query, so should I will only visualize these ...
  • 133
0 votes
2 answers
395 views

Definition queries in Python Toolbox tools

I'm trying to set a definition query within a Python Toolbox tool in ArcGIS Desktop. The code below works when I run it in the ArcGIS Python window, but does not perform the definition query or ...
1 vote
1 answer
71 views

How can I select features with both multiple attributes and NULL values

I'm using ArcMap and am trying to filter a selection from my attribute table that contains both NULL and regular values but it is not working. The query should only select John values with NULL, ...
0 votes
1 answer
113 views

Page definition based on name field

I'm a basic user of ArcMap and currently trying to figure out a solution for an issue i'm having with my data driven pages. The data frame layer that I'm using for the data driven page has a field ...
0 votes
1 answer
118 views

Making definition query table not blue in ArcGIS Pro [closed]

I am new to ArcGIS Pro. I figured out a definition query but it's making the attribute table blue and it hurts my eyes. I would like definition query tables to be un-colored (white), but I want ...
1 vote
0 answers
22 views

Linking Feature Classes between Two Different Map Frames so that Definition Queries in one Frame Apply to Another Frame

In ArcGIS Pro 2.4.1, would like to determine whether it is possible to link two identical feature classes, where feature class 1-1 is in map frame 1-1 and feature class 1-2 is in map frame 1-2. The ...
  • 67
1 vote
1 answer
690 views

Setting up definition query to run through ModelBuilder on ArcMap?

I am trying to make a model that will symbolize data quickly, but wanted to see if a model could perform a definition query or multiple definition queries on a large data set. If this is possible, ...
0 votes
1 answer
169 views

Filter layer by pasting in WHERE clause?

I have a web map in Portal that has the Web AppBuilder Filter widget. The map has a point layer in it called Work Orders. I would like to filter the work orders by pasting in a WHERE clause. The ...
  • 1,014
4 votes
1 answer
92 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 ...
1 vote
1 answer
482 views

Definition Queries for most recent date in ArcGIS Pro

I have a feature class containing sample results for locations that includes thousands of records. Many of these are overlapping and have the same location ID. I need to label each sample based on the ...
0 votes
0 answers
103 views

Query returning multiple vehicle_ids when it should only return the top 1

Using ArcGIS Desktop 10.5.1 I have a point featureclass in an Microsoft SQL Server 2012 Enterprise Geodatabase (ArcGIS Server 10.5) that holds MDS (mobility ride share scooter) data. The feature ...
  • 3,842
-1 votes
1 answer
1k views

Updating layer definition query using ArcPy? [closed]

I'm using ArcPy for some automation and I need to update the layer definition query multiple times while running the same script. I've only been able to find ways to update the layer definition ...
  • 477
0 votes
0 answers
95 views

How can I create a layer for each unique field item in a shapefile using Arcpy

#Introduction and imports import arcpy, string from arcpy import env #User Inputs: layer, field name, output workspace (optional) strTargetLayer = arcpy.GetParameterAsText(0) strFieldName = arcpy....
  • 74
1 vote
1 answer
374 views

Definition query not updating [closed]

I have an ArcMap 10.3 MXD in which which I am trying to update the definition query of an enterprise geodatabase layer using Python: import arcpy, os, re from arcpy import env inmxd = r'C:\Temp\...
3 votes
1 answer
221 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)...
  • 43
0 votes
1 answer
274 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 "...
  • 1,059
2 votes
0 answers
85 views

Create filter expression by selected elements?

Is it possible to automatically create a filter expression for the Query Builder by selected elements?
  • 467
0 votes
1 answer
628 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
1 answer
46 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
1 answer
1k 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 ...
  • 1,068
0 votes
2 answers
297 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
1 answer
1k 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 ...
2 votes
2 answers
894 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.
  • 287
5 votes
1 answer
4k 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 ...
  • 1,821
0 votes
2 answers
57 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 ...
  • 335