Table of Contents

Method Write

Namespace
GeometryHelper.Export
Assembly
GeometryHelper.dll

Write(GeoPoint2)

Writes a point: POINT (x y).

public static string Write(GeoPoint2 point)

Parameters

point GeoPoint2

Returns

string

Write(GeoPoint3)

Writes a point in space: POINT Z (x y z).

public static string Write(GeoPoint3 point)

Parameters

point GeoPoint3

Returns

string

Write(GeoLine2)

Writes a segment: LINESTRING (...).

public static string Write(GeoLine2 line)

Parameters

line GeoLine2

Returns

string

Write(GeoLine3)

Writes a segment in space: LINESTRING Z (...).

public static string Write(GeoLine3 line)

Parameters

line GeoLine3

Returns

string

Write(GeoPolyline2)

Writes a chain: LINESTRING (...).

public static string Write(GeoPolyline2 polyline)

Parameters

polyline GeoPolyline2

Returns

string

Exceptions

ArgumentNullException

Thrown when the chain is null.

Write(GeoPolyline3)

Writes a chain in space: LINESTRING Z (...).

public static string Write(GeoPolyline3 polyline)

Parameters

polyline GeoPolyline3

Returns

string

Exceptions

ArgumentNullException

Thrown when the chain is null.

Write(GeoPolygon2)

Writes a polygon: POLYGON ((...)).

public static string Write(GeoPolygon2 polygon)

Parameters

polygon GeoPolygon2

Returns

string

Exceptions

ArgumentNullException

Thrown when the polygon is null.

Write(GeoPolygon3)

Writes a polygon in space: POLYGON Z ((...)).

public static string Write(GeoPolygon3 polygon)

Parameters

polygon GeoPolygon3

Returns

string

Exceptions

ArgumentNullException

Thrown when the polygon is null.

Write(GeoFace2)

Writes a face with its holes: POLYGON ((...), (...)).

public static string Write(GeoFace2 face)

Parameters

face GeoFace2

Returns

string

Exceptions

ArgumentNullException

Thrown when the face is null.

Write(IEnumerable<GeoFace2>)

Writes several faces: MULTIPOLYGON (((...)), ((...))), such as what a boolean gives back.

public static string Write(IEnumerable<GeoFace2> faces)

Parameters

faces IEnumerable<GeoFace2>

Returns

string

Remarks

Faces that share an edge parse everywhere but are not a valid multipolygon in the OGC sense, whose polygons touch at points only: PostGIS's ST_IsValid says false of them. What a boolean gives back is apart, and valid.

Exceptions

ArgumentNullException

Thrown when the faces or one of them are null.

Write(GeoRectangle2)

Writes a rectangle: POLYGON ((...)), counter-clockwise.

public static string Write(GeoRectangle2 rectangle)

Parameters

rectangle GeoRectangle2

Returns

string

Write(GeoTriangle2)

Writes a triangle: POLYGON ((...)), counter-clockwise whichever way it was given.

public static string Write(GeoTriangle2 triangle)

Parameters

triangle GeoTriangle2

Returns

string

Write(GeoTriangle3)

Writes a triangle in space: POLYGON Z ((...)), its corners in the order they were given.

public static string Write(GeoTriangle3 triangle)

Parameters

triangle GeoTriangle3

Returns

string

Write(GeoFace3)

Writes a face in space with its holes: POLYGON Z ((...), (...)).

public static string Write(GeoFace3 face)

Parameters

face GeoFace3

Returns

string

Remarks

Space has no counter-clockwise, so it is taken about the face's normal: the boundary runs counter-clockwise about it and each hole clockwise, as for a face of the plane.

Exceptions

ArgumentNullException

Thrown when the face is null.

Write(IEnumerable<GeoFace3>)

Writes several faces in space: MULTIPOLYGON Z (((...)), ((...))).

public static string Write(IEnumerable<GeoFace3> faces)

Parameters

faces IEnumerable<GeoFace3>

Returns

string

Remarks

Faces that share an edge parse everywhere but are not a valid multipolygon in the OGC sense, whose polygons touch at points only: ST_IsValid says false of them.

Exceptions

ArgumentNullException

Thrown when the faces or one of them are null.

Write(GeoMesh2)

Writes a mesh of the plane: MULTIPOLYGON (((...)), ((...))), a polygon to each face.

public static string Write(GeoMesh2 mesh)

Parameters

mesh GeoMesh2

Returns

string

Remarks

A mesh of a grid of 4 cells is a multipolygon of 4 polygons, counter-clockwise as its faces are. The cells share their edges, so the text parses everywhere but is not a valid multipolygon in the OGC sense, whose polygons touch at points only: ST_IsValid says false of it.

Exceptions

ArgumentNullException

Thrown when the mesh is null.

Write(GeoMesh3)

Writes a flat mesh in space: MULTIPOLYGON Z (((...)), ((...))), a polygon to each face.

public static string Write(GeoMesh3 mesh)

Parameters

mesh GeoMesh3

Returns

string

Remarks

The faces share their edges, so the text parses everywhere but is not a valid multipolygon in the OGC sense, whose polygons touch at points only: ST_IsValid says false of it.

Exceptions

ArgumentNullException

Thrown when the mesh is null.

Write(GeoSolid3)

Writes a body as the triangles of where its material ends: POLYHEDRALSURFACE Z (((...)), ((...))).

public static string Write(GeoSolid3 solid)

Parameters

solid GeoSolid3

Returns

string

Remarks

A box 30 by 20 by 10 is 12 triangles, wound outwards, whose signed volumes add up to 6 000. PostGIS reads the form; it is the only well-known text for a body. Openings are cut in, and the triangles are made at the global tolerance. A body the openings take all of is POLYHEDRALSURFACE Z EMPTY.

Exceptions

ArgumentNullException

Thrown when the body is null.

Write(GeoSphere3, double)

Writes a ball as the triangles of its surface, no further than a tolerance from the sphere: POLYHEDRALSURFACE Z (((...)), ((...))), wound outwards.

public static string Write(GeoSphere3 sphere, double chordTolerance)

Parameters

sphere GeoSphere3
chordTolerance double

Returns

string

Remarks

A ball of radius 50 within 0.1 is 3 380 triangles, written as a body is: the triangles of TriangulateSurface(double).

Exceptions

ArgumentException

Thrown when the ball is not valid, as a default one is.

ArgumentOutOfRangeException

Thrown when the chord tolerance is not a finite number above nought, or would need more than 1 048 576 triangles.

Write(IEnumerable<GeoPoint2>)

Writes points: MULTIPOINT ((x y), (x y)).

public static string Write(IEnumerable<GeoPoint2> points)

Parameters

points IEnumerable<GeoPoint2>

Returns

string

Exceptions

ArgumentNullException

Thrown when the points are null.

Write(IEnumerable<GeoPoint3>)

Writes points in space: MULTIPOINT Z ((x y z), (x y z)).

public static string Write(IEnumerable<GeoPoint3> points)

Parameters

points IEnumerable<GeoPoint3>

Returns

string

Exceptions

ArgumentNullException

Thrown when the points are null.

Write(IEnumerable<GeoLine2>)

Writes segments: MULTILINESTRING ((...), (...)).

public static string Write(IEnumerable<GeoLine2> lines)

Parameters

lines IEnumerable<GeoLine2>

Returns

string

Exceptions

ArgumentNullException

Thrown when the segments are null.

Write(IEnumerable<GeoLine3>)

Writes segments in space: MULTILINESTRING Z ((...), (...)).

public static string Write(IEnumerable<GeoLine3> lines)

Parameters

lines IEnumerable<GeoLine3>

Returns

string

Exceptions

ArgumentNullException

Thrown when the segments are null.

Write(IEnumerable<GeoPolyline2>)

Writes chains: MULTILINESTRING ((...), (...)).

public static string Write(IEnumerable<GeoPolyline2> polylines)

Parameters

polylines IEnumerable<GeoPolyline2>

Returns

string

Exceptions

ArgumentNullException

Thrown when the chains or one of them are null.

Write(IEnumerable<GeoPolyline3>)

Writes chains in space: MULTILINESTRING Z ((...), (...)).

public static string Write(IEnumerable<GeoPolyline3> polylines)

Parameters

polylines IEnumerable<GeoPolyline3>

Returns

string

Exceptions

ArgumentNullException

Thrown when the chains or one of them are null.

Write(GeoCircle2, double)

Writes a circle as a polygon, cut into chords no further than a tolerance from it: POLYGON ((...)).

public static string Write(GeoCircle2 circle, double chordTolerance)

Parameters

circle GeoCircle2
chordTolerance double

Returns

string

Remarks

Well-known text has no curves that online viewers and most tools read, so a curve is written through its chords. A circle of radius 100 cut within 0.1 is a ring of 71 chords, counter-clockwise. The count is worked out from the arc sine: a circle of radius 50 000 within 0.001 is 15 708 chords, none more than 0.001 inside it. No curve is cut into more than 1 048 576 chords.

Exceptions

ArgumentOutOfRangeException

Thrown when the chord tolerance is not a finite number above nought, or would need more than 1 048 576 chords.

Write(GeoArc2, double)

Writes an arc as a chain, cut into chords no further than a tolerance from it: LINESTRING (...), from the start of the arc to its end whichever way it turns.

public static string Write(GeoArc2 arc, double chordTolerance)

Parameters

arc GeoArc2
chordTolerance double

Returns

string

Exceptions

ArgumentOutOfRangeException

Thrown when the chord tolerance is not a finite number above nought, or would need more than 1 048 576 chords.

Write(GeoEllipse2, double)

Writes an ellipse as a polygon, cut into chords no further than a tolerance from it: POLYGON ((...)), counter-clockwise.

public static string Write(GeoEllipse2 ellipse, double chordTolerance)

Parameters

ellipse GeoEllipse2
chordTolerance double

Returns

string

Remarks

Spaced by the bend of the rim for up to 4 096 chords a turn, and evenly in the angle past that: an ellipse of radii 50 000 and 25 000 within 0.001 is 15 708 chords. No curve is cut into more than 1 048 576 chords.

Exceptions

ArgumentOutOfRangeException

Thrown when the chord tolerance is not a finite number above nought, or would need more than 1 048 576 chords.

Write(GeoPolylineArc2, double)

Writes a chain with arcs, each arc cut into chords no further than a tolerance from it: LINESTRING (...).

public static string Write(GeoPolylineArc2 chain, double chordTolerance)

Parameters

chain GeoPolylineArc2
chordTolerance double

Returns

string

Remarks

Each arc is cut on its own radius, so a long bend of a large radius is within the tolerance too; the chords of all its arcs together are no more than 1 048 576.

Exceptions

ArgumentNullException

Thrown when the chain is null.

ArgumentOutOfRangeException

Thrown when the chord tolerance is not a finite number above nought, or would need more than 1 048 576 chords.

Write(GeoPolygonArc2, double)

Writes a loop with arcs, each arc cut into chords no further than a tolerance from it: POLYGON ((...)), counter-clockwise.

public static string Write(GeoPolygonArc2 loop, double chordTolerance)

Parameters

loop GeoPolygonArc2
chordTolerance double

Returns

string

Remarks

Each arc is cut on its own radius, so a long bend of a large radius is within the tolerance too; the chords of all its arcs together are no more than 1 048 576.

Exceptions

ArgumentNullException

Thrown when the loop is null.

ArgumentOutOfRangeException

Thrown when the chord tolerance is not a finite number above nought, or would need more than 1 048 576 chords.

Write(GeoSpline2, double)

Writes a spline as a chain, cut into chords no further than a tolerance from it: LINESTRING (...), from the start of the spline to its end.

public static string Write(GeoSpline2 spline, double chordTolerance)

Parameters

spline GeoSpline2
chordTolerance double

Returns

string

Remarks

The points are the corners Flatten(double) cuts it at, every one kept, and the ends are the first and last control points exactly, so a closed spline is a chain that comes back to its first point: the circle of radius 100 that FromCircle(GeoCircle2) builds, within 0.01, is 256 chords. No spline is cut into more than 1 048 576 chords.

Exceptions

ArgumentNullException

Thrown when the spline is null.

ArgumentOutOfRangeException

Thrown when the chord tolerance is not a finite number above nought, or would need more than 1 048 576 chords.

Write(GeoSpline3, double)

Writes a spline in space as a chain, cut into chords no further than a tolerance from it: LINESTRING Z (...), as Write(GeoSpline2, double) writes one in the plane.

public static string Write(GeoSpline3 spline, double chordTolerance)

Parameters

spline GeoSpline3
chordTolerance double

Returns

string

Exceptions

ArgumentNullException

Thrown when the spline is null.

ArgumentOutOfRangeException

Thrown when the chord tolerance is not a finite number above nought, or would need more than 1 048 576 chords.

Write(GeoArc3, double)

Writes an arc in space as a chain, cut into chords no further than a tolerance from it: LINESTRING Z (...).

public static string Write(GeoArc3 arc, double chordTolerance)

Parameters

arc GeoArc3
chordTolerance double

Returns

string

Exceptions

ArgumentOutOfRangeException

Thrown when the chord tolerance is not a finite number above nought, or would need more than 1 048 576 chords.

Write(GeoCircle3, double)

Writes a circle in space as a polygon, cut into chords no further than a tolerance from it: POLYGON Z ((...)), counter-clockwise about its normal.

public static string Write(GeoCircle3 circle, double chordTolerance)

Parameters

circle GeoCircle3
chordTolerance double

Returns

string

Exceptions

ArgumentOutOfRangeException

Thrown when the chord tolerance is not a finite number above nought, or would need more than 1 048 576 chords.

Write(GeoEllipse3, double)

Writes an ellipse in space as a polygon, cut into chords no further than a tolerance from it: POLYGON Z ((...)), counter-clockwise about its normal.

public static string Write(GeoEllipse3 ellipse, double chordTolerance)

Parameters

ellipse GeoEllipse3
chordTolerance double

Returns

string

Exceptions

ArgumentOutOfRangeException

Thrown when the chord tolerance is not a finite number above nought, or would need more than 1 048 576 chords.

Write(GeoPolylineArc3, double)

Writes a chain with arcs in space, each arc cut into chords no further than a tolerance from it: LINESTRING Z (...).

public static string Write(GeoPolylineArc3 chain, double chordTolerance)

Parameters

chain GeoPolylineArc3
chordTolerance double

Returns

string

Remarks

Each arc is cut on its own radius, so a long bend of a large radius is within the tolerance too; the chords of all its arcs together are no more than 1 048 576.

Exceptions

ArgumentNullException

Thrown when the chain is null.

ArgumentOutOfRangeException

Thrown when the chord tolerance is not a finite number above nought, or would need more than 1 048 576 chords.

Write(GeoPolygonArc3, double)

Writes a loop with arcs in space, each arc cut into chords no further than a tolerance from it: POLYGON Z ((...)).

public static string Write(GeoPolygonArc3 loop, double chordTolerance)

Parameters

loop GeoPolygonArc3
chordTolerance double

Returns

string

Remarks

Each arc is cut on its own radius, so a long bend of a large radius is within the tolerance too; the chords of all its arcs together are no more than 1 048 576.

Exceptions

ArgumentNullException

Thrown when the loop is null.

ArgumentOutOfRangeException

Thrown when the chord tolerance is not a finite number above nought, or would need more than 1 048 576 chords.

Write(GeoRay2, double)

Writes a ray as a segment from its origin for a length, as a ray has no end of its own: LINESTRING (...).

public static string Write(GeoRay2 ray, double length)

Parameters

ray GeoRay2
length double

Returns

string

Exceptions

ArgumentException

Thrown when the ray has no direction, as a default one has.

ArgumentOutOfRangeException

Thrown when the length is negative, NaN or infinite.

Write(GeoRay3, double)

Writes a ray in space as a segment from its origin for a length: LINESTRING Z (...).

public static string Write(GeoRay3 ray, double length)

Parameters

ray GeoRay3
length double

Returns

string

Exceptions

ArgumentException

Thrown when the ray has no direction, as a default one has.

ArgumentOutOfRangeException

Thrown when the length is negative, NaN or infinite.

Write(GeoXLine2, double)

Writes a line without ends in the plane as a segment of a length, centred on its origin, as it has no end of its own: LINESTRING (...).

public static string Write(GeoXLine2 xline, double length)

Parameters

xline GeoXLine2
length double

Returns

string

Remarks

The line through (10, 20) along X, written 100 long, is LINESTRING (-40 20, 60 20).

Exceptions

ArgumentException

Thrown when the line has no direction, as a default one has.

ArgumentOutOfRangeException

Thrown when the length is negative, NaN or infinite.

Write(GeoXLine3, double)

Writes a line without ends in space as a segment of a length, centred on its origin: LINESTRING Z (...).

public static string Write(GeoXLine3 xline, double length)

Parameters

xline GeoXLine3
length double

Returns

string

Exceptions

ArgumentException

Thrown when the line has no direction, as a default one has.

ArgumentOutOfRangeException

Thrown when the length is negative, NaN or infinite.