normalizeCentralMeridian static method

Geometry? normalizeCentralMeridian(
  1. Geometry geometry
)

Normalizes the input geometry so that it does not intersect the antimeridian. This may be necessary when wrap around is enabled on the map.

Normalization is used when a geometry intersects the minimum or maximum meridian of the spatial reference, or when the geometry is completely outside of the meridian range. You may wish to use this method to normalize geometries before passing them to methods that require coordinates within the spatial reference domain, for example geodatabase editing methods or geocoding services.

Use this method when editing geometries on a map that has wraparound enabled. For example, if you pan west across the dateline several times and then add new features to a map, the coordinates of the newly added features would correspond to the frame of the map and be incorrectly outside of the spatial reference's maximum extent. Use this method to normalize the geometry coordinates into the correct range.

The geometry's spatial reference must be a pannable projected coordinate system (PCS) or a geographic coordinate system (GCS). A pannable PCS is a rectangular PCS where the x-coordinate range corresponds to a 360-degree range on the defining GCS. A GCS is always pannable.

If geometry or its spatial reference are empty, an empty geometry is returned. If the geometry's spatial reference is not pannable, the input geometry is returned. If the geometry is a non-empty envelope, this method returns a polygon.

Supports true curves.

Parameters:

  • geometry — A geometry object.

Return Value: The normalized geometry.

Implementation

static Geometry? normalizeCentralMeridian(
  Geometry geometry,
) {
  _initializeArcGISEnvironmentIfNeeded();
  final objectHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_GeometryEngine_normalizeCentralMeridian(
      geometry._handle,
      errorHandler,
    );
  });
  return Geometry._fromHandle(
    objectHandle,
  );
}