cdm/src/main/java/ucar/nc2/ft2/coverage/HorizCoordSys.java
public List<LatLonPointNoNormalize> calcConnectedLatLonBoundaryPoints(int maxPointsInYEdge, int maxPointsInXEdge) {
    List<LatLonPoint> points;

    if (isProjection) {
      points = calcLatLonBoundaryPointsFromProjection(maxPointsInYEdge, maxPointsInXEdge);
    } else if (isLatLon1D) {
      points = calcLatLon1DBoundaryPoints(maxPointsInYEdge, maxPointsInXEdge);
    } else if (isLatLon2D) {
      points = calcLatLon2DBoundaryPoints(maxPointsInYEdge, maxPointsInXEdge);
    } else {
      throw new AssertionError("HorizCoordSys was not a projection, latLon1D, or latLon2D.");
    }

    return connectLatLonPoints(points);
  }
public List<LatLonPointNoNormalize> calcConnectedLatLonBoundaryPoints(int maxPointsInYEdge, int maxPointsInXEdge) {
    List<LatLonPoint> points;

    if (isProjection) {
      points = calcLatLonBoundaryPointsFromProjection(maxPointsInYEdge, maxPointsInXEdge);
    } else if (isLatLon1D) {
      points = calcLatLon1DBoundaryPoints(maxPointsInYEdge, maxPointsInXEdge);
    } else if (isLatLon2D) {
      points = calcLatLon2DBoundaryPoints(maxPointsInYEdge, maxPointsInXEdge);
    } else {
      throw new AssertionError("HorizCoordSys was not a projection, latLon1D, or latLon2D.");
    }

    return connectLatLonPoints(points);
  }
Calculates the latitude/longitude boundary of this coordinate reference system. The boundary starts at the lower
left corner of the coverage--i.e. {@code (y[0], x[0])}--and consists of the points that lie along the bottom,
right, top, and left edges, in that order.
<p>
The {@code maxPointsInYEdge} parameter establishes a limit on the number of boundary points that'll be included
from the right and left edges. {@code maxPointsInXEdge} establishes a similar limit for the bottom and top edges.
The size of the returned list will be {@code ≤ 2 * maxPointsInYEdge + 2 * maxPointsInXEdge}. Note that the corners
are always included, regardless of the arguments. If you wish to include ALL of the points along the edges in
the boundary, simply choose values for the parameters that are greater than the lengths of the corresponding
axes in the CRS. {@link Integer#MAX_VALUE} works great. In that case, the size of the returned list will be
{@code 2 * numXcoords + 2 * numYcoords}.
<p>
If this CRS {@link #isProjection is a projection}, the lat/lon boundary is computed by converting each point
in its {@link #calcProjectionBoundaryPoints() projection boundary} to latitude/longitude using the
{@link Projection projection}.
<p>
Points in the boundary will be {@link #connectLatLonPoints connected}. This facilitates proper interpretation of
the boundary if it's rendered as a georeferenced polygon, particularly when the boundary crosses the international
date line.

@param maxPointsInYEdge  the maximum number of boundary points to include from the right and left edges.
@param maxPointsInXEdge  the maximum number of boundary points to include from the bottom and top edges.
@return  the connected latitude/longitude boundary of this CRS.