Local Knowledge Types- Nearest N
The NearestN local knowledge query will find the N amount of features closest to the WebMap user’s location.
Adding a property
In your Local Knowledge SWD, right click on the overlay you wish to add the property to and select Properties
Then select Properties again in the Overlays dialog:
And finally select Add… to add a new attribute:
Add this attribute to the layers you want to query for nearestN and click OK.
Add property to set number of features
An additional overlay property can be added to set the number of features to be displayed.
- Follow the steps as above to add a new attribute.
- In the New Attribute dialog, type WML::Knowledge_nItems& into the Name field.
- Type the number (e.g. 5) into the Value field.
- Click OK.
NearestN worked example: Which are my 5 nearest supermarkets?
Add this property to the layers you want to query for nearestN.
Optional Filter Property
The property WML::Knowledge_Filter$ applies a filter to the returned results. If for example you are querying on a dataset of supermarkets and these are the results displayed:
You could use the filter to return the 5 nearest Tescos by setting the property WML::Knowledge_Filter$ with the value SUPERMARKE$="Tesco"
To apply this filter to other queries, use the following formula as a guide: ColumnExpressionRelationalOperator”value”
You must use the column expression NOT the column name.
Note: The format of the column name expression can be found below the Schema listing in the Overlays dialog.