Back to contents pageHow to create a spatial relationship using Site Manager

How to create a spatial relationship using Site Manager

Summary

This article shows how to create an example spatial relationship between a person and an 'Alarm Zone' using Site Manager.



Prerequisites

You should know the information in the following articles:



Guide

Before you start, remember to:

This guide shows you how to create a spatial relationship that an 'Alarm Zone' contains a person, which you can then monitor using the Ubisense Map.



1) Start Site Manager and create a new role

After completing the basic setup above, find the 'Geometry' tab in Site Manager, and click on the menu item Role > New:



Type the following in the 'New Role' dialogue that appears. This will be the role played by our 'Alarm Zone' object in the relationship:





2) Define the shape of the Alarm Zone

Roles in spatial relationships have shapes that can be absolute, relative to an object, or relative to a type. The Alarm Zone is a fixed area, so click on 'New Absolute' to define its shape. Choose your 'area1' when prompted. Click on the shape editor to define the edges of the Alarm Zone's shape. This example defines the right-hand half of area1 to be the Alarm Zone. Choose the owner of the shape to be the 'Alarm Zone' object you created, with the bottom and top of the shape from 1m below the floor to 3m above the floor as shown:



Save the shape of the Alarm Zone.



3) Define a person's role in the relationship

Create a new role as follows:



This time, the shape is relative to the 'Person' type, so click on the 'New Relative' button on the right-hand side of the screen. This time, you don't choose an area because the shape is relative to a person, so it will move as any person moves around. Add 2 points to create a circle around the person, set the owner to be 'Person', and set the shape to be from the floor to 2m up as follows:



Save this shape.



4) Monitor the relationship

We need to end up with the relationship 'Alarm Zone Role contains Person Role'. You can add this to either role that you have created. The difference is that you need to add either a 'Contains' relation to the 'Alarm Zone Role', or a 'Contained' relation to the 'Person Role'. Select the 'Alarm Zone Role' in the 'Geometry' tab and click on the 'Edit' button in the 'Contains' area of the screen, near the bottom:



Check the 'Person Role' as shown and click OK.

Now, your 'Alarm Zone Role' contains your 'Person Role' as required:



Also, now your 'Person Role' is contained by your 'Alarm Zone Role'. You could have added this relation by clicking 'Edit' at the bottom-right, but it was done for you when we added the corresponding 'Contains' relation:





5) Watch the spatial relationship in the Map

Open the Ubisense Map application and load your 'area1'. Click on the menu item View > Spatial Relation as shown:



The relationship you added appears in the following dialogue. Check the boxes as shown and click OK:



Using Site Manager or the Simulator, place your 'Jon' object in 'area1' outside the 'Alarm Zone' and you will see the shapes of the roles you defined appear as green:



Move 'Jon' into the 'Alarm Zone' and the shapes turn red:





What's next?

To make use of the spatial events created in this example, see How to get spatial events using the API.



Back to top