@Immutable public class HorizCoordSys extends Object
1) has x,y,proj (1D) isProjection 2) lat,lon (1D) isLatLon1D 3) lat,lon (2D) class HorizCoordSys2D 4) has x,y,proj and lat,lon (2D) LOOK 2D not used ?
Must be exactly one in a CoverageDataset.
Modifier and Type | Class and Description |
---|---|
static class |
HorizCoordSys.CoordReturn |
Modifier and Type | Field and Description |
---|---|
protected LatLonAxis2D |
latAxis2D |
protected LatLonAxis2D |
lonAxis2D |
Modifier | Constructor and Description |
---|---|
protected |
HorizCoordSys(CoverageCoordAxis1D xAxis,
CoverageCoordAxis1D yAxis,
CoverageCoordAxis latAxis,
CoverageCoordAxis lonAxis,
CoverageTransform transform) |
protected final LatLonAxis2D latAxis2D
protected final LatLonAxis2D lonAxis2D
protected HorizCoordSys(CoverageCoordAxis1D xAxis, CoverageCoordAxis1D yAxis, CoverageCoordAxis latAxis, CoverageCoordAxis lonAxis, CoverageTransform transform)
public static HorizCoordSys factory(CoverageCoordAxis1D xAxis, CoverageCoordAxis1D yAxis, CoverageCoordAxis latAxis, CoverageCoordAxis lonAxis, CoverageTransform transform)
public String getName()
public boolean isProjection()
public boolean isLatLon2D()
public List<CoverageCoordAxis> getCoordAxes()
public CoverageTransform getTransform()
public Optional<HorizCoordSys> subset(SubsetParams params)
public LatLonPoint getLatLon(int yindex, int xindex)
public List<RangeIterator> getRanges()
public CoverageCoordAxis1D getXAxis()
public CoverageCoordAxis1D getYAxis()
public LatLonAxis2D getLonAxis2D()
public LatLonAxis2D getLatAxis2D()
public Optional<HorizCoordSys.CoordReturn> findXYindexFromCoord(double x, double y)
public ProjectionRect calcProjectionBoundingBox()
isn't a projection
, than null
is returned.public LatLonRect calcLatLonBoundingBox()
connected latitude/longitude boundary
.
If this CRS is a projection
, its lat/lon boundary is computed by converting each point
in its projection boundary
to latitude/longitude using the
projection
.
public List<LatLonPointNoNormalize> calcConnectedLatLonBoundaryPoints()
calcConnectedLatLonBoundaryPoints(int, int)
with Integer.MAX_VALUE
as both arguments.
In effect, the boundary will contain ALL of the points along the edges of the CRS.public List<LatLonPointNoNormalize> calcConnectedLatLonBoundaryPoints(int maxPointsInYEdge, int maxPointsInXEdge)
(y[0], x[0])
--and consists of the points that lie along the bottom,
right, top, and left edges, in that order.
The maxPointsInYEdge
parameter establishes a limit on the number of boundary points that'll be included
from the right and left edges. maxPointsInXEdge
establishes a similar limit for the bottom and top edges.
The size of the returned list will be ≤ 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. Integer.MAX_VALUE
works great. In that case, the size of the returned list will be
2 * numXcoords + 2 * numYcoords
.
If this CRS is a projection
, the lat/lon boundary is computed by converting each point
in its projection boundary
to latitude/longitude using the
projection
.
Points in the boundary will be 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.
maxPointsInYEdge
- the maximum number of boundary points to include from the right and left edges.maxPointsInXEdge
- the maximum number of boundary points to include from the bottom and top edges.public List<ProjectionPoint> calcProjectionBoundaryPoints()
calcProjectionBoundaryPoints(int, int)
with Integer.MAX_VALUE
as both arguments.
In effect, the boundary will contain ALL of the points along the edges of the CRS.public List<ProjectionPoint> calcProjectionBoundaryPoints(int maxPointsInYEdge, int maxPointsInXEdge)
(y[0], x[0])
--and consists of the points that lie along the bottom,
right, top, and left edges, in that order.
The maxPointsInYEdge
parameter establishes a limit on the number of boundary points that'll be included
from the right and left edges. maxPointsInXEdge
establishes a similar limit for the bottom and top edges.
The size of the returned list will be ≤ 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. Integer.MAX_VALUE
works great. In that case, the size of the returned list will be
2 * numXcoords + 2 * numYcoords
.
maxPointsInYEdge
- the maximum number of boundary points to include from the right and left edges.maxPointsInXEdge
- the maximum number of boundary points to include from the bottom and top edges.UnsupportedOperationException
- if this CRS is not a projection.public static List<LatLonPointNoNormalize> connectLatLonPoints(List<LatLonPoint> points)
Two points are "connected" if the absolute difference of their normalized
longitudes
is ≤180
. For example, the longitudes 112
and 124
are connected. So are
15
and -27
.
Two points may be "disconnected" if they lie on opposite sides of the international date line. For example,
the longitudes 175
and -175
are disconnected because their absolute difference is 350
,
which is >180
. To connect the two points, we adjust the second longitude to an equivalent value
in the range [firstLon ± 180]
by adding or subtracting 360
. So, -175
would become
185
. We perform this adjustment for each pair of adjacent elements in the list.
Performing the above adjustment will result in longitudes that lie outside of the normalized range of
([-180, 180]
). To be precise, if adjustments are necessary, all of the longitudes in the returned list
will be in either [-360, 0]
or [0, 360]
. Consequently, adjusted points cannot be returned as
LatLonPoint
s; they are returned as LatLonPointNoNormalize
objects instead.
Longitudes lon1
and lon2
are considered equivalent if lon1 == lon2 + 360 * i
, for some
integer i
.
points
- a sequence of normalized lat/lon points that potentially crosses the international date line.public String getLatLonBoundaryAsWKT()
getLatLonBoundaryAsWKT(int, int)
with Integer.MAX_VALUE
as both arguments.
In effect, the boundary will contain ALL of the points along the edges of the CRS.public String getLatLonBoundaryAsWKT(int maxPointsInYEdge, int maxPointsInXEdge)
latitude/longitude boundary
of this coordinate
reference system as a polygon in WKT. It is used in the OpenLayers map in NCSS, as well as the
"datasetBoundaries" endpoint.maxPointsInYEdge
- the maximum number of boundary points to include from the right and left edges.maxPointsInXEdge
- the maximum number of boundary points to include from the bottom and top edges.public String getLatLonBoundaryAsGeoJSON()
getLatLonBoundaryAsGeoJSON(int, int)
with Integer.MAX_VALUE
as both arguments.
In effect, the boundary will contain ALL of the points along the edges of the CRS.public String getLatLonBoundaryAsGeoJSON(int maxPointsInYEdge, int maxPointsInXEdge)
getLatLonBoundaryAsWKT()
, but returns a GeoJSON polygon instead.