Knowledge Types- Area

There are two types of local area knowledge queries available:

  1. On a continuous dataset such as a postcode map where you are certain to always get a response.
  2. On discrete data for example if you want to know whether the current location is either ‘in’ or ‘out’ of a defined area feature.

Examples

  • What ward am I in?
  • Am I in a SSSI?
  • Is this a neighbourhood watch area?
  • Is this risk on a flood plain or subsidence area?

Operation

At this location, which polygons do I intersect?

Returns

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

Properties

WML::Knowledge_Type$
value: area

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 property:

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

For more detail within the results, choose the Map Tip inside Schema. This displays the schema attributes you have chosen.

In this example, only the attributes DESCRIPTIO, HECTARES and NAME will be displayed.

Creating a Template for an Area Search

Templates are different depending on the search type and are defined in the webMapLayersConfig.db using HTML.

To create a template open the database in your SQLite database manager, navigate to the Templates table and add a new record with a name that corresponds to the overlay name in the SWD.

The information returned is defined by the HTML, in the schema above MapTips were ticked for DESCRIPTIO, HECTARES and NAME. These can be referenced with the following notations:

  • {Items[0].Attributes[DESCRIPTIO]}
  • {Items[0].Attributes[HECTARES]}
  • {Items[0].Attributes[NAME]}

For example if the coordinates used in the Local Knowledge search falls within the polygon with the attributes shown in the Schema table, it would result in the following returned results:

Discrete dataset worked example: Am I in a green belt zone?

To know if the current location is either ‘in’ or ‘out’ of a defined area, you can still use the area search, but need to set up two templates; one which is displayed if you are ‘in’ the feature and another which is displayed if you are ‘out’ of the feature.

The map of Green Belt land in the UK only covers certain areas.

To check if you are in Green Belt zone, add the property WML::Knowledge_Type$ to the overlay containing the greenbelt data.

This defines the layer to be used for an area search: These HTML templates can display if the search point is in or out of a green belt:

  1. <div>You are currently <b>in</b> a Green Belt zone.</div> </br>
  2. <div>You are currently <b>not in</b> a Green Belt zone.</div> </br>

If you wish to include attributes, these can be added as part of the Template.

Once the templates have been added to the Templates table of the webMapLayersConfig.db, note the Template ID and in the LayerTemplates table define the “you are currently in a Green Belt zone” template as The Summary Template and the “you are not currently in a Green Belt zone” template as the Nothing Found Template.

The resulting templates will be displayed as so on the Cadcorp SIS WebMap site:

Note: The coloured boxes are used to display which result the template is referring to, they will not be created by the template and will not appear on the Cadcorp SIS WebMap site.