Search Results for

    Show / Hide Table of Contents

    Class WKTWriter

    Outputs the textual representation of a Geometry. The WKTWriter outputs coordinates rounded to the precision model. No more than the maximum number of necessary decimal places will be output. The Well-known Text format is defined in the OpenGIS Simple Features Specification for SQL. A non-standard "LINEARRING" tag is used for LinearRings. The WKT spec does not define a special tag for LinearRings. The standard tag to use is "LINESTRING".

    Inheritance
    object
    WKTWriter
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: NetTopologySuite.IO
    Assembly: NetTopologySuite.dll
    Syntax
    public class WKTWriter

    Constructors

    | Edit this page View Source

    WKTWriter()

    Creates an instance of this class which is writing at most 2 dimensions.

    Declaration
    public WKTWriter()
    | Edit this page View Source

    WKTWriter(int)

    Creates an instance of this class which is writing at most outputDimension dimensions.

    Declaration
    public WKTWriter(int outputDimension)
    Parameters
    Type Name Description
    int outputDimension

    Properties

    | Edit this page View Source

    Formatted

    Gets/sets whether the output will be formatted

    Declaration
    public bool Formatted { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    MaxCoordinatesPerLine

    Gets/sets the maximum number of coordinates per line written in formatted output.

    Declaration
    public int MaxCoordinatesPerLine { get; set; }
    Property Value
    Type Description
    int
    Remarks

    If the provided coordinate number is < 0, coordinates will be written all on one line.

    | Edit this page View Source

    OutputOrdinates

    Gets or sets the Ordinates to be written. Possible members are:

    • X
    • Y
    • Z
    • M
    Values of X and Y are always assumed and not particularly checked for.
    Declaration
    public Ordinates OutputOrdinates { get; set; }
    Property Value
    Type Description
    Ordinates
    | Edit this page View Source

    PrecisionModel

    Gets or sets a PrecisionModel that should be used on the ordinates written.

    If none/null is assigned, the precision model of the Factory is used.

    Note: The precision model is applied to all ordinate values, not just x and y.

    Declaration
    public PrecisionModel PrecisionModel { get; set; }
    Property Value
    Type Description
    PrecisionModel
    | Edit this page View Source

    Tab

    Gets/sets the tab size to use for indenting.

    Declaration
    public int Tab { get; set; }
    Property Value
    Type Description
    int
    Exceptions
    Type Condition
    ArgumentException

    If the size is non-positive

    Methods

    | Edit this page View Source

    ForMicrosoftSqlServer()

    Creates a new instance of the WKTWriter class suitable for MSSQL's non- standard WKT format.

    Declaration
    public static WKTWriter ForMicrosoftSqlServer()
    Returns
    Type Description
    WKTWriter

    A new instance of the WKTWriter class suitable for MSSQL's non-standard WKT format.

    | Edit this page View Source

    ToLineString(Coordinate, Coordinate)

    Generates the WKT for a LineString specified by two Coordinates.

    Declaration
    public static string ToLineString(Coordinate p0, Coordinate p1)
    Parameters
    Type Name Description
    Coordinate p0

    The first coordinate.

    Coordinate p1

    The second coordinate.

    Returns
    Type Description
    string

    The WKT

    | Edit this page View Source

    ToLineString(CoordinateSequence)

    Generates the WKT for a N-point LineString specified by a CoordinateSequence.

    Declaration
    public static string ToLineString(CoordinateSequence seq)
    Parameters
    Type Name Description
    CoordinateSequence seq

    The sequence to write.

    Returns
    Type Description
    string

    The WKT

    | Edit this page View Source

    ToLineString(Coordinate[])

    Generates the WKT for a LINESTRING specified by an array of Coordinates.

    Declaration
    public static string ToLineString(Coordinate[] coord)
    Parameters
    Type Name Description
    Coordinate[] coord

    An array of coordinates

    Returns
    Type Description
    string

    The WKT

    | Edit this page View Source

    ToPoint(Coordinate)

    Generates the WKT for a Point specified by a Coordinate.

    Declaration
    public static string ToPoint(Coordinate p0)
    Parameters
    Type Name Description
    Coordinate p0

    The point coordinate.

    Returns
    Type Description
    string

    The WKT

    | Edit this page View Source

    Write(Geometry)

    Converts a Geometry to its Well-known Text representation.

    Declaration
    public virtual string Write(Geometry geometry)
    Parameters
    Type Name Description
    Geometry geometry

    A Geometry to process.

    Returns
    Type Description
    string

    A Geometry Tagged Text string (see the OpenGIS Simple Features Specification).

    | Edit this page View Source

    Write(Geometry, Stream)

    Converts a Geometry to its Well-known Text representation.

    Declaration
    public void Write(Geometry geometry, Stream stream)
    Parameters
    Type Name Description
    Geometry geometry

    A Geometry to process.

    Stream stream

    A Stream to write into

    | Edit this page View Source

    Write(Geometry, TextWriter)

    Converts a Geometry to its Well-known Text representation.

    Declaration
    public virtual void Write(Geometry geometry, TextWriter writer)
    Parameters
    Type Name Description
    Geometry geometry

    A Geometry to process.

    TextWriter writer
    | Edit this page View Source

    WriteFormatted(Geometry)

    Same as write, but with newlines and spaces to make the well-known text more readable.

    Declaration
    public virtual string WriteFormatted(Geometry geometry)
    Parameters
    Type Name Description
    Geometry geometry

    A Geometry to process

    Returns
    Type Description
    string

    A "Geometry Tagged Text" string (see the OpenGIS Simple Features Specification), with newlines and spaces.

    | Edit this page View Source

    WriteFormatted(Geometry, TextWriter)

    Same as write, but with newlines and spaces to make the well-known text more readable.

    Declaration
    public virtual void WriteFormatted(Geometry geometry, TextWriter writer)
    Parameters
    Type Name Description
    Geometry geometry

    A Geometry to process

    TextWriter writer
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX