Package uk.ac.rdg.resc.edal.grid
Class HorizontalMesh
- java.lang.Object
-
- uk.ac.rdg.resc.edal.grid.HorizontalMesh
-
- All Implemented Interfaces:
Serializable
,DiscreteDomain<HorizontalPosition,HorizontalCell>
,DiscreteHorizontalDomain<HorizontalCell>
,Domain<HorizontalPosition>
,HorizontalDomain
public class HorizontalMesh extends Object implements DiscreteHorizontalDomain<HorizontalCell>, Serializable
An unstructured mesh in the horizontal plane.- Author:
- Guy Griffiths
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(HorizontalPosition position)
boolean
equals(Object obj)
int
findIndexOf(HorizontalPosition position)
Finds the index of the closest mesh vertex to the supplied positionstatic HorizontalMesh
fromBounds(List<HorizontalPosition> positions, List<Polygon> boundaries)
static HorizontalMesh
fromConnections(List<HorizontalPosition> positions, List<int[]> connections, int connectionsStartFrom)
Create a newHorizontalMesh
BoundingBox
getBoundingBox()
Returns the bounding box of the domain in the domain's own coordinate reference system.org.opengis.referencing.crs.CoordinateReferenceSystem
getCoordinateReferenceSystem()
Returns the co-ordinate reference system of this domainArray<HorizontalCell>
getDomainObjects()
Returns anArray
of domain objects that comprise this domain.org.opengis.metadata.extent.GeographicBoundingBox
getGeographicBoundingBox()
Returns the bounding box of the domain in WGS84 latitude-longitude coordinates.int
hashCode()
long
size()
Returns the size of this domain
-
-
-
Method Detail
-
fromConnections
public static HorizontalMesh fromConnections(List<HorizontalPosition> positions, List<int[]> connections, int connectionsStartFrom)
Create a newHorizontalMesh
- Parameters:
positions
- AList
ofHorizontalPosition
s which make up the vertices of this meshconnections
- AList
of arrays ofint
s which define the connections between the vertices. Each element of the list should consist of at least 3 integers - these are the indices of the points in theHorizontalPosition
List
which make up each cell of the grid.connectionsStartFrom
- In the list of connections, what number refers to the first vertex in the positions list? This is almost always either 0 or 1
-
fromBounds
public static HorizontalMesh fromBounds(List<HorizontalPosition> positions, List<Polygon> boundaries)
-
getDomainObjects
public Array<HorizontalCell> getDomainObjects()
Description copied from interface:DiscreteDomain
Returns anArray
of domain objects that comprise this domain.- Specified by:
getDomainObjects
in interfaceDiscreteDomain<HorizontalPosition,HorizontalCell>
-
contains
public boolean contains(HorizontalPosition position)
- Specified by:
contains
in interfaceDomain<HorizontalPosition>
- Returns:
- true if the given position is contained within this domain.
-
getBoundingBox
public BoundingBox getBoundingBox()
Description copied from interface:HorizontalDomain
Returns the bounding box of the domain in the domain's own coordinate reference system. For domains which do not have a native co-ordinate reference system this may return aBoundingBox
in a different CRS. Consequently thisBoundingBox
is not guaranteed to be a tight bound around the domain.- Specified by:
getBoundingBox
in interfaceHorizontalDomain
-
getGeographicBoundingBox
public org.opengis.metadata.extent.GeographicBoundingBox getGeographicBoundingBox()
Description copied from interface:HorizontalDomain
Returns the bounding box of the domain in WGS84 latitude-longitude coordinates.- Specified by:
getGeographicBoundingBox
in interfaceHorizontalDomain
-
getCoordinateReferenceSystem
public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
Description copied from interface:HorizontalDomain
Returns the co-ordinate reference system of this domain- Specified by:
getCoordinateReferenceSystem
in interfaceHorizontalDomain
-
size
public long size()
Description copied from interface:DiscreteHorizontalDomain
Returns the size of this domain- Specified by:
size
in interfaceDiscreteHorizontalDomain<HorizontalCell>
-
findIndexOf
public int findIndexOf(HorizontalPosition position)
Finds the index of the closest mesh vertex to the supplied position- Parameters:
position
- TheHorizontalPosition
to test- Returns:
- The index in the original position list, or -1 if the supplied
position is outside the boundary of this
HorizontalMesh
-
-