Questions tagged [select-by-expression]
The select-by-expression tag has no usage guidance.
48
questions
1
vote
1
answer
55
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 ...
0
votes
1
answer
27
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 ...
2
votes
1
answer
93
views
Selecting layer by expression with two variables using PyQGIS
I would like to filter a column coming from a layer with the command layer.selectByExpression().
I would like to leave the name of the column as a variable (not fixed). I made a conditions inside the ...
0
votes
1
answer
43
views
QGIS: select multiples attributes which contains different words using select by expression
I would like to select multiple attributes which contains some specific text ("Bus", "Car", and "Motorbike") from the same field ("commodity") using Select by ...
3
votes
2
answers
101
views
QGIS: Select feature using SQL with highest value for attribute, grouped by another attribute
I have a relatively small attribute table that includes a column where data (parameter 1) is identical across several rows. I would like to select only the row with the highest parameter 2 based on ...
1
vote
1
answer
163
views
How do I select features with the same values but different IDs from a layer's attribute table in QGIS?
I have a multipolygon layer with several regions (green circles) that are identified through numerical fids. Within each region are multiple points (orange dots) with individual pointIDs. See example ...
3
votes
1
answer
177
views
Delete any polygon that overlaps polygons on another layer in QGIS
I'm new to GIS software and I couldn't find an answer here for QGIS specifically.
I have layer A with a few thousand polygons that have the attribute "Field". I have layer B which is a ...
1
vote
1
answer
88
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 ...
2
votes
1
answer
266
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 ( '...
4
votes
2
answers
279
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 ...
5
votes
2
answers
344
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 (...
3
votes
1
answer
156
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.
5
votes
3
answers
1k
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 ...
4
votes
2
answers
441
views
Selecting features containing specific text string using an expression in PyQGIS
I'm trying to select features with a specific text that I have in an attribute. I used the expressions from the PyQGIS Cookbook but I'm having trouble with the selection because the functions I'm ...
6
votes
1
answer
334
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?...
2
votes
2
answers
215
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
300
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 ...
3
votes
1
answer
585
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?
5
votes
2
answers
298
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 ...
7
votes
1
answer
551
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
160
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 ...
7
votes
3
answers
1k
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,...
0
votes
1
answer
32
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
0
answers
40
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 ...
2
votes
0
answers
110
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":"...
10
votes
1
answer
174
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
"...
1
vote
1
answer
146
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 ...
4
votes
1
answer
85
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 ...
0
votes
0
answers
62
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
1
answer
199
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 ...
4
votes
1
answer
85
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" ...
3
votes
1
answer
353
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?
-1
votes
1
answer
249
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 ...
1
vote
1
answer
200
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 ...
2
votes
1
answer
78
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 ...
3
votes
1
answer
444
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", ...
2
votes
1
answer
180
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 = ...
4
votes
2
answers
144
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&...
0
votes
0
answers
174
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 ...
2
votes
1
answer
144
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
2
answers
508
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.
...
1
vote
1
answer
285
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 ...
7
votes
2
answers
168
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 ...
3
votes
2
answers
2k
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
108
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
1
answer
663
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 ...
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 ...
4
votes
2
answers
2k
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.