Create geodesic geometries

Using ArcGIS Runtime SDK for Java, you can create geodesic geometries—lines, circles, ellipses, and segments of ellipses that are spatially accurate and geodesically correct in any projection.

Geodesic geometries

A geodesic geometry is one whose measurements account for the inherent distortion of projected space. A geodesic geometry is useful when you want to create a shape that spans a large distance, such as a flight path across an ocean.

By their nature, maps and geospatial data contain distortion. The act of taking a 3D spherical surface, such as the earth, and projecting it to a flat 2D space warps the spatial relationships between locations on the original surface. To complicate matters, the earth is neither perfectly spherical nor perfectly smooth. It is flattened at the poles, and it bulges at the equator. Map projections and coordinate systems compensate for these irregularities, but they still contain spatial distortion.

A geodesic geometry is created by densifying a planar geometry. For example, given a line on a projected surface, a densify operation calculates intermediate points between the end points by taking into account the earth’s curvature. The result in a Mercator-based projection often results in a curved line as shown in the following illustration. The straight blue line has been geodetically densified into the red line. The green dots show the intermediate points showing how the line has been densified.

Geodesic line

Since a densified line is composed of a succession of points along the entire path of the curve, a densified geometry requires more resources to store and manipulate and is more difficult to edit than a standard geometry.

The geometries you work with in ArcGIS Runtime SDK for Java are not geodesic; they are planar, unless they have been returned from a geodesic operation. Editing or moving a geodesic geometry makes it non-geodesic, so if you need to change or move a geodesic geometry, re-create it instead.

Geodesic geometry types

The following are the types of geodesic geometries you can create:

  • Geodesic line—The shortest line between any two points on the earth's surface on a spheroid (ellipsoid). One example use for a geodesic line is when you want to determine the shortest distance between two cities for an airplane's flight path.
  • Geodesic circle or ellipse—You can use this to create a signal error ellipse. A geodesic ellipse is defined by a center point, geodesic lengths of a major and minor axis, and the azimuth of the major axis. This is also known as a geodesic circle when the major and minor axes are of the same length. Geodesic circles and ellipses can have either a line or polygon geometry.
  • Geodesic segment:—A segment of a geodesic ellipse. The segment is defined by the degree from the major axis to begin at and the degree of the segment (that is the degree of the ellipse pie).

Geodesic operations

The following are the types of geodesic operations you can perform:

  • Move point—Moves a point by a distance and azimuth.
  • Densify line or polygon—Creates a geodesic geometry from a supplied planar line or polygon. To control accuracy of the geodesic geometry, you can optionally specify the maximum distance between vertices, that is the length of segments.
  • Geodesic length—Finds the shortest distance between two points.
  • Geodesic area—Finds the area of the geodesic geometry created from a supplied planar polygon or envelope.

Sample code

For a fully interactive sample showing how to create various types of geodesic geometries, see the Geodesic geometries sample in the sample viewer application installed with ArcGIS Runtime SDK for Java or download it online.