Skip to content

Main content

Geography: Geographic Latlon Axis Order Swap Tool

Validate and swap one geographic pair under an explicitly supplied latitude/longitude axis order rather than guessing from numeric ranges.

Loading tool…

Description

Return named coordinates and swappedPair [second, first].

Coordinate labels and tokens encode an axis order, sign convention, or formatting policy. Numeric compatibility and text formatting can diagnose ambiguity, but neither establishes the actual coordinate reference or location.

Return named coordinates and swappedPair [second, first].

When to use this tool

Use Geography: Geographic Latlon Axis Order Swap when you need a supplied geographic label or coordinate-convention diagnostic.

How to use the tool and how it works

  1. Enter first, second, inputOrder. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read result. Expand result to inspect the returned fields.

Require inputOrder lat-lon or lon-lat, interpret the first two values accordingly, and validate latitude in [-90, 90] and longitude in [-180, 180]. Return named coordinates and swappedPair [second, first].1

Input fieldMeaning and unitsAccepted input
firstFirstRequired. Finite number.
secondSecondRequired. Finite number.
inputOrderExplicit caller-supplied axis order; not inferred from numeric plausibility.Required. Text; one of "lat-lon", "lon-lat". Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units.
Output fieldInterpretationReturned shape
resultObject containing the calculated members; expand to inspect the fields below.Required. Object.
result.latitudeDegreesLatitude DegreesCalculated result member: number.
result.longitudeDegreesLongitude DegreesCalculated result member: number.
result.swappedPairAlways [second, first]; resulting order depends on inputOrder.Calculated result member: array.
json
{
  "input": {
    "first": 10,
    "second": 20,
    "inputOrder": "lat-lon"
  },
  "output": {
    "result": {
      "latitudeDegrees": 10,
      "longitudeDegrees": 20,
      "swappedPair": [
        20,
        10
      ]
    }
  }
}

Limitations and assumptions

  • The swappedPair always reverses the raw input, so its order depends on inputOrder. No coordinate-reference or datum conversion is performed.
  • Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Read authoritative coordinate metadata when the actual axis order or reference system matters. Keep original numeric precision and explicit sign conventions rather than inferring them from a plausible label.

References

  1. Calculation and input contract: geography/geographic-latlon-axis-order-swap — tool.io

Similar or alternative tools