Step-by-step instructions on how to add attribute filters to recipes in your OS Select+Build Recipe Library.
Introducing attribute filtering
Attribute filtering is a new concept which we have introduced as part of OS Select+Build. The filters can help you to narrow down the exact data you need from the OS NGD. If required, you can add attribute filters to individual feature types when you create a new bespoke recipe of OS NGD data using OS Select+Build. The managing OS Select+Build recipes page has step-by-step instructions on how to create a new recipe. You can also add, edit or remove attribute filters to / in / from feature types in an existing recipe of OS NGD data.
Attribute filtering is an optional step for those with advanced OS data knowledge.
You can:
Add attribute filters to feature types in a new recipe
Add, edit or remove attribute filters to / in / from feature types in an existing recipe
The following sub-sections cover:
Adding filters to a new recipe
Adding filters to an existing recipe
Creating a simple filter (worked example)
Creating a more complex nested filter (worked example)
Checking if filters are used in an existing recipe
How do I add attribute filters to a new recipe?
YouTube video showing how to add attribute filters to a new recipe in OS Select+Build.
Click Login on the OS Data Hub menu bar to log into your account.
Screenshot showing the OS Data Hub homepage.
2
Navigate to the OS Data Hub workspace
Select Data from the menu bar to view your workspace.
3
Navigate to the OS Select+Build Recipe Library
Choose Downloads > OS Select+Build Recipe Library from the left hand side secondary navigation menu. You will then be taken to your organisation's OS Select+Build Recipe Library.
Screenshot of the OS Select+Build Recipe Library screen in the OS Data Hub.
4
Create a recipe
Click the Create a new recipe button, adding the relevant details to your recipe.
Click Login on the OS Data Hub menu bar to log into your account.
2
Navigate to the OS Data Hub workspace
Select Data from the menu bar to view your workspace.
3
Navigate to the OS Select+Build Recipe Library
4
Find the recipe you want to edit
In your OS NGD Select+Build Recipe Library, scroll or search for the recipe you would like to edit. Once you've found the recipe, click on its name; you'll be taken to the Recipe details screen.
5
Edit the recipe
In the Recipe details screen, click on the Recipe actions dropdown and select Edit recipe.
Screenshot of the OS Select+Build Recipe details screen with the Recipe actions dropdown open, showing where you can share, edit or delete a recipe.
You'll now be able to add filters (see Step 6) or remove filters (see Step 7) from feature types in the recipe.
6
Add a filter to a feature type
Click the filter icon next to the feature type you want to add a filter to in the selection tree for the recipe.
The Advanced Filter Options panel will then slide into view from the right and you can begin to build your filter(s):
For a more complex nested filter, select +Add group.
Once you have added all of your relevant filters, click Apply Filter.
Screenshot of the OS Select+Build Recipe Edit recipe screen with the Advanced Filter Options panel showing, where you can add a filter to a recipe.
Select Save changes.
Add a description of the change you have made, then select Save changes.
7
Remove a filter from a feature type
Click the Edit filter iconnext to the feature type you want to remove a filter from in the selection tree for the recipe.
When the Advanced Filter Options panel slides into view from the right, select Clear all filters.
Screenshot of the OS Select+Build Recipe Edit recipe screen with the Advanced Filter Options panel showing. There is one filter applied to the Building Part Feature Type.
Select Save changes.
Add a description of the change you have made, then select Save changes.
Worked example of creating a simple filter
In the following worked example of creating a simple filter, we will use the OS NGD Buildings Theme and select the Building Part Feature Type from the Building Features Collection. Our aim is to build a filter to select buildings where education is recorded as the land use.
Select your OS NGD data by choosing the themes, collections and feature types you want to include in your recipe. For this worked example:
Click on the arrow to the right of Buildings within the theme selection tree to see the collections available within the theme, then click on the arrow to the right of Buildings Features to see the feature types available within that collection.
Click on the check box next to Building Part to select that feature type.
Screenshot showing a filter icon against the selected feature type in the theme selection tree in OS Select+Build
6
Add a filter to the Building Part Feature Type where the OS Land Use Tier A attribute is set to Education
Click on the filter icon to the right of Building Part.
The Advanced Filter Options panel will slide into view from the right, where you can begin to build your filter(s):
In the Advanced Filter Options panel, click + Add rule, then select OSLandUseTierA from the first drop-down.
Screenshot of adding a rule in the Advanced Filter Options panel in OS Select+Build.
Leave the operator in the second drop-down as: = (i.e. the equal sign), then select Education from the third drop-down.
Screenshot of adding a rule in the Advanced Filter Options panel in OS Select+Build.
Click the Apply filter button.
7
Finish creating the recipe
Click the Create recipe button. Your new recipe will now instantly be available in your OS Select+Build Recipe Library.
Your filter will return buildings where education (Education) is recorded as the land use (OS Land Use Tier A attribute).
Worked example of creating a nested filter
What if, in addition to the simple filter above (returning results for buildings with a land use of education), we want those results to show only buildings over 15metres in height? What if you also wanted to add an additional filter to show buildings with a land use of rail? To achieve this, you could create a nested filter using the + Add group option.
1
Follow the steps outlined above for creating a simple filter for Building Part until you reach the Advanced Filter Options panel step (Step 6).
2
Add a simple filter to the Building Part Feature Type
In the Advanced Filter Options panel, click + Add group, then select OSLandUseTierA from the first drop-down.
Leave the operator in the second drop-down as: = (i.e. the equal sign), then select Education from the third drop-down.
3
Add a nested filter to the Building Part Feature Type
Click + Add rule to add a second rule below the OSLandUseTierA rule.
In the second rule, select relativeHeightMaximum from the first drop-down, set the operator in the second drop-down as > (i.e. the more than sign), and type 15 in the input box.
Before continuing, select whether you would like the rules within the group to have an And or an Orcondition. In this case, you should select And from the And / Or selector.
Screenshot of creating a nested filer in the Advanced Filter Options panel in OS Select+Build.
Next, click + Add group.
Screenshot of creating a nested filter in the Advanced Filter Options panel in OS Select+Build.
The application has drawn an extra box for you. Whatever rules are contained inside this box will be evaluated together, before combining with any rules outside the box.
Before continuing, select whether you would like the rule in the second group to have an And or an Orcondition.In this case, you should select Or from the And / Or selector.
In the rule in the extra box, select OSLandUseTierA from the first drop-down, leave the operator as = (i.e. the equal sign) in the second drop-down, and select Transport: Rail from the third drop-down.
Click Apply filter.
Screenshot of creating a nested filter with And and Or conditions in the Advanced Filter Options panel in OS Select+Build.
4
Finish creating the recipe
Click the Create recipe button. Your new recipe will now instantly be available in your OS Select+Build Recipe Library.
Your filter will return results for buildings (Building Part) that have either an education (Education) land use if that building is over 15 metres high or a railway land use (Transport:Rail).
How do I check if filters are used in an existing recipe?
To check what filters have been applied to feature types in an existing recipe:
Click Login on the OS Data Hub menu bar to log into your account.
2
Navigate to the OS Data Hub workspace
Select Data from the menu bar to view your workspace.
3
Navigate to the OS Select+Build Recipe Library
4
Find the recipe you want to check for filter presence on
In your OS NGD Select+Build Recipe Library, scroll or search for the recipe you would like to edit. Once you've found the recipe, click on its name; you'll be taken to the Recipe details screen.
5
Check for filter presence
You are now within the Recipe details screen, where you can view detailed information about the recipe, including the recipe's name, the date it was created, etc. If filters have been applied to the recipe, a filter icon(i.e. a black funnel symbol) will appear under the recipe name alongside text stating: 'Filters have been applied to this recipe'.
Click View all filters to view all of the filters that have been applied to feature types in the recipe.
In the example recipe below, you can see that there is a filter icon(i.e. the black funnel symbol) against the Building Part Feature Type; therefore, this feature type has filters applied to it.
Screenshot of the OS Select+Build Recipe details screen, which shows in-depth information about the contents of an example recipe.