SIM:ZoneDef

From RuleCore Support

Jump to: navigation, search

Overview

Geographical zones are defined using the AddZoneDef system event and are found in the SIM as ZoneDef items in the container located at /sim:SysInfo/sim:Items/sim:Item[@name="ZoneDef"].

A zone may be defined as a polygon, a circle with a radius (in meters) or a path with a width (in meters). All points that make up the boundary of the polygon, the center of the circle, or the path are given as WGS84 coordinates (lat, long).

Contents

The ZoneDef element normally contains an optional Description and then either a Polygon or a Circle element wherein the details of the geometrical shape is defined.

Example:

  <ZoneDef name="Gothenburg City">
    <Description>This is zone Gothenburg City</Description>
    <Polygon>
      <Coordinates>
        list of coordinates...
      </Coordinates>
    </Polygon>
  </ZoneDef>
 
  <ZoneDef name="Gothenburg">
    <Description>This is zone Gothenburg</Description>
    <Circle center="11.5782, 57.9190" radius="15000"/>
  </ZoneDef>
 
  <ZoneDef name="E20">
    <Description>This is zone Gothenburg</Description>
    <Path>
      <Coordinates>
        list of coordinates...
      </Coordinates>
      <Width>150</Width>
    </Path>
  </ZoneDef>

Example

Example 1. Querying the SIM for zone definitions might result in something like this:

<Type name="ZoneDef">
 
  ZoneDefs ...
 
</Type>

Example 2. To define a polygon-shaped zone named Gothenburg City, the definition could look like this:

<AddZoneDef xlmns="http://www.rulecore.com/2008/user" xmlns:base="http://www.rulecore.com/2008/base">
   ...
  <base:EventBody>
    <ZoneDef name="Gothenburg City">
      <Description>This is entity type Car</Description>
      <Polygon>
        <Coordinates>
          ... list of coordinates, separated by space
        </Coordinates>
      </Polygon>
    </ZoneDef>
  <base:EventBody>
</AddZoneDef>