Questions tagged [select-by-expression]
The select-by-expression tag has no usage guidance.
40
questions
10
votes
1
answer
156
views
Selecting NULL or date values by Expression in QGIS
How can I select by expression from a date field in a shapefile, dates that are NULL or >= 2020-01-01?
This doesn't work, it only selects those with dates >= 2020-01-01, not the NULLs
"...
7
votes
3
answers
668
views
Selecting multiple features by ID-attribute from list using PyQGIS
With PyQGIS I would like to use several "ID"s (in a list) to select certain objects in order to make them available later in a temporary layer. I know how to select one or a few more objects,...
7
votes
2
answers
129
views
Analysing point attributes within polygons
I'm using QGIS 3.4.4.
I have a polygon layer and a points layer. The points have the attributes district and streetname.
How can a check if all the points within a polygon have the same district and ...
6
votes
1
answer
135
views
Selecting features that do not touch other features in same layer in QGIS
In QGIS I have a polygon layer where there are some isolated objects which do not touch other objects in the same layer. They are isolated and therefore I do not need them.
How can I select these ones?...
6
votes
1
answer
203
views
Selecting features visible in map extent using QGIS
In QGIS, I'm trying to select all the features that are visible in my map extent but I can't find a solution with "select by expression" or something else.
I will use your tips inside ...
6
votes
1
answer
105
views
QGIS expression not working as expected: selecting nearest neighboring points of a selected point
The problem
In QGIS 3.20.0 (Win 10), I have an expression that does not work as expected and I don't understand why. On a point layer, one point is selected. When using Select by expression, the ...
5
votes
3
answers
311
views
QGIS Select points within ONE polygon in a different layer
I have a set of points, which are located in the same area where the other, polygon layer is located.
I would like to have all the points selected, but ONLY within the one polygon belonging to the ...
5
votes
2
answers
171
views
Displaying only visible in canvas features in attribute table using PyQGIS
As explained by @xunilk in Getting attribute values from vector features visible in QGIS canvas using PyQGIS we can easily access to the attribute values of the features visible in the QGIS canvas (...
5
votes
2
answers
170
views
Selecting only polygons that contain another polygon with Select by Location in QGIS
In QGIS 3.16.11 on Windows 10 I have a layer with single polygons.
Given this polygon layer with, I'm trying to select only the polygons that that contain at least one other polygon (A & B)
My ...
4
votes
2
answers
134
views
Selecting values of variable in attribute table which contains specific character in QGIS
I have a shapefile of a grid cell. I would like to select all the observations (cells) whose values in column "mean" is not an entire number. I was thinking to do it selecting all the ...
4
votes
2
answers
101
views
Selecting features whose text is equal to the text after certain word in QGIS
I have origin-destination lines and I'm looking for intra-city lines or lines whose origin and destination are in the same city.
A sample intra-city feature would be "Quezon_City to Quezon_City&...
4
votes
2
answers
1k
views
Selecting from selection with PyQGIS
The expression box has a handy "select from selection" button. Is there a way to emulate this with Python? I have the basic expressions down, but can't find a way to do this.
4
votes
1
answer
68
views
Selecting by attributes on features sharing common value
I have a point vector with features sharing non-unique "ID"s. Each feature also has a "distance" field. I want to select among each set of features sharing the same "ID" ...
4
votes
1
answer
65
views
Automate the selection of duplicate geometries with QGIS3
I have a layer of buffers calculated from watercourses. Each watercourse/buffer has a Strahler Order (0 to 7).
I need to delete overlaps between buffers order 0 and buffers order 1 to start, but ...
3
votes
1
answer
394
views
Showing string that contains specific number in QGIS
How to show all the strings that contain '841' on this layer?
I tried to use "NAME" LIKE '841' but somehow it did not just show "841_1Q" and "841_1", instead it still ...
3
votes
1
answer
225
views
Select features from the attributes table without opening it in QGIS
I have an attribute table with a vast amount of data in QGIS. I need to export only some of the features. Is there any way to select features without opening the attributes table?
3
votes
1
answer
101
views
QGIS increase number of recent selections
is there any possibilty to increase the number of recent selections in the menu select by expression?
I can´t store more than 20 selections. If I create a new selection, the oldest selection is ...
3
votes
2
answers
1k
views
Selecting more features with "ILIKE" and "IN" operators using QGIS
I would like to select more features with expression in a specific field, which contains the name of the attribute (IN operator is useful). Moreover, the name could not be exact, so the ILIKE operator ...
3
votes
1
answer
69
views
Selecting first row for group using select by expression
How would/could I use the select by expression tool to select only the first row for each origin_id group? The rows with a yellow border are the ones I want selected.
3
votes
1
answer
257
views
Selecting multiple rows in feature based on contents of list using PyQGIS
I am trying to select rows in a feature layer in QGIS based on the values in a list. I am using PyQGIS in the python console
If I just specify one item to find in a column called "gps_code", ...
3
votes
1
answer
203
views
QGIS: Select polygons that are touching another polygon on all it's sides (not contain but engulfed?)
Given this polygon:
I'm trying to select the inner one, but can't find a simple way using either selection by location or selection by expression
Any idea?
2
votes
1
answer
73
views
Problem selecting features with % operator
I am having problem to select contours with the following expression:
"ELEV" % 0.05=0
As I understand this should select any contour that the remainder of the division by .05 is 0.
For ...
2
votes
1
answer
159
views
Python script to set another layer inactive & select point by outside of boundary line?
I have two layers, "IDN_ALL" as Polygon and "Point_Link" as point.
"Point_Link" is the active layer. I want to select point data outside polygon data.
Code:
Layer1 = ...
2
votes
1
answer
39
views
QGIS Expression with multiple IS NOT filters
I would like to select features using an expression. I have one field with +-100 different values. I would like to select all values except for two. Something like this:
"FIELD" is NOT ( '...
2
votes
2
answers
265
views
QGIS expression to check if a an attribute value of a feature exist in another attribute column
I have a shapefile with two fields 'Name' and 'CountyFacilityID'. I would like to create an expression to select all features where Name exists in the CountyFacilityID column for any of the features.
...
2
votes
2
answers
81
views
QGIS select by expression based on different elements concatenated inside a string
Using the field filter or advanced filter expression in the attribute table of QGIS, I want to select features that have values in the first three levels and exclude features that values other than ...
2
votes
1
answer
134
views
Using "Select by expression" in processing script context with PyQGIS
Is there a way to select features and use them in subsequent algorithms within a processing script context?
I am looking to iteratively selectbyexpression a subset of line features in a layer based on ...
2
votes
1
answer
65
views
Select by expression based on common ID
Background
I need to select features (parcels) from an official source based on a list with no geometries provided by a client. Both data sets have a common, unique ID (parcel number). There are about ...
2
votes
0
answers
57
views
Iterate through list with numbers (as text)
I want to iterate through a list of coordinates and see it the last coordinate matches the first coordinate. The coordinates are stored in have a GeoJSON string:
'''{"type":"...
2
votes
0
answers
1k
views
Select by expression only for selected features using PyQGIS [duplicate]
I'm facing a nested problem using PyQGIS (for QGIS master, but it can be replicated in any version of QGIS 2).
I have a vector layer with some selected features and with a QgsFeatureRequest I can ...
1
vote
1
answer
61
views
Deleting lines crossing particular features from another layer using QGIS
I have two QGIS layers. Layer 1 has a floor plan with an attribute field holding feature types, e.g., wall, corridor etc. Layer 2 consists only the lines drawn between door centroids. I want to query ...
1
vote
1
answer
121
views
Is there a way to sort the QGIS attribute table by date modified?
I was wondering if there was a way to sort the attribute table in QGIS Pi by date modified. I have been digitizing a large area and I need to delete the last 50-100 features that were digitized. My ...
1
vote
1
answer
27
views
QGIS Print Layout expression for selected features in project
I have a selected feature in the project that is symbolised differently. I can see it in the print layout, but the is_selected expression returns a false. I need to label only this feature in a text ...
1
vote
1
answer
195
views
Create new shapefile for each unique attribute using for-loop with PyQGIS?
I have a roads shapefile. In its name field, I'll create a new shapefile per attribute. I already got each unique attribute under name. The for-loop that iterates over the unique attributes and ...
0
votes
1
answer
31
views
Selecting records having special char record
I am trying to select all records which have special char (I'm not mention any specific special char)
Like below:
ADDRESS_N LIKE '%Ö%' or
ADDRESS_N LIKE '%Ü%' or
ADDRESS_N LIKE '%ß%' or
ADDRESS_N ...
0
votes
1
answer
119
views
Select and list all the adjacent features of a feature in ArcGIS
I have a shapefile of the Zips of California like the attached image. What I want is to select the adjacent/neighboring polygons (those touch the boundary) of each polygon in ArcMap and want to create ...
0
votes
0
answers
36
views
Iterate a feature by expression with unique values in PyQGIS [duplicate]
Im trying to automate the process of select by expression and afterwards export it to a new layer in Qgis using Python. The Layer I'm using is called "Brutvoegel" and my goal is to get all ...
0
votes
0
answers
29
views
How to performing selection by expression using QGIS
I am using QGIS 3.8.
I have a grid (hexagon) and a set of points.
I am trying to select the hexagons containing at least 1 point. So far nothing complicated. Except that sometimes my points overlap 2 ...
0
votes
0
answers
119
views
Make Feature Layer / Select / Select Layer By Attribute "Get Unique Values" grayed out in ArcMap ModelBuilder [10.8.1]
I'm trying to extract road segments from a feature class through ModelBuilder in ArcMap 10.8.1 based on attribute queries, but the "Get Unique Values" button does not pull up a list of ...
-1
votes
1
answer
129
views
Selecting a specific number of features in QGIS [duplicate]
I have a layer with several fields on its table and one of these fields is "population". Is there a way to select only the top 3 features with the highest population?
I imagine I need to ...