IGeometry

This abstract base class interface provides properties and methods for setting or returning the properties and behavior of geometric objects. The following interfaces are inherited from IGeometry:

§   IGeometryCollection

§   ILinearRing

§   ILineString

§   IMultiLineString

§   IMultiPolygon

§   IPoint

§   IPolygon

 

 

Properties

 

Dimension

Gets the dimension of the geometry object.

Envelope

Gets the geometry’s bounding box.

GeometryType

Gets the geometry type.

GeometryTypeStr

Gets a string representation of the geometry type.

SpatialOperator

An ISpatialOperator representing the selected geometry’s interaction with another geometry object.

SpatialRelation

An ISpatialRelation that tests the geometry’s spatial relationship with other geometries.

Wks

An IWks representing methods for converting geometries to and from their Well-Known Text (WKT) and Well-Known Binary (WKB) representations

 

Methods

 

Clone

Creates an exact copy of the selected geometry.

EndEdit

Terminates the edit item mode.

IsEmpty

Returns a Boolean indicating whether there are points in the selected geometry.

IsSimple

Returns a Boolean indicating whether the geometry is simple.

SetEmpty

Removes all points from this geometry.

StartEdit

Starts the edit item mode.

Dimension

Gets the dimension of the geometry object.

§   Points and multipoints = 0 (have neither length nor area)

§   Linestrings and multilinestrings = 1 (have length)

§   Polygons and multipolygons = 2 (have length and area)

 

JavaScript

 

Dimension

 

C#

 

int Dimension { get;}

 

C++

 

HRESULT Dimension([out, retval] long* Dimension)

Envelope

Gets a copy of the geometry’s bounding geometry formed by the minimum and maximum (x,y) coordinates. The envelopes of most geometries form a bounding box. For a point, the envelope is a point since its minimum and maximum coordinates are the same. The envelope of a linestring is a linestring represented by the endpoints of the source linestring.

 

JavaScript

 

Envelope

 

C#

 

IGeometry Envelope { get; }

 

C++

 

HRESULT Envelope(

       [out, retval] IGeometry** Envelope)

GeometryType

Gets an enum that determines the geometry type. The following are the possible values:  

§   SG_POINT = 0
IPoint

§   SG_LINESTRING = 1
ILineString

§   SG_LINEARRING = 2
ILinearRing

§   SG_POLYGON = 3
IPolygon

§   SG_MULTILINESTRING = 5
IGeometryCollection (of ILineString geometries)

§   SG_MULTIPOLYGON = 6
IGeometryCollection (of Polygon geometries)

 

JavaScript

 

GeometryType

 

C#

 

SGGeometryTypeId GeometryType { get; }

 

C++

 

HRESULT GeometryType(

       [out, retval] SGGeometryTypeId* geometryTypeId)

Return Value

geometryTypeId

An enum that returns one of the following values:

·          SG_POINT                           = 0

·          SG_LINESTRING                = 1

·          SG_LINEARRING               = 2

·          SG_POLYGON                    = 3

·          SG_MULTIPOINT              = 4

·          SG_MULTILINESTRING   = 5

·          SG_MULTIPOLYGON       = 6

GeometryTypeStr

Gets a string representation of the geometry type.

 

JavaScript

 

GeometryTypeStr

 

C#

 

string GeometryTypeStr { get; }

 

C++

 

HRESULT GeometryTypeStr(

       [out, retval] BSTR* GeometryType)

Clone

Creates an exact copy of the selected geometry.

 

JavaScript

 

Clone()

 

C#

 

IGeometry Clone()

 

C++

 

HRESULT Clone(

       IGeometry** newGeometry)

Return Value

newGeometry

An exact clone of the selected geometry.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

EndEdit

Terminates the edit item mode. Before terminating, the returning geometry is polygonized to check that there are no intersecting lines that invalidate the geometry and to split the geometry into multipolygons at any intersection points that do exist.

 

JavaScript

 

EndEdit()

 

C#

 

IGeometry EndEdit()

 

C++

 

HRESULT EndEdit(

       IGeometry** newGeometry)

Return Value

newGeometry

An IGeometry, representing the edited geometry.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

IsEmpty

Returns a Boolean indicating whether there are points in the selected geometry.

 

JavaScript

 

IsEmpty()

 

C#

 

int IsEmpty()

 

C++

 

HRESULT IsEmpty(

       VARIANT_BOOL* IsEmpty)

Return Value

IsEmpty

A Boolean that returns TRUE if there are no points in the selected geometry.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

IsSimple

Returns a Boolean indicating whether the geometry is simple. This property only applies to linestrings, multipoints, and multilinestrings, and is defined differently for each of these types:

§   A linestring is simple if it does not intersect itself.

§   A multipoint is simple if none of its elements occupy the same coordinate space.

§   A multilinestring is simple if the linestrings only intersect at the endpoints of the linestrings.

 

JavaScript

 

IsSimple()

 

C#

 

int IsSimple()

 

C++

 

HRESULT IsSimple(

       VARIANT_BOOL* IsSimple)

Return Value

IsSimple

A Boolean that returns TRUE if the geometry is simple.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

SetEmpty

Removes all points from this set, returning it to its original initialization state by releasing all referenced data.

 

JavaScript

 

void SetEmpty()

 

C#

 

void SetEmpty()

 

C++

 

HRESULT SetEmpty()

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

StartEdit

Starts the edit item mode.

 

JavaScript

 

StartEdit()

 

C#

 

void StartEdit()

 

C++

 

HRESULT StartEdit()

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.