LuciadCPillar C# 2023.1.04
|
Class to format points as LonLat coordinates. More...
Public Member Functions | |
LonLatFormat () | |
Creates a new LonLatFormat from the default format "lat(-DMS), lon(-DMS)". More... | |
LonLatFormat (string pattern) | |
Creates a new LonLatFormat from the given pattern. More... | |
void | Dispose () |
string | Format (Luciad.Cartesian.Coordinate lonLatCoord) |
Format the given LonLat Coordinate according to this LonLatFormat. More... | |
string | Format (Luciad.Geometries.Point lonLatPoint) |
Format the given Point according to this LonLatFormat. More... | |
string | FormatLat (double lat) |
Format the given latitude according to this LonLatFormat. More... | |
string | FormatLon (double lon) |
Format the given longitude according to this LonLatFormat. More... | |
string | ToPattern () |
Get the pattern string used to create this format. More... | |
Static Public Member Functions | |
static bool | IsValidFormatString (string format) |
Returns if the given string is a valid LonLat format string. More... | |
Class to format points as LonLat coordinates.
The EBNF for the pattern syntax is pattern = lon, separator, lat | lat, separator, lon lon = "lon(", { "+" | "-" }, { axis | degrees | minutes | seconds }+, ")" lat = "lat(", { "+" | "-" }, { axis | degrees | minutes | seconds }+, ")" axis = "a" degrees = { "d" | "D" }+, { digit }* minutes = { "m" | "M" }+, { digit }* seconds = { "s" | "S" }+, { digit }* digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" separator = { ? any character ? } where "{ x }" means x is optional, "{ x }*" means x occurs zero or more times, and "{ x }+" means x occurs at least once. The table below details the meaning of each pattern character. Symbol Meaning Examples
d Integer degrees.* d: 12, ddd: 012
d<n> Degrees with <n> fractional digits.* d2: 12.34, ddd2: 012.34
D Integer degrees with degrees symbol.* D: 12°, DDD: 012°
D<n> Degrees with symbol and <n> fractional digits.* D2: 12.34°, DDD2: 012.34°
m Integer minutes.* m: 3, mm: 03
m<n> Minutes with <n> fractional digits.* m2: 3.45, mm2: 03.45
M Integer minutes with degrees symbol.* M: 3', MM: 03'
M<n> Minutes with symbol and <n> fractional digits.* M2: 3.45', MM2: 03.45'
s Integer seconds.* s: 7, ss: 07
s<n> Seconds with <n> fractional digits.* s2: 7.89, ss2: 07.89
S Integer seconds with degrees symbol.* S: 7", SS: 07"
S<n> Seconds with symbol and <n> fractional digits.* S2: 7.89", SS2: 07.89"
a Hemisphere indicator N, S, E, W
Repeating this character pads the number with leading zeros. As an example, the default formatting pattern is "lat(-DMS), lon(-DMS)". This results in a format that generates formatted coordinates like -12°34'56", 123°45'12". 2023.1
|
inline |
Creates a new LonLatFormat from the default format "lat(-DMS), lon(-DMS)".
|
inline |
Creates a new LonLatFormat from the given pattern.
pattern
the pattern string.
luciad::InvalidArgumentException
if pattern is not a valid pattern.
|
inline |
|
inline |
Format the given LonLat Coordinate according to this LonLatFormat.
lonLatCoord
the Coordinate.
the formatted string.
|
inline |
Format the given Point according to this LonLatFormat.
lonLatPoint
the Point.
the formatted string.
|
inline |
Format the given latitude according to this LonLatFormat.
lat
the latitude.
the formatted string.
|
inline |
Format the given longitude according to this LonLatFormat.
lon
the longitude.
the formatted string.
|
inlinestatic |
Returns if the given string is a valid LonLat format string.
format
the format string.
true if the string is a valid LonLat format string.
|
inline |
Get the pattern string used to create this format.
the pattern string.