Local Knowledge Types- Nearest N

Examples

  • What are my three closest residential properties?
  • Which are my five closest schools

Operation

From this location find the nearest N items

Returns

The attributes (schema columns) of the found items that have the MapTip option enabled.

Properties

WML::Knowledge_Type$ value: nearestN

WML::Knowledge_nltems&

Optional Properties

WML::Knowledge_Filter$

Adding a property

In your Local Knowledge SWD, right click on the overlay you wish to add the property to and select Properties:

Select Properties again in the Overlays dialog:

Select Add… to add a new attribute:

Add this attribute to the layers you want to query for nearestN.

  • Click OK
  • Now add the number of items you want to return in your search
  • Select the Properties… button
  • Select Add
  • 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. Related Topics Link IconRelated Topics

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.