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 aMapDomain
based on aRegularGrid
and z/t values, with no specified vertical CRS.MapDomain(RectilinearGrid hGrid, Double z, org.joda.time.DateTime time)
Instantiates aMapDomain
from aRectilinearGrid
and z/t values, with no specified vertical CRS.MapDomain(RectilinearGrid hGrid, Double z, VerticalCrs vCrs, org.joda.time.DateTime time)
Instantiates aMapDomain
from aRectilinearGrid
and z/t values
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(HorizontalPosition position)
boolean
equals(Object obj)
GridCoordinates2D
findIndexOf(HorizontalPosition position)
Finds the index of the specified position within this domainBoundingBox
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 domainArray2D<GridCell2D>
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.RectilinearGrid
getHorizontalGrid()
org.joda.time.DateTime
getTime()
VerticalCrs
getVerticalCrs()
ReferenceableAxis<Double>
getXAxis()
Gets the x axis of the grid.int
getXSize()
ReferenceableAxis<Double>
getYAxis()
Gets the y axis of the grid.int
getYSize()
Double
getZ()
int
hashCode()
void
setVerticalCrs(VerticalCrs vCrs)
long
size()
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 aMapDomain
based on aRegularGrid
and z/t values, with no specified vertical CRS.
-
MapDomain
public MapDomain(RectilinearGrid hGrid, Double z, org.joda.time.DateTime time)
Instantiates aMapDomain
from aRectilinearGrid
and z/t values, with no specified vertical CRS. Used in cases whereVerticalCrs
is not important- Parameters:
hGrid
- TheRectilinearGrid
forming theMapDomain
z
- The vertical value of thisMapDomain
time
- The time value of thisMapDomain
-
MapDomain
public MapDomain(RectilinearGrid hGrid, Double z, VerticalCrs vCrs, org.joda.time.DateTime time)
Instantiates aMapDomain
from aRectilinearGrid
and z/t values- Parameters:
hGrid
- TheRectilinearGrid
forming theMapDomain
z
- The vertical value of thisMapDomain
vCrs
- TheVerticalCrs
under which to interpretz
time
- 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:HorizontalGrid
Returns the size of this domain. Equivalent togetXSize() * getYSize()
- Specified by:
size
in interfaceDiscreteHorizontalDomain<GridCell2D>
- Specified by:
size
in interfaceHorizontalGrid
-
getXSize
public int getXSize()
- Specified by:
getXSize
in interfaceHorizontalGrid
- Returns:
- The size of the x-axis
-
getYSize
public int getYSize()
- Specified by:
getYSize
in interfaceHorizontalGrid
- Returns:
- The size of the y-axis
-
getXAxis
public ReferenceableAxis<Double> getXAxis()
Description copied from interface:RectilinearGrid
Gets the x axis of the grid.- Specified by:
getXAxis
in interfaceRectilinearGrid
-
getYAxis
public ReferenceableAxis<Double> getYAxis()
Description copied from interface:RectilinearGrid
Gets the y axis of the grid.- Specified by:
getYAxis
in interfaceRectilinearGrid
-
findIndexOf
public GridCoordinates2D findIndexOf(HorizontalPosition position)
Description copied from interface:HorizontalGrid
Finds the index of the specified position within this domain- Specified by:
findIndexOf
in interfaceHorizontalGrid
- Parameters:
position
- The position to find the index of- Returns:
- A
GridCoordinates2D
object representing the index of the position within the domain, ornull
if the position is outside the domain.
-
getDomainObjects
public Array2D<GridCell2D> getDomainObjects()
Description copied from interface:DiscreteDomain
Returns anArray
of domain objects that comprise this domain.- Specified by:
getDomainObjects
in interfaceDiscreteDomain<HorizontalPosition,GridCell2D>
- Specified by:
getDomainObjects
in interfaceHorizontalGrid
-
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
-
getHorizontalGrid
public RectilinearGrid getHorizontalGrid()
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceHorizontalGrid
- Overrides:
hashCode
in classObject
-
equals
public boolean equals(Object obj)
- Specified by:
equals
in interfaceHorizontalGrid
- Overrides:
equals
in classObject
-
-