Questions tagged [select-by-attribute]

To select data records according to logical criteria applied to their field values ("attributes")

Filter by
Sorted by
Tagged with
1
vote
1answer
41 views

Selecting by attributes which have alphabet data using ArcGIS Field Calculator? [closed]

I only want to select values that are entirely alphabetic characters. Select by attributes which I have alphabet data. SELECT ONLY RED INDICATED VALUES
1
vote
2answers
204 views

Why is SelectLayerByAttribute_management claiming “Column Does Not Exist”?

The solution to this question is not working for me. My error message: File "SumAreas.py", line 24, in arcpy.SelectLayerByAttribute_management(fc, "NEW_SELECTION, '"CLASS_CODE" = "A"') File "...
1
vote
1answer
492 views

“Select features by expression” not matching all results for text field?

I have a vector layer containing all of the property parcels in the county. There is a field called "PROP_TYPE" that contains the type of property. I am trying to select all of the residential ...
1
vote
1answer
63 views

How to Select polygons within a feature based on rules applied to FID

I want to select all the polygons of a vector grid which have a FID multiple of N (e.g. N=5). Is that possible?
1
vote
1answer
143 views

Selecting for a specific character

I am using ArcGIS 10.3.1 and editing a file GDB and a string field. I have several fields that are similar to the following, 34-01, 23-14, 87-09, 23-12... I am trying to select for fields that have ...
1
vote
1answer
160 views

SQL statement to find differences between two fields

I am trying to find the difference of 11 feet or more between two fields (Both are Double types). For example, I have a field called shape_length and another field called station_length and I want to ...
1
vote
1answer
4k views

ArcGIS error - “invalid SQL” [duplicate]

I have a map with a few different layers. One of these layers is a 'cities' layer. I am trying to use selection->select by attribute-> Select: "Pop_CL"=8 or 9 or 10..... where Pop_CL is the population ...
1
vote
1answer
194 views

Debugging ERROR 000358: Invalid expression from SelectLayerByAttribute? [duplicate]

I'm creating a script tool and using the SelectLayerBy Attribute function (below), arcpy.SelectLayerByAttribute_management("cities_lyr", "NEW_SELECTION", '"CRIME_INDX" <= 0.02') However, I keep ...
1
vote
2answers
709 views

Not Able to Pass Where Clause in SearchCursor in ArcPy

Can you please take a look at this snippet and let me know why I am not able to properly pass the Where Clause ('"[NAME_1]" = Ohio') in SearchCursor? import arcpy from arcpy import env def ...
1
vote
1answer
771 views

Using select by attributes then calculate field on selection in ArcPy?

ArcGIS Pro 2.3 I want to create a standalone script which runs outside of ArcGIS Pro (for automation purposes), which selects features (with blank attributes) in a feature class and runs calculate ...
1
vote
1answer
54 views

Using less parameters for Python script tool?

I am looking to create a user-input script for finding surrounding features of a given point. However, the parameters for it are very sensitive and I would like for it not to have to be such a process ...
1
vote
1answer
171 views

Select Lowest Values using Arcpy?

I have a table (Feature class in FGDB) with 2 columns, one is the "name" and the other is a list of year values as text "Value1". How do I obtain the lowest 5 values for EACH name? I am trying to ...
1
vote
1answer
1k views

Select by attribute using modulo operation?

In ArcMap 10.5, I want to select the rows where the modulus of the objectid by 3 equals 1. How to write a SQL sentence in select by attribute window? My current query statement is something like ...
1
vote
1answer
100 views

Open source replacement of ArcGIS select command

Is there an open source (gdal, pyshp, shapely etc.) programmatic option to the select command in ArcGIS. I want to select polygons within a shapefile based on an attribute value. This command is here: ...
1
vote
2answers
919 views

Using Python Search Cursor results to Select Features by Attributes

I would like to preface this by saying that I am very new to python and its capabilities. So my problem is that while using the in_memory work space I encountered some limitations in querying the ...
1
vote
2answers
356 views

How to use Select by attributes more efficiently

I made a shapefile into 1,040,000 grids by the tool, create fishnet. This shapefile has an attribute table including 7 fields and 1,040,000 rows. What I want to do is to make a model which can let me ...
1
vote
1answer
495 views

How to select different values from two columns through Select By Attributes?

I'm using ArcMap 10.3. I'm trying to select by attributes different values from two columns. I want to define the areas where Main rock is GRAVEL And Sub-rocks are : a. mudstone tephra loess b- ...
1
vote
1answer
263 views

Stream Trace to Select Attributes

I'm trying to work on a school project, but I only need streams up stream from a certain point. As you can see in the picture, I've run the stream trace tool upstream from a point i've created. I'm ...
1
vote
2answers
2k views

How to iterate through only select attributes of a single field using ModelBuilder in ArcMap 10.1

The feature class that I am iterating with ModelBuilder is a polygon FC called "Alignment" in my model. My current solution to iterating through only certain attributes of a single field does not seem ...
1
vote
2answers
37 views

SelectLayerByAttribute_management selects all of type of attribute instead of specific one?

I want to create a tool that allows a user to select all the points within a specific zip code by inputting that zip code. The code below selects ALL of the points with a zip code - which is all of ...
1
vote
1answer
277 views

Getting particular feature using expression in PyQGIS? [closed]

How to get a particular feature using an expression in PyQGIS? For example, there are 100 houses (with 100 entries in Attributes Table). I want to get only one house with field name ("name"=="John's ...
1
vote
2answers
69 views

Where Clause in SelectLayerByAttribute function resulting in invalid expression

All of the attempts below result in ERROR 000358: Invalid expression Any ideas on what I am doing wrong? I am working within a File GDB and with polygons. Attempt 1: def SelectLayer(val): print ...
1
vote
1answer
199 views

Expression to select features by comparing attribute values

I'm working in QGIS and I have a point layer with two fields and I'm trying to compare the accuracy of the distances in feet. One field highlights the old calculated distances and another field ...
1
vote
1answer
120 views

Selecting a feature by field value

I have a layer called 'Colorado' that has an attribute 'FIPS_CODE'. The values are numbers as a string. I am trying to use arcpy.SelectLayerByAttribute_management inside my Python script to select the ...
1
vote
1answer
242 views

QGIS object selecting if any segment length is longer than [closed]

I have a polygon layer with generated triangles covering for example district or city area. I need to select all the triangles if any triangle (object) segment is longer than 100 meters. Picture: ...
1
vote
1answer
801 views

Deleting multiple features (selected by expression) at once using PyQGIS?

I'm trying to select multiple features at once to do batch editing. The first selection is supposed to be the expression within the request, but I can't seem to get anything to select. I want the ...
1
vote
2answers
883 views

Selecting certain fields in layer using ArcPy?

I have a layer in geodatabase, and I want to use SelectLayerByAttribute to select certain fields in this layer. Then, use CopyFeature to output those fields to a new shapefile. for example: layer =...
1
vote
2answers
88 views

Creating a subselection with arcpy

I want to do the following: from a point layer's table, 1) grab all GEBID (an attribute) and create a list(1) with unique GEBIDs 2) iterate through the list(1) in a loop:   2a) stuff all features ...
1
vote
1answer
250 views

Pass sql expression with GetParameterAsText to SelectLayerbyAttribute in .py script

With Arctoolbox and python scripting I'm creating long tool, but one of the steps is to select by attributes with SQL expression. Let's imagine that: featureCar = arcpy.GetParameterAsText(0) is Data ...
1
vote
2answers
1k views

QGIS Tool Scripting with “Select by attribute”?

Why am I getting the error message The following layers were not correctly generated: Output when writing a script that uses the QGIS geoalgorithm "Select by attribute"? Here's my script (My "...
1
vote
1answer
212 views

Select by attributes is not selecting correctly

I have an attribute table where 2 columns have values in common. What I need is to Select by attributes the rows that have the same values, for this I'm doing: "w_min"= "MIN_W_MIN" AND "MIN_W_MIN" &...
1
vote
2answers
804 views

Multi Value User Input as Variable in SQL Statement

I'm attempting to write a script that takes a user's selection as a parameter and uses that as part of the SelectByAttributes function. The parameter represents field attributes and is multi value, ...
1
vote
1answer
206 views

Alternative to Copy Features in ModelBuilder to display a result [closed]

I have created a model that takes in a raster, converts it to a point shapefile, then extracts a set of points based on location, then further selects a set of points based on a SQL expression. I ...
1
vote
2answers
144 views

How to handle list variable in a where clause

I am calling a list of names in from a text file and would like to use each of those to make new layers. I am running into an issue where I get "TypeError: cannot concatenate 'str' and 'list' objects" ...
1
vote
1answer
1k views

Debugging Select By Attribute tool within loop giving ERROR 000358: Invalid expression Cannot acquire a lock?

I have seen several similar posts related to this technique but I am still having issues. The following script is intended to select all points from one shapefile that are within the boundaries of a ...
1
vote
2answers
870 views

Select By Attribute using geoprocessing without using layers?

I am selecting features based on attributes within an ArcGIS Add-In. The selections are pretty simple(e.g. "DESCRIPTION = left"). Is there a tool or method of doing this that doesn't require passing ...
1
vote
1answer
26 views

Output of an algorithm in QGIS Graphic Modeler

I use two Processing tools in a graphic Model in QGIS: 1-Select by Location 2-Select by Attribute The problem is that I can't get the output of the selection by location so that I can't use it as ...
1
vote
1answer
27 views

No output is being generated by ArcPy's MakeFeatureLayer method

I have a feature class that I would like to filter by an attribute and write the result to a new feature layer. I can achieve this with a simple one-liner in the R programming language, but I need to ...
1
vote
1answer
26 views

Select ArcMap attributes that are in CSV

Is there an ArcMap 10.1 method for selecting only attribute rows that have an identifier in common with those in a CSV sheet? I exported an attribute table (5000 rows) and eliminated all but the ...
1
vote
1answer
106 views

Accumulate selections by expression using a for loop (Pyqgis)

I need to run a for loop to select features by their attributes, because the values are within lists (strkey and strvalue). I'm using the following script: k=0 v=0 layer = iface.activeLayer() for ...
1
vote
1answer
23 views

Locating records not in selection using ArcPy?

I have a list of addresses that I need to contact. Some are listed in the attribute table, and some aren't. I'm trying to find the ones that aren't. The list: contacted = ['123 STOWE ST', '123 ROSE ...
1
vote
1answer
32 views

Selection using wildcards [closed]

How can I use wildcards (*) in the ArcGIS Query Builder? It cannot refine my work in Select By Attribute function. 'AA03-FE-P006R' 'AA03-FE-P007R' 'AA03-FE-P006L' Right (Asset_Code,1) = 'L' This ...
1
vote
1answer
59 views

Using SelectByAttribute_management after making XY Event layer in ArcPy

I imported a CSV file using the MakeXYEventLayer_management and trying to use the SelectlayerByAttribute_management function, but I am getting error message saying on "Object ID(OID)" is present.. Is ...
1
vote
1answer
80 views

Cannot select by attribute for new attributes added by join in ArcGIS Pro?

I'm new to ArcGIS Pro and am following some tutorials. I did a join to add some data to the attribute table of one of my layers. Now, when I go to select by attribute and look for those attributes ...
1
vote
2answers
58 views

In ARCGIS 10.5 mxd I need to put definition query for one layer as Current Year in Year fields , What i need to set the query

I have a feature class and related info in another table, the table having fields as Year, Year having values like - 2016,2017,2018,2019... Presently I Put the definition query for table Year = 2018 ...
1
vote
1answer
420 views

Select by attribute how to only select numbers in a string field

Using a SQL experssion in the "Select by Attributes" table, how would I only select records 1, 4, 5, 8 and omit the rest (I only want to select values that are entirely numbers)? What I have right now ...
1
vote
1answer
1k views

Select feature by id in QGIS using Python

I have a ComboBox shows feature ids of selected features in a layer. I am trying to select one feature using ids in ComboBox currentIndex. I used setSelectedFeature(), but it didn't worked.I can't ...
1
vote
1answer
111 views

Filtering data in ArcGIS ModelBuilder?

I am not very experienced with the ModelBuilder and am new to ArcGIS Desktop. I want to use the ModelBuilder to select data from a polygon feature dataset in a first step. The dataset represents the ...
1
vote
3answers
952 views

Select Layer By Attribute Python Script Tool?

I'm trying to script another Select by Attributes tool. I want to be able to find a specific building using a field and zoom in to the location. However, my tool needs to allow a user to input any ...
1
vote
2answers
118 views

Calculate maximum value from a subset of fields ending with a standard suffix

I'm using the Python built-in function in the calculate field tool in Modelbuilder to calculate maximum values for each record from a list of fields: This is the field calculator expression I use in ...

1 3 4 5 6 7 10