Skip to main content

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
2 answers
56 views

Select points with maximum value in each polygon

I have Census areas as polygons and Census population counts as points at a lower geographic level (i.e., there are many points within each polygon). I need to select 1 point from within each polygon ...
Thomas Hochkins's user avatar
6 votes
1 answer
151 views

Selecting field values that are integers or decimals with QGIS expression

I am trying to select features using an expression in a single file. The file contains polylines (contours) set at an elevation. I want to select all features that are decimal: 1.2, 1.4, 1.6, etc. ...
cooluser91's user avatar
0 votes
0 answers
36 views

How do I automate creating new features from a shapefile based on specific field?

I have a shapefile of a country with district boundaries (Refer to the image below). I want to create new features or shapefiles of individual district boundaries How do I automate the creation of ...
mfirdaus_96's user avatar
0 votes
0 answers
48 views

arcpy.SelectLayerByAttribute_management

I have a scripts that was created some time ago, probably in an earlier version of Python. I have several Python programs to use and get different error. I guess that's to be expected. Code snippet: ...
FSR's user avatar
  • 1
0 votes
2 answers
109 views

Extract specific information from a shapefile [closed]

I work with water and waste water systems. I have a shapefile that involves all the manholes and pipe ID's. My task is to extract 72 pipes that have unique ID's. In a shapefile that involves 4000+ ...
Kaltrina Loshi's user avatar
1 vote
3 answers
86 views

Saving selection as new layer after using array for filter expression in PyQGIS

I am selecting features based on whether "ZIP_CODE" value is found in an array. I am getting matches with the following: layer = iface.activeLayer() array = [93013, 35007] matches = 0 for ...
Simon Palmer's user avatar
4 votes
2 answers
114 views

Select features by joining table in QGIS

I have .shp layer with field "FIELD_1" in the attribute table (5000 records). I have also Excel file with field "FIELD_2" in the attribute table (1600 records). I want to select in ...
com's user avatar
  • 3,684
1 vote
2 answers
351 views

Is it possible select a field if it contains specific text in ArcGIS?

I'd like to select by attributes within the field NAME that contain "Mt" and "Morris". Using .format() doesn't work and I've been unable to use search cursor to produce the needed ...
Daniel's user avatar
  • 81
0 votes
0 answers
38 views

Formatting SelectLayerByAttribute_management where clause

I have two shapefile layers in my arcMAP project, "TP_Input" and "union". The latter has the associated layer "unionOutputLyr". I am trying to do a simple select by ...
William's user avatar
  • 171
0 votes
0 answers
83 views

Selecting polygon based on value present in field using QGIS Graphical modeler

I have a layer (polygons) of municipalities and I need to select just one polygon based on their name (e.g. 'venice' this value is present as a value in the field "COMUNE" ) because this ...
Checco68's user avatar
0 votes
1 answer
121 views

ArcGIS Pro 3.1.2 change only blank selected cells in attribute table

I am using ArcGIS Pro 3.1.2. Is it possible to change only the null values cell in a selected dataset? I could have export the selected features as a new shapefile. Select the null values and replace ...
GIS Noh's user avatar
  • 321
0 votes
0 answers
23 views

Randomly creating areas within one country focusing on built-up area using ArcGIS Pro

I need to Randomly select 60 areas(square 2*2=4km2) within one country and it should take into account all six landscape types. I need it to compare the build-up area changes during a few decades (...
YP Environmental Research's user avatar
1 vote
2 answers
157 views

Selecting multiple points from an attribute table in QGIS, based on uncategorized field value

I have a point shapefile in QGIS (3.30.2) containing more than 2000 points. I selected about 150 of these points based on a special criteria. I need to create a separate shapefile with only these 200 ...
Paris's user avatar
  • 591
2 votes
1 answer
192 views

Extracting or selecting only 4 digit numbers from attribute field

I have a field, this field has integer numbers, what I need is to find only the 4 digit numbers and select/extract them. I do know a few solutions but they didn’t work out. What exactly I want to do ...
John's user avatar
  • 21
0 votes
2 answers
60 views

Selecting records after using insert cursor

Using ArcPy and on the same script, I would like to perform a SelectLayerByAttribute tool to select the features created with the InsertCursor tool. coords = [1, 2, 3, 4] pointlyr = 'point' Sr = ...
user206005's user avatar
1 vote
1 answer
83 views

ArcGIS Pro: Area of certain land cover types for each main type (simplifiable?)

I have multiple areas with a unique ID (wetland sites) and now want to calculate the area of certain land cover types (grassland, woodland etc.) for each wetland site. I found a solution but am ...
Nepomuk's user avatar
  • 13
0 votes
1 answer
259 views

Pass a variable to a SQL Expression for a Select by Attribute in ModelBuilder

Working to create a script which iterates over a set of CSV files and then joins to a ZIP file. Once that is completed, it goes through to Select by Attribute to ensure we are looking only at true ...
John D's user avatar
  • 53
0 votes
1 answer
82 views

Select Layer by Attribute not working with variable, but doesn't give errors using ArcPy

I'm trying to make a simple script tool that allows the user to search a for a specific polygon in a feature class using a unique number. Using the python window in ArcGisPro I run arcpy.management....
grahamsy2k's user avatar
1 vote
1 answer
44 views

Select points by polygon and update attribute field

For each record in the pointLayer, I'm trying to see where they are located using the polygonLayer. Then, update this location information to the "SWPsubwatersheds" field from the pointLayer ...
user228948's user avatar
0 votes
1 answer
354 views

Selecting all multipart features in feature class using ArcGIS Pro [closed]

How do I select and visualize all multipart features in a feature class using ArcGIS Pro?
raytron333's user avatar
1 vote
1 answer
71 views

PyQGIS zoomscale freezes map canvas

I have a PyQGIS code made partially with graphical modeler and some personal completion. Basically, based on this code I want: Type any city from my point shapefile, select it by attribute. Zoom to ...
Marin Marian's user avatar
0 votes
0 answers
105 views

Choosing parcels listed from Excel sheet in QGIS

I was sent an Excel sheet by a different department with all the parcel numbers they want to be mapped. They are all over the county. What is the best way to select the parcels that were given to me ...
user avatar
1 vote
0 answers
49 views

QGIS3 weed tracking via polygon attributes

I have been requested to provide some information about weed distribution on a site in the form of polygons that describe land forms. I am using QGIS3 and slowly getting the hang of it, might be too ...
Batco's user avatar
  • 11
6 votes
1 answer
154 views

Limiting administrative shapefile to less granular level using ArcGIS Pro

I am using an administrative shapefile of Jamaica in ArcGIS Pro. I have a number of attributes at varying levels of granularity. There are 14 Parishes, 65 "Constituencies", roughly 650 "...
Matt's user avatar
  • 93
1 vote
0 answers
36 views

Locating a specific field in an attribute table using SQL with ArcGIS

I am a beginner at GIS/ArcGIS and have a quick question about locating a field in an attribute table of a feature using SQL. Attached is an image of a (crude) example of the kind of attribute table I ...
Rachel's user avatar
  • 11
1 vote
1 answer
477 views

Explode a layer into multiple layers based on an attribute field, using QGIS [duplicate]

I have a layer where every feature contains a type attribute with a value from a restricted set. Is there a way in QGIS to explode the layer into multiple layers, one for each value for the type ...
Steve Bennett's user avatar
0 votes
1 answer
145 views

Select Features by polygon colour

I am using QGIS V3.22.6. I have imported a set of polygons digitised in Google Earth. They all have the same name but have different polygon colours. I would like to rename these according to their ...
Norman's user avatar
  • 61
-2 votes
1 answer
75 views

ArcGIS SelectLayerByAttribute is not working

I have the following script: Area_f = input_folder + "\\Area_f.shp" Area_f_layer = "Area_f_layer" fld_objekt_nr = "OBJEKT_NR" arcpy.AddField_management(Area_f_layer, ...
Nanad's user avatar
  • 1
0 votes
1 answer
273 views

Select multiple features from multiple layers in QGIS

I am analysing land use across multiple region. Each region has its own vector dataset. Each dataset contains the same columns and land use classifications (e.g. 'AC66' or 'TC01'), describing units of ...
Nick Primmer's user avatar
0 votes
1 answer
167 views

Select by attribute and location within a for loop? [closed]

I have dozens of feature classes in a project geodatabase. I have the code that will identify all the misplaced wells in each dataset, but for the life of me I can't figure out how to get the lines of ...
redleg_64's user avatar
0 votes
1 answer
51 views

Python Script - SelectLayerByAttribute 'Invalid Expression' Error Message

I am fine tuning a 'snap by attribute' python script. It takes points in one layer and snaps them to points in another layer based on unique attribute. I keep running into an 'invalid expression' ...
Nicholas Kunkel's user avatar
1 vote
0 answers
456 views

Using select by attributes in ArcGIS Pro ModelBuilder

Summary of my problem: When I use the select by attributes option directly from the attribute table, my query works perfectly, however, if I run the exact same query from the ModelBuilder. It doesn't ...
Lau's user avatar
  • 11
3 votes
2 answers
388 views

Selecting features and create new field with QGIS Field Calculator

For example, Column A (1, Michigan Street, Michigan), Column B (Michigan Street) and Column C (Yes, No). I want to use Field Calculator to update Column C in a way that it return NO if Column A ...
Irfan Zahid's user avatar
3 votes
1 answer
483 views

Selecting features with values whose difference is greater than 20 in QGIS

I have a LineString layer and it's attribute table has two different fields. I want to select all features with a difference of more than 20 between both fields.
Barrylim_work's user avatar
1 vote
1 answer
416 views

How to select multiple values (features) in separate columns (QGIS) [closed]

Two parts to this question. Part 1 I'm trying to select by expression all rows (features) that have a particular value across multiple columns. So, for example, I want to select all features that have ...
greyhug's user avatar
  • 77
0 votes
1 answer
226 views

Arcpy.CopyFeatures_management creates empty feature class

I am trying to iteratively copy selection layers to new feature classes. My script successfully creates the new feature classes, but they are empty. Can anyone point out what I'm doing wrong? arcpy....
GreggUnited's user avatar
0 votes
1 answer
179 views

Select points within a polygon based on attribute value within polygon and point attribute values

I have a two datasets - a polygon dataset of buffers around a point and a point dataset. The polygon dataset has an elevation value (assigned from the point on which the buffer was created) and each ...
DanaAllen's user avatar
1 vote
1 answer
230 views

Changing attribute values of selected features using PyQGIS

I am selecting the features by "Property_T" and its attribute is 'Open Land' and I want to add some attribute to "SS" field for same record. What is wrong? from PyQt5.QtCore import ...
Srikanth Talla's user avatar
0 votes
1 answer
335 views

Expected field not found using SearchCursor and SelectLayerByAttribute tools in ArcPy ArcGIS Pro 3.0.0

ArcGIS Pro 3.0.0 - using ArcPy First, I'm very new to coding with Python, so there may be a few mistakes in my code that I am not catching. I'm trying to select each row in a table (line feature class)...
Cass_789's user avatar
1 vote
2 answers
736 views

Selecting points based on mutual distance and same attribute value using ArcGIS Pro

I have a layer of many points. From those, I need to select only those, that meet condition of having atleast two other points, in specified distance (lets say for example 100 meters) but where these ...
Martin's user avatar
  • 13
1 vote
0 answers
111 views

How to select distinct points in an attribute table with multiple duplicates in arcgis pro?

I have an attribute table with 400+ values of chemical sampling results associated with ~100 different testing sites. Each sampling site has 2-10 result values associated with it. The points are ...
Madsp's user avatar
  • 11
0 votes
1 answer
164 views

Select Layer By Attribute_management not taking variable

I am trying to make SelectLayerByAttribute_management to take a string (that is an input variable) as the "where_clause". The string would be inputted by the user. If I just put the text I ...
Fuscus's user avatar
  • 9
0 votes
1 answer
234 views

Where-clause based on attribute value in ArcPy

I am trying to create a Python toolbox which will iterate through selected features and create a statistics table for each selected feature. It works as follow: Define parameters, including the input ...
Juliette Lapeyre's user avatar
0 votes
1 answer
53 views

Using select by attributes across mutliple layers in ArcMap

I am using ArcMap 10.8.2. I'm working on a GIS update for a local municipality. They've asked that I only send them back data that I've added or changed. It seems the easiest way for me to do this ...
Elmojo's user avatar
  • 1
2 votes
1 answer
438 views

AttributeError: 'NoneType' object has no attribute 'selectByExpression'

I get the error: AttributeError: 'NoneType' object has no attribute 'selectByExpression' The first run through the loop is fine but at the second run the error occurs. How do I fix this? import ...
Sander Van Beuningen's user avatar
1 vote
2 answers
84 views

Keep only one nearest OD link (QNEAT)

I've made a distance matrix from one point layer (layer A) to another (layer B) using QNEAT plugin (QGIS Network Analysis Toolbox 3). I got a web with links from every point from A to every point from ...
barney stinson 2's user avatar
-1 votes
1 answer
329 views

Select polygons that contain attribute listed in a separate table

I am using ArcGIS Pro and am trying to select a number of polygons based on a list of postcodes from a standalone table. I am using the Code-Point Polygon Dataset for the entirety of England, and I am ...
Josh's user avatar
  • 1
0 votes
2 answers
198 views

How to create custom tool via Python that selects by attribute, then outputs new feature classes

I am trying to create a custom tool via python script that selects features in multiple fc's within a feature dataset that are missing values, then from the selected features, creates two outputs: one ...
matthiastrek's user avatar
0 votes
1 answer
239 views

Select points by number of unique values by group - ArcGIS Pro

Similar to this question, I have two datasets that consist of points and polygons, where all the points are inside the polygons. The polygon IDs (called cluster IDs) were previously joined with the ...
KatieGeo's user avatar
0 votes
1 answer
1k views

Select and save as shapefile feature in R using sf

How can I select the shapefile feature there is, "D3" in "New.Code" columns using sf packages in R Here is the attribute table of my shapefile:
Damar Panoto's user avatar

1
2 3 4 5
13