PgCircle
Namespace: Ankus
Assembly: Ankus.Runtime.dll
A PostgreSQL circle with double-precision center and radius. PostgreSQL validates the radius on datum conversion. Equality compares the stored center and radius, not area or geometric tolerance.
public readonly struct PgCircle : ISpanFormattable, IFormattable, IParsable<PgCircle>, IEquatable<PgCircle>Implements: ISpanFormattable, IFormattable, IParsable<PgCircle>, IEquatable<PgCircle>
Constructors
Section titled “Constructors”PgCircle(PgPoint, double)
Section titled “PgCircle(PgPoint, double)”A PostgreSQL circle with double-precision center and radius. PostgreSQL validates the radius on datum conversion. Equality compares the stored center and radius, not area or geometric tolerance.
public PgCircle(PgPoint Center, double Radius)Parameters:
Center — PgPoint
The center point.
Radius — double
The radius. Negative radii cannot be stored in PostgreSQL.
Properties
Section titled “Properties”Center
Section titled “Center”The center point.
public PgPoint Center { get; init; }Value: PgPoint
Radius
Section titled “Radius”The radius. Negative radii cannot be stored in PostgreSQL.
public double Radius { get; init; }Value: double
Methods
Section titled “Methods”Deconstruct(out PgPoint, out double)
Section titled “Deconstruct(out PgPoint, out double)”public void Deconstruct(out PgPoint Center, out double Radius)Parameters:
Center — PgPoint
Radius — double
Equals(PgCircle)
Section titled “Equals(PgCircle)”public bool Equals(PgCircle other)Parameters:
other — PgCircle
Returns: bool
Equals(object)
Section titled “Equals(object)”public override bool Equals(object obj)Parameters:
obj — object
Returns: bool
GetHashCode()
Section titled “GetHashCode()”public override int GetHashCode()Returns: int
Parse(string)
Section titled “Parse(string)”Parses a circle using PostgreSQL on the active backend.
public static PgCircle Parse(string text)Parameters:
text — string
The circle text.
Returns: PgCircle
The parsed circle.
ToString()
Section titled “ToString()”Formats the center and radius without backend access.
public override string ToString()Returns: string
The circle text.
ToString(string?, IFormatProvider?)
Section titled “ToString(string?, IFormatProvider?)”Formats the value as PostgreSQL’s canonical text, the same text as ToString().
public string ToString(string? format, IFormatProvider? formatProvider)Parameters:
format — string
Null or empty; PostgreSQL text has one canonical form.
formatProvider — IFormatProvider
Ignored: the text does not depend on culture.
Returns: string
The canonical text.
Exceptions:
- FormatException: A format is specified.
TryFormat(Span<char>, out int, ReadOnlySpan<char>, IFormatProvider?)
Section titled “TryFormat(Span<char>, out int, ReadOnlySpan<char>, IFormatProvider?)”Copies the value’s canonical PostgreSQL text into a span, as interpolated strings and other span-based formatters request it.
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)Parameters:
destination — Span<char>
The span that receives the text.
charsWritten — int
The number of characters written.
format — ReadOnlySpan<char>
Empty; PostgreSQL text has one canonical form.
provider — IFormatProvider
Ignored: the text does not depend on culture.
Returns: bool
Whether the text fit in the destination.
Exceptions:
- FormatException: A format is specified.
TryParse(string?, out PgCircle)
Section titled “TryParse(string?, out PgCircle)”Tries PostgreSQL parsing without swallowing backend-access or operational errors.
public static bool TryParse(string? text, out PgCircle value)Parameters:
text — string
The circle text.
value — PgCircle
The result, or default.
Returns: bool
Whether parsing succeeded.
Invalid input leaves no error pending: PostgreSQL 16 and later report it as a soft input error, and earlier majors roll back an internal subtransaction. Before PostgreSQL 16, transaction callbacks and parallel operations forbid that rollback; native errors there remain pending and throw PgException.
Operators
Section titled “Operators”operator ==(PgCircle, PgCircle)
Section titled “operator ==(PgCircle, PgCircle)”public static bool operator ==(PgCircle left, PgCircle right)Parameters:
left — PgCircle
right — PgCircle
Returns: bool
operator !=(PgCircle, PgCircle)
Section titled “operator !=(PgCircle, PgCircle)”public static bool operator !=(PgCircle left, PgCircle right)Parameters:
left — PgCircle
right — PgCircle
Returns: bool