ucar.unidata.data
Class GeoSelection

java.lang.Object
  extended by ucar.unidata.data.GeoSelection

public class GeoSelection
extends Object

Holds geo-location information - lat/lon bounding box, image size, etc. This is used to pass information from a chooser into a datasource.


Field Summary
static int STRIDE_BASE
          No stride value
static int STRIDE_NONE
          No stride value
 
Constructor Summary
GeoSelection()
          ctor
GeoSelection(GeoLocationInfo boundingBox)
          ctor
GeoSelection(GeoLocationInfo boundingBox, boolean useFullBounds, int xStride, int yStride, int zStride, Real level)
          ctor.
GeoSelection(GeoLocationInfo boundingBox, int stride)
          ctor
GeoSelection(GeoLocationInfo boundingBox, int xStride, int yStride, int zStride)
          ctor.
GeoSelection(GeoLocationInfo boundingBox, int xStride, int yStride, int zStride, Real level)
          ctor.
GeoSelection(GeoSelection that)
          Copy ctor
GeoSelection(Real level)
          ctor
 
Method Summary
 void clearStride()
          Clear the stride settings
 boolean equals(Object obj)
          equals
 GeoLocationInfo getBoundingBox()
          Get the BoundingBox property.
static GeoLocationInfo getDefaultBoundingBox()
          Get the default bbox
 boolean getHasNonOneStride()
          Does this selection have any stride other than NONE and BASE
 boolean getHasValidState()
          Do we have either a bounding box or any valid strides
 ucar.unidata.geoloc.LatLonRect getLatLonRect()
          Utility to get a lat lon rect if we have one.
 Real getLevel()
          Get the Level property.
 boolean getUseFullBounds()
          Get the UseFullBounds property.
 int getXStride()
          Get the XStride property.
 int getXStrideToUse()
          Get the XStride property if it is valid.
 int getYStride()
          Get the YStride property.
 int getYStrideToUse()
          Get the YStride property if it is valid.
 int getZStride()
          Get the ZStride property.
 int getZStrideToUse()
          Get the ZStride property if it is valid.
 int hashCode()
          hash me
 boolean hasSpatialSubset()
          Is there a spatial subset defined
 boolean hasStride()
          Do we have any stride defined
 boolean hasXStride()
          Do we have a stride defined
 boolean hasYStride()
          Do we have a stride defined
 boolean hasZStride()
          Do we have a stride defined
static GeoSelection merge(GeoSelection highPriority, GeoSelection lowPriority)
          Create a new GeoSelection by merging the two subsets.
 void setBoundingBox(GeoLocationInfo value)
          Set the BoundingBox property.
static void setDefaultBoundingBox(GeoLocationInfo defaultBox)
          Define the global bounding box that is used as the default
 void setLatLonRect(Rectangle2D.Float rect)
          Set the bounds using the rectangle
 void setLevel(Real value)
          Set the Level property.
 void setStride(int value)
          Set the Stride property.
 void setUseFullBounds(boolean value)
          Set the UseFullBounds property.
 void setXStride(int value)
          Set the XStride property.
 void setYStride(int value)
          Set the YStride property.
 void setZStride(int value)
          Set the ZStride property.
 String toString()
          tostring
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

STRIDE_NONE

public static final int STRIDE_NONE
No stride value

See Also:
Constant Field Values

STRIDE_BASE

public static final int STRIDE_BASE
No stride value

See Also:
Constant Field Values
Constructor Detail

GeoSelection

public GeoSelection()
ctor


GeoSelection

public GeoSelection(Real level)
ctor

Parameters:
level - The level to use

GeoSelection

public GeoSelection(GeoSelection that)
Copy ctor

Parameters:
that - The object to copy

GeoSelection

public GeoSelection(GeoLocationInfo boundingBox)
ctor

Parameters:
boundingBox - The bounding box. May be null.

GeoSelection

public GeoSelection(GeoLocationInfo boundingBox,
                    int stride)
ctor

Parameters:
boundingBox - The bounding box. May be null.
stride - The stride for x, y and z

GeoSelection

public GeoSelection(GeoLocationInfo boundingBox,
                    int xStride,
                    int yStride,
                    int zStride)
ctor.

Parameters:
boundingBox - The bounding box. May be null.
xStride - X stride
yStride - Y stride
zStride - Z stride

GeoSelection

public GeoSelection(GeoLocationInfo boundingBox,
                    int xStride,
                    int yStride,
                    int zStride,
                    Real level)
ctor.

Parameters:
boundingBox - The bounding box. May be null.
xStride - X stride
yStride - Y stride
zStride - Z stride
level - The level to use

GeoSelection

public GeoSelection(GeoLocationInfo boundingBox,
                    boolean useFullBounds,
                    int xStride,
                    int yStride,
                    int zStride,
                    Real level)
ctor.

Parameters:
boundingBox - The bounding box. May be null.
useFullBounds - Use full bounds
xStride - X stride
yStride - Y stride
zStride - Z stride
level - The level to use
Method Detail

getDefaultBoundingBox

public static GeoLocationInfo getDefaultBoundingBox()
Get the default bbox

Returns:
default bbox

setDefaultBoundingBox

public static void setDefaultBoundingBox(GeoLocationInfo defaultBox)
Define the global bounding box that is used as the default

Parameters:
defaultBox - default box

setLatLonRect

public void setLatLonRect(Rectangle2D.Float rect)
Set the bounds using the rectangle

Parameters:
rect - rect

getLatLonRect

public ucar.unidata.geoloc.LatLonRect getLatLonRect()
Utility to get a lat lon rect if we have one.

Returns:
latlon rectangle

getHasValidState

public boolean getHasValidState()
Do we have either a bounding box or any valid strides

Returns:
Has anything to subset

hasSpatialSubset

public boolean hasSpatialSubset()
Is there a spatial subset defined

Returns:
Has spatial subset

getHasNonOneStride

public boolean getHasNonOneStride()
Does this selection have any stride other than NONE and BASE

Returns:
has a stride defined other than NONE or BASE

merge

public static GeoSelection merge(GeoSelection highPriority,
                                 GeoSelection lowPriority)
Create a new GeoSelection by merging the two subsets.

Parameters:
highPriority - Take state from this first if defined
lowPriority - Use this state
Returns:
The merged subset

setStride

public void setStride(int value)
Set the Stride property.

Parameters:
value - The new value for Stride

clearStride

public void clearStride()
Clear the stride settings


hasXStride

public boolean hasXStride()
Do we have a stride defined

Returns:
x stride defined

hasYStride

public boolean hasYStride()
Do we have a stride defined

Returns:
y stride defined

hasZStride

public boolean hasZStride()
Do we have a stride defined

Returns:
z stride defined

hasStride

public boolean hasStride()
Do we have any stride defined

Returns:
any stride defined

setXStride

public void setXStride(int value)
Set the XStride property.

Parameters:
value - The new value for XStride

getXStride

public int getXStride()
Get the XStride property.

Returns:
The XStride

getXStrideToUse

public int getXStrideToUse()
Get the XStride property if it is valid. Else return the base stride.

Returns:
The x stride to use

setYStride

public void setYStride(int value)
Set the YStride property.

Parameters:
value - The new value for YStride

getYStride

public int getYStride()
Get the YStride property.

Returns:
The YStride

getYStrideToUse

public int getYStrideToUse()
Get the YStride property if it is valid. Else return the base stride.

Returns:
The y stride to use

setZStride

public void setZStride(int value)
Set the ZStride property.

Parameters:
value - The new value for ZStride

getZStride

public int getZStride()
Get the ZStride property.

Returns:
The ZStride

getZStrideToUse

public int getZStrideToUse()
Get the ZStride property if it is valid. Else return the base stride.

Returns:
The z stride to use

setBoundingBox

public void setBoundingBox(GeoLocationInfo value)
Set the BoundingBox property.

Parameters:
value - The new value for BoundingBox

getBoundingBox

public GeoLocationInfo getBoundingBox()
Get the BoundingBox property.

Returns:
The BoundingBox

toString

public String toString()
tostring

Overrides:
toString in class Object
Returns:
tostring

setLevel

public void setLevel(Real value)
Set the Level property.

Parameters:
value - The new value for Level

getLevel

public Real getLevel()
Get the Level property.

Returns:
The Level

hashCode

public int hashCode()
hash me

Overrides:
hashCode in class Object
Returns:
my hash code

equals

public boolean equals(Object obj)
equals

Overrides:
equals in class Object
Parameters:
obj - obj
Returns:
is equals

setUseFullBounds

public void setUseFullBounds(boolean value)
Set the UseFullBounds property.

Parameters:
value - The new value for UseFullBounds

getUseFullBounds

public boolean getUseFullBounds()
Get the UseFullBounds property.

Returns:
The UseFullBounds