Package uk.ac.rdg.resc.edal.domain
Class MapDomain
- java.lang.Object
-
- uk.ac.rdg.resc.edal.domain.MapDomain
-
- All Implemented Interfaces:
Serializable,DiscreteDomain<HorizontalPosition,GridCell2D>,DiscreteHorizontalDomain<GridCell2D>,Domain<HorizontalPosition>,HorizontalDomain,HorizontalGrid,RectilinearGrid
public class MapDomain extends Object implements RectilinearGrid, Serializable
Implementation of aMapDomain- Author:
- Guy
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MapDomain(BoundingBox bbox, int width, int height, Double z, org.joda.time.DateTime time)Instantiates aMapDomainbased on aRegularGridand z/t values, with no specified vertical CRS.MapDomain(RectilinearGrid hGrid, Double z, org.joda.time.DateTime time)Instantiates aMapDomainfrom aRectilinearGridand z/t values, with no specified vertical CRS.MapDomain(RectilinearGrid hGrid, Double z, VerticalCrs vCrs, org.joda.time.DateTime time)Instantiates aMapDomainfrom aRectilinearGridand z/t values
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(HorizontalPosition position)booleanequals(Object obj)GridCoordinates2DfindIndexOf(HorizontalPosition position)Finds the index of the specified position within this domainBoundingBoxgetBoundingBox()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 domainArray2D<GridCell2D>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.RectilinearGridgetHorizontalGrid()org.joda.time.DateTimegetTime()VerticalCrsgetVerticalCrs()ReferenceableAxis<Double>getXAxis()Gets the x axis of the grid.intgetXSize()ReferenceableAxis<Double>getYAxis()Gets the y axis of the grid.intgetYSize()DoublegetZ()inthashCode()voidsetVerticalCrs(VerticalCrs vCrs)longsize()Returns the size of this domain.
-
-
-
Constructor Detail
-
MapDomain
public MapDomain(BoundingBox bbox, int width, int height, Double z, org.joda.time.DateTime time)
Instantiates aMapDomainbased on aRegularGridand z/t values, with no specified vertical CRS.
-
MapDomain
public MapDomain(RectilinearGrid hGrid, Double z, org.joda.time.DateTime time)
Instantiates aMapDomainfrom aRectilinearGridand z/t values, with no specified vertical CRS. Used in cases whereVerticalCrsis not important- Parameters:
hGrid- TheRectilinearGridforming theMapDomainz- The vertical value of thisMapDomaintime- The time value of thisMapDomain
-
MapDomain
public MapDomain(RectilinearGrid hGrid, Double z, VerticalCrs vCrs, org.joda.time.DateTime time)
Instantiates aMapDomainfrom aRectilinearGridand z/t values- Parameters:
hGrid- TheRectilinearGridforming theMapDomainz- The vertical value of thisMapDomainvCrs- TheVerticalCrsunder which to interpretztime- The time value of thisMapDomain
-
-
Method Detail
-
getZ
public Double getZ()
-
getVerticalCrs
public VerticalCrs getVerticalCrs()
-
setVerticalCrs
public void setVerticalCrs(VerticalCrs vCrs)
-
getTime
public org.joda.time.DateTime getTime()
-
size
public long size()
Description copied from interface:HorizontalGridReturns the size of this domain. Equivalent togetXSize() * getYSize()- Specified by:
sizein interfaceDiscreteHorizontalDomain<GridCell2D>- Specified by:
sizein interfaceHorizontalGrid
-
getXSize
public int getXSize()
- Specified by:
getXSizein interfaceHorizontalGrid- Returns:
- The size of the x-axis
-
getYSize
public int getYSize()
- Specified by:
getYSizein interfaceHorizontalGrid- Returns:
- The size of the y-axis
-
getXAxis
public ReferenceableAxis<Double> getXAxis()
Description copied from interface:RectilinearGridGets the x axis of the grid.- Specified by:
getXAxisin interfaceRectilinearGrid
-
getYAxis
public ReferenceableAxis<Double> getYAxis()
Description copied from interface:RectilinearGridGets the y axis of the grid.- Specified by:
getYAxisin interfaceRectilinearGrid
-
findIndexOf
public GridCoordinates2D findIndexOf(HorizontalPosition position)
Description copied from interface:HorizontalGridFinds the index of the specified position within this domain- Specified by:
findIndexOfin interfaceHorizontalGrid- Parameters:
position- The position to find the index of- Returns:
- A
GridCoordinates2Dobject representing the index of the position within the domain, ornullif the position is outside the domain.
-
getDomainObjects
public Array2D<GridCell2D> getDomainObjects()
Description copied from interface:DiscreteDomainReturns anArrayof domain objects that comprise this domain.- Specified by:
getDomainObjectsin interfaceDiscreteDomain<HorizontalPosition,GridCell2D>- Specified by:
getDomainObjectsin interfaceHorizontalGrid
-
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
-
getHorizontalGrid
public RectilinearGrid getHorizontalGrid()
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceHorizontalGrid- Overrides:
hashCodein classObject
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin interfaceHorizontalGrid- Overrides:
equalsin classObject
-
-