geom-class: Geometry class (S4) and methods

Description Details Slots

Description

A geom stores a table of points, a table of feature to which the points are associated and a table of groups, to which features are associated. A geom can be spatial (if it has a coordinate reference system assigned to it), but is not by default.

Details

A geom has one of three geometry types:

The data model for storing points follows the spaghetti model. Points are stored as a sequence of x and y values, associated to a feature ID. The feature ID relates coordinates to features and thus common attributes. Points and Lines are implemented straightforward in this model, but polygons, which may contain holes, are a bit trickier. In geometr they are implemented as follows:

  1. All points with the same fid make up one polygon, irrespective of it containing holes or not.

  2. The outer path/ring of a polygon is composed of all points until a duplicated of its first point occurs. This signals that all following points are part of another path/ring, which must be inside the outer path and which consists of all points until a duplicate of it's first point occurs.

  3. This repeats until all points of the feature are processed.

Moreover, a geom has a reference window, which is sort of a second extent that may be bigger (or smaller) than the extent and which determines the relative position of the points when plotting.

Slots

type

[character(1)]
the type of feature, either "point", "line", "polygon" or "grid".

point

[data.frame(1)]
the fid (feature ID), x and y coordinates per point and optional arbitrary point attributes.

feature

[data.frame(1)]
fid (feature ID), gid (group ID) and optional arbitrary feature attributes.

group

[data.frame(1)]
gid (group ID) and optional arbitrary group attributes.

window

[data.frame(1)]
the minimum and maximum value in x and y dimension of the reference window in which the geom dwells.

scale

[character(1)]
whether the point coordinates are stored as "absolute" values, or "relative" to window.

crs

[character(1)]
the coordinate reference system in proj4 notation.

history

[list(.)]
a list of steps taken to derive the geom in focus.


geometr documentation built on Sept. 21, 2021, 1:07 a.m.