A wide range of formats is supported.
Because there is no universal standard for representing point
coordinates in a string, a wide variety of formats are supported,
including (but not limited to) the examples below. However, note that
only decimal degrees are supported for `LatLonPoint`.
`"45 120"` -> `LatLonPoint(45, 120)`
`"45.0° 120.0°"` -> `LatLonPoint(45.0, 120.0)`
`"-45.0° +120.0°"` -> `LatLonPoint(-45.0, 120.0)`
`"45.0°S, 120.0°W"` -> `LatLonPoint(-45.0, -120.0)`
`"N 500000 197819"` -> `LpsPoint("N", 500000, 197819)`
`"N 500000E 197819N"` -> `LpsPoint("N", 500000, 197819)`
`"N500000E197819N"` -> `LpsPoint("N", 500000, 197819)`
`"23 N 250000.0 0.0"` -> `LtmPoint(23, "N", 250000.0, 0.0)`
`"23 N 250000.0 E 0.0 N"` -> `LtmPoint(23, "N", 250000.0, 0.0)`
`"23N250000.0E0.0N"` -> `LtmPoint(23, "N", 250000.0, 0.0)`
When, and only when, cardinal directions are included, longitude-first
is also supported.
`"120 W 45 S"` -> `LatLonPoint(-45.0, -120.0)`
Conversely, the only deviation from the LGRS standard that is
accommodated for box coordinates is the inclusion of space delimiters.
`"AZS1359008480"` ->
`LpsLgrsBox("A", "Z", "S", "13590", "08480")`
`"AZS13590848"` ->
`LpsLgrsBox("A", "Z", "S", "1359", "0848")`
`"AZSN59H48"` ->
`LpsAccBox("A", "Z", "S", "N", "59", "H", "48")`
`"42SAM2468910101"` ->
`LtmLgrsBox(42, "S", "A", "M", "24689", "10101")`
`"42 S A M 24689 10101"` ->
`LtmLgrsBox(42, "S", "A", "M", "24689", "10101")`
`"42 SAM 24689 10101"` ->
`LtmLgrsBox(42, "S", "A", "M", "24689", "10101")`
For example, "json", "json_full", or "nominal.acc.string".
Both `"json"` and `"json_full"` give JSON representations of the full
conversion tree (described below). The difference is that each
coordinate in `"json"` is represented by a coordinate string only
whereas in `"json_full"`, each coordinate is a JSON object with its own
elements. Alternatively, you can specify a value directly by giving its
path in the `"json"` or `"json_full"` tree, such as
`"nominal.acc"`, `"nominal.acc.condensed"`, or `"forced.lps.string"`.
If you're curious to see what elements are available for targeting, just
generate an example with `"json"` or `"json_full"` and use that as your
reference. (For example, try the input coordinate `"80 4"` to see a
fully populated tree.) Note that when an unpopulated target is
specified, `undefined` is returned, but a target that does not exist
(for example, because of a misspelling) produces an error.
For most locations, only one family among `lps`, `ltm_1`, and `ltm_2` is
populated. However, near zone boundaries, two or all three may be
populated. When all families are relevant, the overall structure is as
shown below. For easy reference, each attribute name representing a
family is shown in square brackets (for example, `[nominal]`, even
though the attribute name is `nominal`) and comments are shown in
angle brackets:
GeoRelatives
├── input_coordinate <parsed input>
├── precision <same as input>
├── extended_ltm <same as input>
├── use_center <same as input>
├── sort_by_center <same as input>
├── note <same as input>
├── latlon <derived from input>
├── [nominal]
│ ├── point: LpsPoint | LtmPoint <same location as `latlon`>
│ ├── lgrs: LpsLgrsBox | LtmLgrsBox <contains `latlon`>
│ ├── acc: LpsAccBox | LtmAccBox <contains `latlon`>
│ ├── corner: LpsPoint | LtmPoint <`lgrs`/`acc` lower-left corner>
│ └── center: LpsPoint | LtmPoint <`lgrs`/`acc` center>
├── [lps]
│ ├── point: LpsPoint <same location as `latlon`>
│ ├── lgrs: LpsLgrsBox <contains `latlon`>
│ ├── acc: LpsAccBox <contains `latlon`>
│ ├── corner: LpsPoint <`lgrs`/`acc` lower-left corner>
│ └── center: LpsPoint <`lgrs`/`acc` center>
├── [ltm_1]
│ ├── point: LtmPoint <same location as `latlon`>
│ ├── lgrs: LtmLgrsBox <contains `latlon`>
│ ├── acc: LtmAccBox <contains `latlon`>
│ ├── corner: LtmPoint <`lgrs`/`acc` lower-left corner>
│ └── center: LtmPoint <`lgrs`/`acc` center>
├── [ltm_2]
│ ├── point: LtmPoint <same location as `latlon`>
│ ├── lgrs: LtmLgrsBox <contains `latlon`>
│ ├── acc: LtmAccBox <contains `latlon`>
│ ├── corner: LtmPoint <`lgrs`/`acc` lower-left corner>
│ └── center: LtmPoint <`lgrs`/`acc` center>
└── [forced]
├── lps: LpsPoint <same location as `latlon`>
└── ltm: LtmPoint <same location as `latlon`>