NetLogo 7.0.0-beta2:

gis:relationship-of

gis:relationship-of x y

Reports the Dimensionally Extended Nine-Intersection Model (DE-9IM) matrix that describes the spatial relationship of the two objects. The matrix consists of 9 elements, each of which describes the relationship between the two objects’ interior space, boundary space, or exterior space. Each element will describe the dimension of the intersection of two spaces, meaning that it may have one of four possible values:

  • “-1”, meaning the spaces do not intersect
  • “0”, meaning the dimension of the spaces’ intersection is zero (i.e., they intersect at a point or set of points).
  • “1”, meaning the dimension of the spaces’ intersection is one (i.e., they intersect along one or more lines).
  • “2”, meaning the dimension of the spaces’ intersection is two (i.e., their intersection is a non-empty polygon).

For example, the two polygons x and y shown here:

have the following DE-9IM matrix:

x
Interior Boundary Exterior
y Interior 2 1 2
Boundary 1 0 1
Exterior 2 1 2

Which would be reported by the relationship-of primitive as the string “212101212”.

A much more detailed and formal description of the DE-9IM matrix and the associated point-set theory can be found in the OpenGIS Simple Features Specification for SQL.

The objects x and y may be any one of:

  • a VectorDataset, in which case the object’s spatial representation is the union of all the points, lines, or polygons the dataset contains.
  • a VectorFeature, in which case the object’s spatial representation is defined by the point, line, or polygon the feature contains.
  • A turtle, in which case the spatial representation is a point.
  • A link, whose spatial representation is a line segment connecting the two points represented by the turtles the link is connecting.
  • A patch, whose spatial representation is a rectangular polygon.
  • An agentset, whose spatial representation is the union of the representations of all of the agents it contains.
  • A list containing of any of the items listed here, including another list. The spatial representation of such a list is the union of the spatial representations of its contents.

Take me to the full GIS Extension Dictionary