Spatial Join
   HOME

TheInfoList



OR:

A spatial join is an operation in a
geographic information system A geographic information system (GIS) is a type of database containing Geographic data and information, geographic data (that is, descriptions of phenomena for which location is relevant), combined with Geographic information system software, sof ...
(GIS) or
spatial database A spatial database is a general-purpose database (usually a relational database) that has been enhanced to include spatial data that represents objects defined in a geometric space, along with tools for querying and analyzing such data. Most spa ...
that combines the attribute tables of two spatial layers based on a desired
spatial relation A spatial relationD. M. Mark and M. J. Egenhofer (1994), "Modeling Spatial Relations Between Lines and Regions: Combining Formal Mathematical Models and Human Subjects Testing"PDF/ref> specifies how some object is located in space in relation to s ...
between their geometries. It is similar to the table join operation in relational databases in merging two tables, but each pair of rows is correlated based on some form of matching location rather than a common key value. It is also similar to
vector overlay Vector overlay is an operation (or class of operations) in a geographic information system (GIS) for integrating two or more vector spatial data sets. Terms such as ''polygon overlay'', ''map overlay'', and ''topological overlay'' are often used ...
operations common in GIS software such as Intersect and Union in merging two spatial datasets, but the output does not contain a composite geometry, only merged attributes. Spatial joins are used in a variety of
spatial analysis Spatial analysis or spatial statistics includes any of the formal techniques which studies entities using their topological, geometric, or geographic properties. Spatial analysis includes a variety of techniques, many still in their early deve ...
and management applications, including allocating individuals to districts and statistical aggregation. Spatial join is found in most, if not all, GIS and spatial database software, although this term is not always used, and sometimes it must be derived indirectly by the combination of several tools.


Spatial relation predicates

Fundamental to the spatial join operation is the formulation of a spatial relationship between two
geometric primitive In vector computer graphics, CAD systems, and geographic information systems, geometric primitive (or prim) is the simplest (i.e. 'atomic' or irreducible) geometric shape that the system can handle (draw, store). Sometimes the subroutines that ...
s as a
logical predicate In logic, a predicate is a symbol which represents a property or a relation. For instance, in the first order formula P(a), the symbol P is a predicate which applies to the individual constant a. Similarly, in the formula R(a,b), R is a predicat ...
; that is, a criterion that can be evaluated as true or false. For example, "A is less than 5km from B" would be true if the distance between points A and B is 3km, and false if the distance is 10km. These relation predicates can be of two types: * A Topological relation is a qualitative relationship between two shapes that does not depend on a measurable space (that is, coordinates). Common examples of such predicates include "A is ''completely inside'' B," "A ''overlaps'' B," "A is ''adjacent'' to B" (i.e., sharing a boundary but no interior), and "A is ''disjoint'' from B" (not touching at all). These are commonly specified according to some form of the 9-Intersection Model, which is incorporated into the international
Simple Feature Access Simple Features (officially Simple Feature Access) is a set of standards that specify a common storage and access model of geographic feature made of mostly two-dimensional geometries (point, line, polygon, multi-point, multi-line, etc.) used by ...
specification (ISO 19125-2). * A Metric relation is a quantitative (measurable) relationship between two shapes in a coordinate space, most commonly a distance or direction. Common examples include "A is ''due north'' of B" or "A is ''less than 5 km'' from B." Not all software implementations support metric relations. Note that some relations are ''commutative'' (e.g., A overlaps B if and only if B overlaps A) while others are not (e.g., A is within B does not mean B is within A). The geometric primitives involved in these relations may be of any
dimension In physics and mathematics, the dimension of a Space (mathematics), mathematical space (or object) is informally defined as the minimum number of coordinates needed to specify any Point (geometry), point within it. Thus, a Line (geometry), lin ...
(points, lines, or regions), but some relations may only have meaning with certain dimensions. For example, "A is within B" has a clear meaning if A is a point and B is a region, but is meaningless if both A and B are points. Other relations may be vague; for example, the distance between two regions or two lines may be interpreted as the minimal distance between their closest boundaries, or a mean distance between their centroids.


Operation

As in a relational table join as defined in the
relational algebra In database theory, relational algebra is a theory that uses algebraic structures with a well-founded semantics for modeling data, and defining queries on it. The theory was introduced by Edgar F. Codd. The main application of relational algebra ...
, two input layers or tables are provided (hereafter ''X'' and ''Y''), and the output is a table containing all of the columns of each of the inputs (or some subset thereof if selected by the user). The rows of the new table are a subset of Cross join or
Cartesian product In mathematics, specifically set theory, the Cartesian product of two sets ''A'' and ''B'', denoted ''A''×''B'', is the set of all ordered pairs where ''a'' is in ''A'' and ''b'' is in ''B''. In terms of set-builder notation, that is : A\ti ...
of the two tables, all possible pairs of rows . Rather than include all possible combinations, each pair is evaluated according to the given spatial predicate; those for which the predicate is true are considered "matching" and are retained, while those for which the predicate is false are discarded. For example, consider the following two tables: When the spatial join is executed, the direction of attachment must be specified, for two reasons: 1) the given spatial predicate may not be commutative, and 2) there is often a many-to-one relationship between the rows (e.g., many students are inside each school district). In the example above, a common goal would be to join the schools table to the students table (the ''target table''), with the relation predicate being "student.residence ''within'' school.district." Assuming that the districts do not overlap, each student point will be in no more than one school district, so the output would have the same rows as the students table, with the corresponding school attributes attached, as: The reverse operation, in this case attaching the student information to the schools table, is not as simple because many rows must be joined to one row. Some GIS software does not allow this operation, but most implementations allow for an ''aggregate join'', in which aggregate summaries of the matching rows can be included, such as arrays, counts, sums, or means. For example, the result table might look like: Another option when there are multiple matches is to use some criterion to select one of the rows from the matching set, usually a spatial optimization criterion. For example, one could join the school building points (not the districts) to the student residents points by selecting the school that is ''nearest'' to each student. Not all software implements this option directly, although in some cases it can be derived through a combination of tools.


External links


Spatial Join
tool in ArcGIS Pro

tool in QGIS

tool in QGIS

in Manifold GIS

in PostGIS


References

{{reflist GIS software Geographic information systems