Table of Contents

Class HonuaSpatialReference

Namespace
Honua.Sdk.Geometry
Assembly
Honua.Sdk.Geometry.dll

Represents a spatial reference by WKID, authority/code, or WKT.

public sealed record HonuaSpatialReference : IEquatable<HonuaSpatialReference>
Inheritance
HonuaSpatialReference
Implements
Inherited Members

Properties

Authority

Gets the spatial reference authority, such as EPSG.

public string? Authority { get; }

Property Value

string

Code

Gets the authority code.

public int? Code { get; }

Property Value

int?

Identifier

Gets the stable display identifier for the spatial reference.

public string Identifier { get; }

Property Value

string

LatestVcsWkid

Gets the latest vertical coordinate system WKID when one is available.

public int? LatestVcsWkid { get; }

Property Value

int?

LatestWkid

Gets the latest well-known ID when one is available.

public int? LatestWkid { get; }

Property Value

int?

VcsWkid

Gets the vertical coordinate system WKID when one is available.

public int? VcsWkid { get; }

Property Value

int?

WebMercator

Gets the Web Mercator spatial reference.

public static HonuaSpatialReference WebMercator { get; }

Property Value

HonuaSpatialReference

Wgs84

Gets the WGS84 longitude/latitude spatial reference.

public static HonuaSpatialReference Wgs84 { get; }

Property Value

HonuaSpatialReference

Wkid

Gets the well-known ID when one is available.

public int? Wkid { get; }

Property Value

int?

Wkt

Gets the Well-Known Text definition when one is available.

public string? Wkt { get; }

Property Value

string

Methods

FromAuthorityCode(string, int)

Creates a spatial reference from an authority/code pair.

public static HonuaSpatialReference FromAuthorityCode(string authority, int code)

Parameters

authority string

The coordinate reference system authority.

code int

The authority code.

Returns

HonuaSpatialReference

The spatial reference.

FromWkid(int, int?)

Creates a spatial reference from a well-known ID.

public static HonuaSpatialReference FromWkid(int wkid, int? latestWkid = null)

Parameters

wkid int

The well-known ID.

latestWkid int?

Optional latest well-known ID.

Returns

HonuaSpatialReference

The spatial reference.

FromWkt(string, string?, int?)

Creates a spatial reference from Well-Known Text.

public static HonuaSpatialReference FromWkt(string wkt, string? authority = null, int? code = null)

Parameters

wkt string

The WKT coordinate system definition.

authority string

Optional authority name.

code int?

Optional authority code.

Returns

HonuaSpatialReference

The spatial reference.

Parse(string)

Parses a common CRS identifier such as EPSG:4326, WKID:3857, or an OGC CRS URI.

public static HonuaSpatialReference Parse(string value)

Parameters

value string

The CRS identifier.

Returns

HonuaSpatialReference

The parsed spatial reference.

ToOgcCrsIdentifier()

Converts the spatial reference to an OGC CRS identifier when an authority/code pair is available.

public string? ToOgcCrsIdentifier()

Returns

string

The OGC CRS identifier, or null when the spatial reference is WKT-only.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

TryParse(string?, out HonuaSpatialReference?)

Tries to parse a common CRS identifier.

public static bool TryParse(string? value, out HonuaSpatialReference? spatialReference)

Parameters

value string

The CRS identifier.

spatialReference HonuaSpatialReference

The parsed spatial reference when parsing succeeds.

Returns

bool

True when parsing succeeds.

WithVerticalWkid(int, int?)

Returns a copy of this spatial reference with the specified vertical coordinate system WKID.

public HonuaSpatialReference WithVerticalWkid(int vcsWkid, int? latestVcsWkid = null)

Parameters

vcsWkid int
latestVcsWkid int?

Returns

HonuaSpatialReference