2

I used QGis to open a shapefile with the rivers in my state (Rio Grande do Sul, Brazil).

I would like to know "the name of every river", but when I click on the rivers, most of the small ones don't have a name. Clicking them one by one would be monotonous, error-prone, and cumbersome.

So, my question is: How can I filter the display of rivers, so that only the ones containing a name would be displayed?

Disclaimer: I have no large experience with GIS concepts. I presume this is a trivial task, but I don't even know where to start figuring out how to do it.

enter image description here

1
  • Are the names for the unnamed features empty ('') or null? This depends on your data. Dec 9, 2014 at 21:39

2 Answers 2

5
  1. Right-click your layer in the table of contents. Choose Filter...
  2. Enter a valid SQL statement (see here for more) that excludes the rivers with no name, such as: "NOME" is not NULL
2
  • You nailed it, thanks! As a side question, what you suggest me to add another filter by bounding box? Dec 9, 2014 at 21:47
  • That depends on your data source. Some support ST_WITHIN() but most don't. Dec 9, 2014 at 21:49
3

To reduce the layer to only the features that you're interested in you need to feature subset by a definition query. You can access that from the layer properties:

enter image description here

Which opens the Dialog: enter image description here

You can select fields from the top, left to construct the query from and see values in the right,top (double click to include in the query) or write the query itself.

Depending on your data queries may look like:

NOME IS NOT NULL 
NOME <> ''

You will need to review the table of the layer to see if the unnamed are NULL or empty cells.

2
  • The answer from Phloem worked for me. Anyway, your answer was very helpful, thank you! Dec 9, 2014 at 22:45
  • 1
    You're welcome. We said the same thing at the same time but Pholem beat me as I was uploading pictures... at least we're consistent. Another tip that may help is the 'IN' operator: NOME IN ('name1', 'name2', 'name3') is more convenient than individual NOME = 'NAME' statements. If you're only interested in a few rivers that may help. Dec 9, 2014 at 22:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.