Table of Contents

Class GeometricShapeFactory

Namespace
NetTopologySuite.Utilities
Assembly
NetTopologySuite.dll

Computes various kinds of common geometric shapes. Allows various ways of specifying the location and extent of the shapes, as well as number of line segments used to form them.

public class GeometricShapeFactory
Inheritance
GeometricShapeFactory
Derived
Inherited Members

Constructors

GeometricShapeFactory()

Create a shape factory which will create shapes using the default GeometryFactory.

public GeometricShapeFactory()

GeometricShapeFactory(GeometryFactory)

Create a shape factory which will create shapes using the given GeometryFactory.

public GeometricShapeFactory(GeometryFactory geomFact)

Parameters

geomFact GeometryFactory

The factory to use.

Fields

GeomFact

A geometry factory

protected GeometryFactory GeomFact

Field Value

GeometryFactory

PrecModel

A precision model

protected PrecisionModel PrecModel

Field Value

PrecisionModel

Properties

Base

Gets/Sets the location of the shape by specifying the base coordinate (which in most cases is the lower left point of the envelope containing the shape).

public Coordinate Base { set; }

Property Value

Coordinate

Centre

Gets/Sets the location of the shape by specifying the centre of the shape's bounding box.

public Coordinate Centre { set; }

Property Value

Coordinate

Envelope

Gets or sets the envelope of the shape

public Envelope Envelope { get; set; }

Property Value

Envelope

Height

Gets/Sets the height of the shape.

public double Height { get; set; }

Property Value

double

NumPoints

Gets/Sets the total number of points in the created Geometry.

public int NumPoints { get; set; }

Property Value

int

Rotation

Gets/Sets the rotation angle, in radians, to use for the shape. The rotation is applied relative to the centre of the shape.

public double Rotation { get; set; }

Property Value

double

Size

Gets/Sets the size of the extent of the shape in both x and y directions.

public double Size { set; }

Property Value

double

Width

Gets/Sets the width of the shape.

public double Width { get; set; }

Property Value

double

Methods

CreateArc(double, double)

Creates a elliptical arc, as a LineString.

public LineString CreateArc(double startAng, double angExtent)

Parameters

startAng double

Start angle in radians

angExtent double

Size of angle in radians

Returns

LineString

Remarks

The arc is always created in a counter-clockwise direction.

CreateArcPolygon(double, double)

Creates an elliptical arc polygon.

public Polygon CreateArcPolygon(double startAng, double angExtent)

Parameters

startAng double

Start angle in radians

angExtent double

Size of angle in radians

Returns

Polygon

An elliptical arc polygon

Remarks

The polygon is formed from the specified arc of an ellipse and the two radii connecting the endpoints to the centre of the ellipse.

CreateCircle()

Creates a circular Polygon.

public Polygon CreateCircle()

Returns

Polygon

A circular polygon.

CreateCoord(double, double)

Creates a coordinate at (x, y)

protected Coordinate CreateCoord(double x, double y)

Parameters

x double

The x-ordinate value

y double

The y-ordinate value

Returns

Coordinate

A coordinate

CreateCoordTrans(double, double, Coordinate)

Creates a translated coordinate at (x + trans.X.X, y + trans.Y.Y)

protected Coordinate CreateCoordTrans(double x, double y, Coordinate trans)

Parameters

x double

The x-ordinate value

y double

The y-ordinate value

trans Coordinate

A translation vector (coordinate)

Returns

Coordinate

A coordinate

CreateEllipse()

Creates an elliptical Polygon. If the supplied envelope is square the result will be a circle.

public Polygon CreateEllipse()

Returns

Polygon

An an ellipse or circle.

CreateRectangle()

Creates a rectangular Polygon.

public Polygon CreateRectangle()

Returns

Polygon

A rectangular polygon.

CreateSquircle()

Creates a squircular Polygon.

public Polygon CreateSquircle()

Returns

Polygon

a squircle

CreateSupercircle(double)

Creates a supercircular Polygon of a given positive power.

public Polygon CreateSupercircle(double power)

Parameters

power double

Returns

Polygon

a supercircle

Rotate(Geometry)

Rotates a geometry by Rotation angle

protected Geometry Rotate(Geometry geom)

Parameters

geom Geometry

The geometry to rotate

Returns

Geometry

A rotated geometry