Displaying only selected features on map in QGIS?

Kadeem's answer will prevent your features from being visible, but they will still be present, if you are trying to identify an individual ship track you may click an invisible feature by mistake. What it seems like you need to do is define your layer so that it's as if those features don't exist. In ArcGIS this would usually be done using a Definition Query, in QGIS the equivalent command is the Layer Subset. Go to the Properties of your layer, under the General tab, at the bottom is the Feature Subset box, click the button below it to bring up the Query Builder:

enter image description here

The Query Builder will help you create an SQL query to define what features in your layer should actually be displayed in your project. Any features not returned by the query are made invisible, not just visually but entirely (they are not deleted from your data, of course, they're just defined out of existence until you remove the Layer Subset query).


This is now possible using just selections and a rule-based symbology.

This requires the Expression Plus plugin (for QGIS 2.x. 3.0 has the functionality built in).

Create a rule based symbology with the filter of:

QGIS 3.0+ (from thequerist in the comments):

is_selected()

QGIS 2.12-2.18:

isselected( @layer_name )

Or QGIS 2.8:

isselected( 'ACTUAL_NAME_OF_LAYER' )

Now only the selected features that meet this rule will be shown.

You can also have an ELSE rule for all unselected features.

enter image description here


Kristina, I assume there is an attribute in your table which allows you to identify a single track? For example:

  point_id  |  track_id
------------+------------
     1      |     15
     2      |     15
     5      |     24
     6      |     24
     7      |     24

If you open the attribute table, you can find an epsilon symbol (in the figure below, the 4th one).

enter image description here

This allows you to type an expression; for example:

"track_id" = 24

When you confirm, all rows that satisfy your expression (that is: all points that belong to the track with track_id X) are selected. If you then click on the magnifier button, QGIS zooms to your selection in the map canvas. The selected features (points in your case) are highlighted.


What you can do is to apply a rule-based style. As such you can show an individual ship track using a given symbol or marker, and 'not show' all other points by giving them an 'unvisible' marker. The screenshot (part from Layer Properties) below explains how it works:

  • Rule 1: apply the given marker to all points having a value of 24 for track_id
  • Rule 2: apply the given marker (a circle with white fill and white border...) to all points that do not satisfy a track_id value of 24

enter image description here

In fact all points are still there (making them white will not make the rendering taking less time) but at least your eyes can relax!