Hot answers tagged

53 votes
Accepted

Filtering features in other layers of QGIS Atlas

Indeed, you need to use rule-based symbology to achieve what you want. You need to create a rule for what you want to show, and ELSE rule for all others. In the ELSE rule, deselect the symbol ...
user avatar
35 votes
Accepted

What is the difference between != NULL and IS NOT NULL in QGIS filter expressions?

Disclaimer: Because the syntax for filtering in QGIS works with SQL, I'm assuming here that SQL rules apply. I'm not completely sure if that's entirely correct, but it seems logical and it does ...
user avatar
  • 2,261
24 votes

What is the difference between != NULL and IS NOT NULL in QGIS filter expressions?

NULL is not a value, therefore it cannot equal = or not equal != anything. It is not the same as zero 0 which is a value. A NULL indicates that no value has been recorded in the cell you are looking ...
user avatar
  • 29.2k
15 votes
Accepted

Filtering layers in QGIS atlas

You can use the tbl_metadata file as coverage layer in Atlas. Then use rule-based symbology with @layer_name = @atlas_pagename. I assume that your data looks like this (the attribute table is ...
user avatar
  • 6,427
14 votes
Accepted

How to apply a filter to multiple vector layers in QGIS?

This is how I'd do it with PyQGIS: In your QGIS ToC, turn off those layers that you want to keep untouched, i.e., leave visible only the layers you want to set the filter to. Now open a QGIS Python ...
user avatar
14 votes
Accepted

QGIS query syntax differs between attribute table and feature filter

Your observation is correct, The Query Builder does not use the same syntax as the rest of QGIS. Throughout QGIS, the syntax is based on QGIS Expressions a customized SQL dialect. This is portable ...
user avatar
13 votes
Accepted

Filtering Overpass-API by country

Using Overpass turbo, the syntax is: area["name"="Nordrhein-Westfalen"]->.boundaryarea; ( nwr(area.boundaryarea)[amenity=bank]; ); out meta; nwr is a short for node-way-relation
user avatar
  • 74.9k
12 votes

how to visualize csv data every 10 rows in QGIS

Assuming you don't have a unique id field, you can use rule based symbols with the following filter $id % 10 = 1 The % sign is equivalent to remainder, so any row that divides by 10 with a ...
user avatar
  • 8,162
11 votes

QGIS using project variables in filter queries

Layer filters don't use QGIS expressions, and are instead handed directly off to the underlying data provider. So, for instance, a filter on a postgis layer is passed to postgres to evaluate, and ...
user avatar
  • 26.2k
10 votes

Filtering out canopies and buildings from DSM to have a bare earth elevation

If you have a raster DEM already, then there is a tool that I developed in Whitebox Geospatial Analysis Tools called Remove Off-Terrain Objects, contained within the LiDAR toolbox, that works well for ...
user avatar
  • 10.8k
9 votes

QGIS filter on date value

I was able to filter using "START_DATE" > '2001-01-01' (double quote for Fields and single quote for Variable are important) if I opened the attribute table and used select by expression, but the ...
user avatar
  • 1,472
8 votes
Accepted

WFS Intersect Filter using a Polygon returns all features in Layer

Try with intersects: <ogc:Intersects> ... </ogc:Intersects>
user avatar
  • 2,135
8 votes
Accepted

Google earth engine: filter a FeatureCollection by system id

This is tricky, as there are actually two issues: It's called system:index even though the UI shows it as id. The id is a string, rather than an integer So the correct way to do this is: print(FC....
user avatar
  • 1,693
8 votes
Accepted

Filter GeoJSON by attribute in Leaflet using a button

You need to create a grouplayer and from that you can add or remove the layer, in that way refreshing the data with the filter from the same dataset. Here are two working examples: the first using ...
user avatar
8 votes
Accepted

Multiple date filter Google Earth Engine

Your Code These lines don't seem to work out: var dateFilter = ee.ImageCollection(longRain2016.merge(shortRain2016).merge(longRain2017).merge(shortRain2017).merge(longRain2018)); var s2dateFilter = ...
user avatar
8 votes
Accepted

Filtering earth engine image collection by image ID

Alright, I figured it out. Filtering can be done using the image properties (you can see what properties are available by searching for the product in the search bar). In this case, NASA's NEX-DCP30 ...
user avatar
  • 2,008
8 votes

Filtering by geometry type in GeoPandas

Using geometry.type=="MULTIPOLYGON" is (15 times in my computer) faster. at_geometries[at_geometries.geometry.type=="MULTIPOLYGON"]`
user avatar
8 votes
Accepted

Filtering by geometry type in GeoPandas

There are many solutions (see How to filter a geodataframe by geometry type? for example) With .loc as you but with geometry.type or geom_type gdf0 = gdf.loc[gdf.geometry.geometry.type=='MultiPolygon']...
user avatar
  • 50.7k
8 votes
Accepted

Displaying only visible in canvas features in attribute table using PyQGIS

I dont know what can be done in plugins and not, but in QGIS you can apply a filter: layer = iface.activeLayer() mapcanvas = iface.mapCanvas() rect = mapcanvas.extent() request = QgsFeatureRequest()....
user avatar
  • 51k
7 votes

Filtering Overpass-API by country

The Quick OSM plugin for QGIS generates the following working Overpass query: <osm-script output="xml" timeout="200"> <id-query {{nominatimArea:Austria}} into="area"/> <union> ...
user avatar
  • 81.8k
7 votes

WFS Intersect Filter using a Polygon returns all features in Layer

You are using WFS 1.0.0. That WFS version is using Filter Encoding Standard 1.0.0 http://portal.opengeospatial.org/files/?artifact_id=1171 and there is indeed a typo in the standard. On page 17 the ...
user avatar
  • 51.4k
7 votes
Accepted

Aggregating with attribute($currentfeature) filter in QGIS

It turns out that the filter you are passing to the aggregate function always returns True for any feature. "Field2" = attribute( $currentfeature, 'Field2') In other words, what you have at the ...
user avatar
7 votes

How to filter image collection by date, excluding a date from a date range in Google Earth Engine

You can remove images from an image collection by creating a date filter for the 'bad/missing' data and then remove it using ee.Filter.not(). For example: var collection = ee.ImageCollection('NCEP_RE/...
user avatar
7 votes
Accepted

Filter a GeoPandas dataframe for points within a specific country

Did you see More Efficient Spatial join in Python without QGIS, ArcGIS, PostGIS, etc and other answers on GIS SE ? Simply import geopandas as gpd world = gpd.read_file(gpd.datasets.get_path('...
user avatar
  • 50.7k
7 votes
Accepted

Count values from another layer based on value of current feature

What I ended up doing: Layer > Create Layer > New Virtual Layer… Import rid CSV layer. Set query as select "State", count(*) AS “TERPS” from rid group by "State". Click 'Add'. This creates a virtual ...
user avatar
  • 240
7 votes
Accepted

Filtering rows by letter QGIS

In QGIS text strings are enclosed in single quotes (') while double quotes (") are for field names, so your expression should be: "areakm2" > 80000 AND left("NAME", 1)='A'
user avatar
  • 11.7k
7 votes
Accepted

QGIS - Is it possible to filter records by the current date?

It is important to know, that The filter is made at the data provider (OGR, PostgreSQL, MSSQL…) level. So the syntax depends on the data provider (DateTime is for instance not supported for the ESRI ...
user avatar
  • 24.5k
7 votes

QGIS - Is it possible to filter records by the current date?

You just need to use the proper syntax, as geopackage are based on sqlite database you need to use the sqlite fonction and syntax on your filter. The proper syntax (for getting date before today) ...
user avatar
  • 11.7k
6 votes
Accepted

QGIS Filters and Queries

Use "LIKE" with percentages. In my shapefile of countries I can select any country with a name like "This and that" with: "CNTRY_NAME" LIKE '% and %' this selects only "Bosnia and Herzegovina". If ...
user avatar
  • 51k
6 votes
Accepted

WFS 2.0 with bbox filter and attribute filter

First of all you can't use both BBOX and FILTER in key value pair formatted GET request. In the WFS standard version 1.1.1 it is written as "BBOX (Prerequisite: TYPENAME) (Mutually exclusive with ...
user avatar
  • 51.4k

Only top scored, non community-wiki answers of a minimum length are eligible