Class GeometricShapeFactory
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.
Inherited Members
Namespace: NetTopologySuite.Utilities
Assembly: NetTopologySuite.dll
Syntax
public class GeometricShapeFactory
Constructors
| Improve this Doc View SourceGeometricShapeFactory()
Create a shape factory which will create shapes using the default GeometryFactory.
Declaration
public GeometricShapeFactory()
GeometricShapeFactory(GeometryFactory)
Create a shape factory which will create shapes using the given GeometryFactory.
Declaration
public GeometricShapeFactory(GeometryFactory geomFact)
Parameters
Type | Name | Description |
---|---|---|
GeometryFactory | geomFact | The factory to use. |
Fields
| Improve this Doc View SourceGeomFact
A geometry factory
Declaration
protected GeometryFactory GeomFact
Field Value
Type | Description |
---|---|
GeometryFactory |
PrecModel
A precision model
Declaration
protected PrecisionModel PrecModel
Field Value
Type | Description |
---|---|
PrecisionModel |
Properties
| Improve this Doc View SourceBase
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).
Declaration
public Coordinate Base { set; }
Property Value
Type | Description |
---|---|
Coordinate |
Centre
Gets/Sets the location of the shape by specifying the centre of the shape's bounding box.
Declaration
public Coordinate Centre { set; }
Property Value
Type | Description |
---|---|
Coordinate |
Envelope
Gets or sets the envelope of the shape
Declaration
public Envelope Envelope { get; set; }
Property Value
Type | Description |
---|---|
Envelope |
Height
Gets/Sets the height of the shape.
Declaration
public double Height { get; set; }
Property Value
Type | Description |
---|---|
Double |
NumPoints
Gets/Sets the total number of points in the created Geometry.
Declaration
public int NumPoints { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Rotation
Gets/Sets the rotation angle, in radians, to use for the shape. The rotation is applied relative to the centre of the shape.
Declaration
public double Rotation { get; set; }
Property Value
Type | Description |
---|---|
Double |
Size
Gets/Sets the size of the extent of the shape in both x and y directions.
Declaration
public double Size { set; }
Property Value
Type | Description |
---|---|
Double |
Width
Gets/Sets the width of the shape.
Declaration
public double Width { get; set; }
Property Value
Type | Description |
---|---|
Double |
Methods
| Improve this Doc View SourceCreateArc(Double, Double)
Creates a elliptical arc, as a LineString.
Declaration
public LineString CreateArc(double startAng, double angExtent)
Parameters
Type | Name | Description |
---|---|---|
Double | startAng | Start angle in radians |
Double | angExtent | Size of angle in radians |
Returns
Type | Description |
---|---|
LineString |
Remarks
The arc is always created in a counter-clockwise direction.
CreateArcPolygon(Double, Double)
Creates an elliptical arc polygon.
Declaration
public Polygon CreateArcPolygon(double startAng, double angExtent)
Parameters
Type | Name | Description |
---|---|---|
Double | startAng | Start angle in radians |
Double | angExtent | Size of angle in radians |
Returns
Type | Description |
---|---|
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
.
Declaration
public Polygon CreateCircle()
Returns
Type | Description |
---|---|
Polygon | A circular polygon. |
CreateCoord(Double, Double)
Creates a coordinate at (x
, y
)
Declaration
protected Coordinate CreateCoord(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
Double | x | The x-ordinate value |
Double | y | The y-ordinate value |
Returns
Type | Description |
---|---|
Coordinate | A coordinate |
CreateCoordTrans(Double, Double, Coordinate)
Creates a translated coordinate at (x
+ trans.X.X
, y
+ trans.Y.Y
)
Declaration
protected Coordinate CreateCoordTrans(double x, double y, Coordinate trans)
Parameters
Type | Name | Description |
---|---|---|
Double | x | The x-ordinate value |
Double | y | The y-ordinate value |
Coordinate | trans | A translation vector (coordinate) |
Returns
Type | Description |
---|---|
Coordinate | A coordinate |
CreateEllipse()
Creates an elliptical Polygon
.
If the supplied envelope is square the
result will be a circle.
Declaration
public Polygon CreateEllipse()
Returns
Type | Description |
---|---|
Polygon | An an ellipse or circle. |
CreateRectangle()
Creates a rectangular Polygon
.
Declaration
public Polygon CreateRectangle()
Returns
Type | Description |
---|---|
Polygon | A rectangular polygon. |
CreateSquircle()
Creates a squircular Polygon.
Declaration
public Polygon CreateSquircle()
Returns
Type | Description |
---|---|
Polygon | a squircle |
CreateSupercircle(Double)
Creates a supercircular Polygon of a given positive power.
Declaration
public Polygon CreateSupercircle(double power)
Parameters
Type | Name | Description |
---|---|---|
Double | power |
Returns
Type | Description |
---|---|
Polygon | a supercircle |
Rotate(Geometry)
Rotates a geometry by Rotation angle
Declaration
protected Geometry Rotate(Geometry geom)
Parameters
Type | Name | Description |
---|---|---|
Geometry | geom | The geometry to rotate |
Returns
Type | Description |
---|---|
Geometry | A rotated geometry |