This sample demonstrates how to calculate distances and visualize geodetic curves between two points. It supports multiple curve types and spatial references, allowing users to explore how distance and azimuth vary across different projections.

The following operators are used:

  • geodeticUtilsOperator – Calculates distance and azimuth between points. Additionally, translates points by a specific distance and aziumuth.
  • geodeticDensifyOperator – Adds intermediate points along curves for smoother rendering.
  • projectOperator – Transforms geometries between spatial references.

Key features

There are several interactive and visual elements designed to help you explore geodetic curve calculations:

  • Curve Type Selector – Choose between geodesic, great-elliptic, normal-section, and loxodrome paths to see how each affects distance and azimuth.
  • Spatial Reference Selector – Switch between different projections (e.g., WGS84, Web Mercator, World Robinson) to observe how geometry changes.
  • Draggable Points – Move the two endpoint markers to dynamically recalculate and redraw the curved polyline.
  • Azimuth Arcs – Visualize the angular direction from each endpoint toward the other.
  • Densified Lines – Display intermediate points along the curve for a smoother representation.

How to use the sample

Follow these steps to interact with the map:

  1. Click and then drag either of the two black circle marker symbols to new locations on the map. They represent the endpoints of the curved polyline.
  2. Select different curve types from the radio button group in the top panel.
  3. Change the spatial reference using the dropdown menu.
  4. Observe updates to:
    • Distance (in kilometers)
    • Azimuth angles (in degrees)
    • Curve shape and densification points
    • And, the differences in distance and angles between the current curve type and the previous one.

Explanation of curve types

There are four curve types that you can explore visually on the map. Each represents a different way to define a geodetic line between the two points:

  • Geodesic – The shortest path between two points on the ellipsoid (including skew components; this curve does not lie in a plane).
  • Great-Elliptic – The elliptic arc formed by intersecting the ellipsoid with the plane containing the ellipsoid center and both points.
  • Normal-Section – The curve formed by intersecting the ellipsoid with the plane containing both points and the ellipsoid’s normal vector at the first point.
  • Loxodrome (Rhumb Line) – A path of constant bearing, often used in navigation.

Spatial references

This sample illustrates how geodetic calculations respond to changes in the spatial reference. Switching the spatial reference alters how distances, angles, and curve shapes are computed and displayed:

  • Different projections, such as Web Mercator, Robinson, and Eckert I, distort distances, shapes, or directions in varying ways depending on location.
  • Some projections are designed to preserve area, others to preserve shape (conformal), and some to preserve direction (azimuthal or loxodromic).

Because each projection changes how the Earth’s curved surface is represented on a flat map, the same two points may appear farther apart or closer together, which directly affects the calculated geodetic distance.

When you select a spatial reference from the dropdown in this sample, the map reprojects the geometry and recalculates the geodetic measurements. This allows you to see how each projection’s properties influence the results in real time.

The table below summarizes how each spatial reference in this sample affects the results and what properties it preserves:

Projection NameWKIDType / Property PreservedDistortion Characteristics
WGS844326Geographic coordinate system (no projection)Coordinates are in degrees. Distances and shapes are distorted except near the equator. They are not equal-area or conformal.
Web Mercator102100Conformal (preserves shape locally)Distorts area significantly at high latitudes. For example Greenland appears to be about the same size as Africa. Angles/directions are accurate locally.
World Robinson54030Compromise projectionBalances shape and area distortion where neither property is perfectly preserved. This is good for thematic world maps.
NAD83 / Arizona East2222State Plane projection (conformal)Minimizes distortion for a specific region (Arizona East). It preserves shape locally and distances are accurate within the zone. Cannot represent the entire globe; for example locations in Asia are not representable.
Goode Homolosine54052Equal-areaPreserves area, but distorts shape and direction. This is often used for global land cover maps.
North Pole Azimuthal Equidistant102016Equidistant from center pointPreserves distances from the center (North Pole), but distorts shape and area away from center.
Spilhaus54099Equal-areaShows oceans as a continuous map and preserves area, but distorts shape heavily.
World Eckert I54015Equal-areaPreserves area, but distorts shape and direction. Often used for thematic maps where area accuracy is important.

Visual Legend

The map uses color coding to distinguish between the different elements:

  • Dotted blue line – Represents the selected geodetic path (curved line segment) between the two black circle marker symbols. The curve type (geodesic, great-elliptic, normal-section, or loxodrome) determines its shape. The dotted style highlights that this is a geodetic path rather than a simple straight line in the current coordinate system. Spacing between each pair of adjacent dots on the line is equal with respect to the current geodetic curve type.
  • Dark blue lines – North-South and East-West crosshairs at points, used for reference and alignment.
  • Light blue arcs with semi-transparent fill – Azimuth curves showing the angular direction from each endpoint toward the other.
  • Green fill – Country polygons for geographic context.
  • White text with blue background – Distance and azimuth labels.

Tip: The dotted blue line will change shape and length when you switch curve types or spatial references. This allows you to visually compare how different geodetic calculations and map projections affect the path between the same two points.