Skip to content

Main content

Line Two Position Endpoint Feature

Serialize a two-position GeoJSON LineString Feature from explicit longitude-latitude and optional height positions without projecting coordinates.

Loading tool…

Description

Construct a GeoJSON LineString Feature from two matching-width positions.

GeoJSON separates a Feature’s identifier, geometry and properties. Null geometry, an explicit null property and an omitted property are distinct states. Coordinate-order labels do not transform positions, and stringifying a value already entered as a number cannot restore lost identifier precision or spelling.

Construct a GeoJSON LineString Feature from two matching-width positions.

When to use this tool

Use Line Two Position Endpoint Feature when checking the stated restricted GeoJSON construction, property or identifier convention.

How to use the tool and how it works

  1. Enter featureId, startPosition, endPosition. Follow any array-alignment requirements below. 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 featureJson. Use the output convention below.

Require startPosition to contain two or three finite coordinates and endPosition to have the same length. Serialize a Feature with supplied ID, a two-position LineString and empty properties.1

GeoJSON positions use longitude then latitude, with optional altitude. This constructor preserves supplied coordinates without checking geographic ranges.2

Input fieldMeaning and unitsAccepted input
featureIdFeature IdRequired. Text; maximum UTF-16 length 8192.
startPositionTwo or three finite coordinates; longitude/latitude range and order are not validated.Required. Array of finite number; maximum items 256.
endPositionEnd PositionRequired. Array of finite number; maximum items 256.
Output fieldInterpretationReturned shape
featureJsonFeature JsonRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "featureId": "F17",
    "startPosition": [
      1,
      2
    ],
    "endPosition": [
      3,
      4
    ]
  },
  "output": {
    "featureJson": "{\"type\":\"Feature\",\"id\":\"F17\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[1,2],[3,4]]},\"properties\":{}}"
  }
}

Limitations and assumptions

  • Positions are not range-checked or reprojected; the tool does not verify longitude/latitude order, geodesic shape or complete RFC 7946 compatibility.
  • 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

Validate the complete Feature against the intended GeoJSON contract and use verified longitude/latitude and datum conventions for actual geographic data exchange.

References

  1. Calculation and input contract: geojson/line-two-position-endpoint-feature — tool.io

  2. RFC 7946: The GeoJSON Format — IETF

Similar or alternative tools