Skip to content

Geometry handling in OrbitSailor

Interpreting Polygon Edges

When you provide a GeoJSON geometry to the OrbitSailor service, whether as a regional filter for a data service or as a region for an archive query, you are defining a set of points connected by implied edges.

The interpretation of these edges significantly impacts the resulting shape. To address this, the OrbitSailor service allows you to specify how the edges should be interpreted within the GeoJSON feature.

Example: Large Pacific Triangle

Consider a triangle spanning a large portion of the Pacific Ocean:

json
{
  "type": "Feature",
  "properties": {
    "orbitsailor:edge_interpretation": "webmercator_line"
  },
  "geometry": {
    "coordinates": [
      [
        [-131.56898462637392, 31.212158269420797],
        [-167.1580029897138, -16.920569801939322],
        [-83.70176180596937, -27.358006281853193],
        [-131.56898462637392, 31.212158269420797]
      ]
    ],
    "type": "Polygon"
  }
}

In the illustration below, the green lines represent the triangle's edges calculated as the shortest paths on the globe (great circles), while the black lines depict straight edges in a Web Mercator projection. As shown, the resulting areas differ significantly.

Huge triangle in mercator projection

Selecting Edge Interpretation

The OrbitSailor platform offers you to control the computation by setting the orbitsailor:edge_interpretation property in the GeoJSON feature

Supported values include:

valueInterpretation
webmercator_lineInterpret the edges as straight lines one Meb Mercator projected map. This is the default if no value is specified.
great_circleInterpret the edges as the shortest paths on the globe between the points
equirectangularTreats longitude and latitude as flat Cartesian coordinates. Not recommended for general use.

Antimeridian handling

OrbitSailor also provides robust handling of geometries that cross the 180th meridian (antimeridian).

Example: Antimeridian crossing Triangle

Consider the following polygon that spans the 180th meridian:

json
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "coordinates": [
          [
            [151.20785561524684, 20.82393710157679],
            [-154.28046940745617, -4.301054653459445],
            [-153.38057707724903, 48.31197791103122],
            [151.20785561524684, 20.82393710157679]
          ]
        ],
        "type": "Polygon"
      }
    }
  ]
}

Instead of interpreting the polygon as wrapping around the entire globe, OrbitSailor assumes the shortest longitudinal direction. This results in a triangle interpreted as shown:

Antimeridian crossing triangle

OrbitSailor also accepts longitude values outside the standard range (-180°, 180°). The following representation of the same polygon, with an extended longitude value, is also valid:

polygon
json
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "coordinates": [
          [
            [-209.20785561524684, 20.82393710157679],
            [-154.28046940745617, -4.301054653459445],
            [-153.38057707724903, 48.31197791103122],
            [-209.20785561524684, 20.82393710157679]
          ]
        ],
        "type": "Polygon"
      }
    }
  ]
}