This document is archived and information here might be outdated.  Recommended version.


IGeometryServer.Relation Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IG > IGeometryServer Interface > IGeometryServer.Relation Method
ArcGIS Developer Help

IGeometryServer.Relation Method

Determines the pairs of geometries from the input geometry arrays that participate in the specified spatial relation.

[Visual Basic .NET]
Public Function Relation ( _
			ByVal pSR As ISpatialReference, _
			ByVal pInGA1 As IGeometryArray, _
			ByVal pInGA2 As IGeometryArray, _
			ByVal r As esriSpatialRelationEnum, _
			ByVal param As String _
) As IRelationResultArray
[C#]
public IRelationResultArray Relation (
			ISpatialReference pSR,
			IGeometryArray pInGA1,
			IGeometryArray pInGA2,
			esriSpatialRelationEnum r,
    string param
);
[C++]
HRESULT Relation(
			ISpatialReference* pSR,
			IGeometryArray* pInGA1,
			IGeometryArray* pInGA2,
			esriSpatialRelationEnum r,
			BSTR param
);
[C++]
Parameters
pSR 

pSR is a parameter of type ISpatialReference* pInGA1
pInGA1 is a parameter of type IGeometryArray* pInGA2
pInGA2 is a parameter of type IGeometryArray* r
r is a parameter of type esriSpatialRelationEnum param
param is a parameter of type BSTR

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

Computes the set of pairs of geometries from pInGA1 and pInGA2 that belong to the specified relation. Both arrays are assumed to be in the coordinate system pSR, which cannot be nil.  The relations are evaluated in 2D. Z coordinates are not used. Geometry types cannot be mixed within an array. Further restrictions on the types of geometries in an array are listed in the following table. r is a member of esriSpatialRelationEnum and can be one of the following:

 

Name Description
esriSpatialRelationDisjoint Same as IRelationalOperator::Disjoint. The zero-based index of a geometry from pInGA1 and the zero-based index of a geometry from pInGA2 define an element of the output array of relation results if the geometries share no points in common. See IRelationalOperator_Disjoint for some examples of the disjoint relation. There are no additional restrictions on the types of geometries in the input arrays.
esriSpatialRelationIntersection The opposite of esriSpatialRelationDisjoint. An element of the output array will specify the indexes of geometries from the input arrays if they share at least one point in the xy plane. There are no additional restrictions on the types of geometries in the input arrays.
esriSpatialRelationInteriorIntersection Same as esriSpatialRelationIntersection, but excludes intersections that occur only at boundaries (two touching polygons for example). The interior of a point is considered to be the point itself and the interior of a polyline excludes the endpoints of all its parts. There are no additional restrictions on the types of geometries in the input arrays.
esriSpatialRelationIn, esriSpatialRelationWithin These relations are similar. esriSpatialRelationIn is the same as IRelationalOperator::Within. esriSpatialRelationWithin is the same but also allows polylines that are strictly on the boundaries of polygons to be considered “in” the polygon. This case is disallowed by the former relation (and disallowed by IRelationalOperator::Within). The dimension of all geometries in pInGA1 must be >= the dimension of geometries in pInGA2.

esriSpatialRelationPointTouch, esriSpatialRelationLineTouch, esriSpatialRelationTouch

esriSpatialRelationPointTouch and esriSpatialRelationLineTouch are boundary intersections classified by dimension of intersection. esriSpatialRelationTouch is the union of those two and is equivalent to the ArcObjects IRelationalOperator Touch method.

These relations are defined for polylines and polygons.

esriSpatialRelationLineCoincidence The boundaries of the shapes must share a 1D intersection, but the relationship between the interiors of the shapes is not considered (they could overlap, one could be contained in the other, or their interiors could be disjoint). This relation applies to polylines and polygons.
esriSpatialRelationCross Same as the ArcObjects IRelationalOperator::Cross method. Lines can cross other lines at a point and lines can cross polygons. See IRelationalOperator_Crosses for examples.
esriSpatialRelationRelation 'param' defines the 'Shape Comparison Language' string to be evaluated. Strings such as "RELATE(G1, G2, ""FFFTTT***"")" are accepted, in addition to other kinds of strings. See the following topic for more details on the Shape Comparison Language. ShapeComparisonLanguage.htm

 

The output array contains elements of type

struct esriRelationPair
{
 // The index of the left element in the relation.
 long m_leftIndex;
 
 //The index of the right element in the relation.
 long m_rightIndex;
 
} esriRelationPair;

m_leftIndex is a zero-based index into pInGA1 and m_rightIndex is an index into pInGA2.

esriGeometryRelationEnum is a synonym for esriSpatialRelationEnum. The former is the type name exposed through the web service. The latter is exposed through the COM api.

 

Refer to IGeometryServer for additional details on how the input spatial reference is interpreted.

See Also

IGeometryServer Interface