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 booleancontains(HorizontalPosition position)booleanequals(Object obj)intfindIndexOf(HorizontalPosition position)Finds the index of the closest mesh vertex to the supplied positionstatic HorizontalMeshfromBounds(List<HorizontalPosition> positions, List<Polygon> boundaries)static HorizontalMeshfromConnections(List<HorizontalPosition> positions, List<int[]> connections, int connectionsStartFrom)Create a newHorizontalMeshBoundingBoxgetBoundingBox()Returns the bounding box of the domain in the domain's own coordinate reference system.org.opengis.referencing.crs.CoordinateReferenceSystemgetCoordinateReferenceSystem()Returns the co-ordinate reference system of this domainArray<HorizontalCell>getDomainObjects()Returns anArrayof domain objects that comprise this domain.org.opengis.metadata.extent.GeographicBoundingBoxgetGeographicBoundingBox()Returns the bounding box of the domain in WGS84 latitude-longitude coordinates.inthashCode()longsize()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- AListofHorizontalPositions which make up the vertices of this meshconnections- AListof arrays ofints 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 theHorizontalPositionListwhich 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:DiscreteDomainReturns anArrayof domain objects that comprise this domain.- Specified by:
getDomainObjectsin interfaceDiscreteDomain<HorizontalPosition,HorizontalCell>
-
contains
public boolean contains(HorizontalPosition position)
- Specified by:
containsin interfaceDomain<HorizontalPosition>- Returns:
- true if the given position is contained within this domain.
-
getBoundingBox
public BoundingBox getBoundingBox()
Description copied from interface:HorizontalDomainReturns 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 aBoundingBoxin a different CRS. Consequently thisBoundingBoxis not guaranteed to be a tight bound around the domain.- Specified by:
getBoundingBoxin interfaceHorizontalDomain
-
getGeographicBoundingBox
public org.opengis.metadata.extent.GeographicBoundingBox getGeographicBoundingBox()
Description copied from interface:HorizontalDomainReturns the bounding box of the domain in WGS84 latitude-longitude coordinates.- Specified by:
getGeographicBoundingBoxin interfaceHorizontalDomain
-
getCoordinateReferenceSystem
public org.opengis.referencing.crs.CoordinateReferenceSystem getCoordinateReferenceSystem()
Description copied from interface:HorizontalDomainReturns the co-ordinate reference system of this domain- Specified by:
getCoordinateReferenceSystemin interfaceHorizontalDomain
-
size
public long size()
Description copied from interface:DiscreteHorizontalDomainReturns the size of this domain- Specified by:
sizein interfaceDiscreteHorizontalDomain<HorizontalCell>
-
findIndexOf
public int findIndexOf(HorizontalPosition position)
Finds the index of the closest mesh vertex to the supplied position- Parameters:
position- TheHorizontalPositionto test- Returns:
- The index in the original position list, or -1 if the supplied
position is outside the boundary of this
HorizontalMesh
-
-