ISpatialRelation
This interface tests the geometry’s spatial relationship with other geometries.
|
Methods |
|
|
Determines if the selected geometry contains a specified other geometry. |
|
|
Determines whether the selected geometry has some, but not all interior points in common with another specified geometry. |
|
|
Determines whether the selected geometry has no point in common with another geometry. |
|
|
Determines whether the selected geometry equals another specified geometry. |
|
|
Determines whether the inputted geometry intersects the selected one. |
|
|
Determines whether the selected geometry overlaps another one. |
|
|
Determines whether the selected geometry touches another geometry. |
|
|
Determines whether the selected geometry is completely within another geometry. |
Contains
Determines whether the selected geometry completely contains another geometry. Within returns TRUE if the other geometry is completely within the selected one. The boundary of the selected geometry may not intersect the other one’s interior or boundary, and the two geometries may not be equal.
JavaScript |
|
Contains( otherGeometry) |
C# |
|
bool Contains( IGeometry otherGeometry) |
C++ |
|
HRESULT Contains( IGeometry* otherGeometry, VARIANT_BOOL* pVal) |
Parameters
otherGeometry
An IGeometry representing the geometry which is being checked as to whether it is contained by the selected geometry.
Return Value
pVal
Returns TRUE if the geometry contains the other geometry.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.
Crosses
Returns TRUE if the interiors of both geometries intersect and the interior of the selected geometry intersects with the boundary of the other one.
JavaScript |
|
Crosses( otherGeometry) |
C# |
|
bool Crosses( IGeometry otherGeometry) |
C++ |
|
HRESULT Crosses( IGeometry* otherGeometry, VARIANT_BOOL* pVal) |
Parameters
otherGeometry
An IGeometry representing the geometry which is being checked whether it crosses the selected geometry.
Return Value
pVal
Returns TRUE if the two geometries cross.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.
Disjoint
Returns TRUE if the selected geometry has no point in common with another geometry.
JavaScript |
|
Disjoint( otherGeometry) |
C# |
|
bool Disjoint( IGeometry otherGeometry) |
C++ |
|
HRESULT Disjoint( IGeometry* otherGeometry, VARIANT_BOOL* pVal) |
Parameters
otherGeometry
An IGeometry representing the geometry with which to compare the selected geometry.
Return Value
pVal
Returns TRUE if the two geometries are disjoint.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.
Equals
Returns TRUE if the selected geometry equals another specified geometry, such that every point of one geometry is a point in the other (matching x, y coordinates).
JavaScript |
|
Equals( otherGeometry) |
C# |
|
Bool Equals( IGeometry otherGeometry) |
C++ |
|
HRESULT Equals( IGeometry* otherGeometry, VARIANT_BOOL* pVal) |
Parameters
otherGeometry
An IGeometry representing the geometry with which to compare the selected geometry.
Return Value
pVal
Returns TRUE if the two geometries are equal.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.
Intersects
Returns TRUE if the interior or boundary of the selected geometry intersects the interior or boundary of the other geometry.
JavaScript |
|
Intersects( otherGeometry) |
C# |
|
bool Intersects( IGeometry otherGeometry) |
C++ |
|
HRESULT Intersects( IGeometry* otherGeometry, VARIANT_BOOL* pVal) |
Parameters
otherGeometry
An IGeometry representing the geometry being checked for intersection with the selected geometry.
Return Value
pVal
A Boolean that indicates whether the geometries intersect. Returns TRUE if the two geometries intersect.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.
Overlaps
Returns TRUE only when two geometries of the same dimension intersect (polygon/polygon, linestring/linestring, multilinestring/multilinestring) and their intersection results in a geometry of the same dimension (e.g. polygon intersects with a polygon, and the intersection results in a polygon).
JavaScript |
|
Overlaps( otherGeometry) |
C# |
|
bool Overlaps( IGeometry otherGeometry) |
C++ |
|
HRESULT Overlaps( IGeometry* otherGeometry, VARIANT_BOOL* pVal) |
Parameters
otherGeometry
An IGeometry representing the geometry being checked for overlap with the selected geometry.
Return Value
pVal
Returns TRUE if the two geometries intersect.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.
Touches
Returns TRUE if one of the geometries’ boundaries intersects the other’s interior or boundary, without the interiors of the geometries intersecting. At least one geometry must be a linestring multilinestring, polygon or multipolygon.
JavaScript |
|
Touches( otherGeometry) |
C# |
|
bool Touches( IGeometry otherGeometry) |
C++ |
|
HRESULT Touches( IGeometry* otherGeometry, VARIANT_BOOL* pVal) |
Parameters
otherGeometry
An IGeometry representing the geometry with which to compare the selected geometry.
Return Value
pVal
Returns TRUE if the two geometries touch.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.
Within
Returns TRUE if the selected geometry is completely within another geometry. The boundary of and interior of the selected geometry may not intersect the boundary of the selected other one, and the two geometries may not be equal.
JavaScript |
|
|
|
Within( otherGeometry) |
C# |
|
|
|
bool Within( IGeometry otherGeometry) |
C++ |
|
|
|
HRESULT Within( IGeometry* otherGeometry, VARIANT_BOOL* pVal) |
Parameters
otherGeometry
An IGeometry representing the geometry being checked if the selected geometry is within it.
Return Value
pVal
Returns TRUE if the selected geometry is within the other one.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.