I have used a shapefile I've downloaded from ONS for the UK's local authorities. However, I am only interested in certain local authorities in England and want to blank out Scotland and Wales.
How can I do this?
I have used a shapefile I've downloaded from ONS for the UK's local authorities. However, I am only interested in certain local authorities in England and want to blank out Scotland and Wales.
How can I do this?
If you want to hide completely Wales and Scotland, right-click the layer in the table of content -> Properties -> Source (in QGIS 3.4.5) or General (in 2.18) -> Query Builder
, and write the following:
"FieldName" != 'Wales' and "FieldName" != 'Scotland'
Where FieldName is the name that has the names of Wales and Scotland
If you change the color for something else only for Wales and Scotland, then go to Symbology -> select Rules-based and do the following:
The output should something like this, but sure the maps are different:
The objects (polygons) in this ONS Local Authorities dataset do not have a 'Country' attribute. They do however have a 'lad17cd' attribute whose values are eight-digits preceded by a letter, 'E' in the case of English districts.
This means the shapefile can be filtered to include only English districts.
Load the shapefile, right-click on it in the 'layers' panel and select 'Filter..'. Then in the 'Provider specific filter expression' box type (or paste) the following text:
"lad17cd" LIKE 'E%'
and click 'OK'.
This should filter out the Scottish and Welsh polygons leaving just the English ones.
If you want to show the Scottish and Welsh polygons in, say, light grey, load the shapefile again and drag it below the filtered layer in the layers panel, then style it in light grey, or as required.