org.opensha.commons.data.xyz
Interface GeoDataSet

All Superinterfaces:
Cloneable, Serializable, XYZ_DataSet
All Known Implementing Classes:
AbstractGeoDataSet, ArbDiscrGeoDataSet, GriddedGeoDataSet

public interface GeoDataSet
extends XYZ_DataSet

Interface for a geographic XYZ dataset. These datasets are backed by Location objects instead of Point2D objects. They also have the capability of storing lat, lon values as x, y or y, x dependent on the latitudeX parameter.

Author:
kevin

Method Summary
 boolean contains(Location loc)
          Returns true if the dataset contains the given Location, false otherwise.
 GeoDataSet copy()
          Returns a shallow copy of this GeoDataSet.
 double get(Location loc)
          Get the value at the given Location, or null if it doesn't exist.
 Location getLocation(int index)
          Returns the location at the given index.
 LocationList getLocationList()
          Returns a list of all locations in the correct order (as defined by indexOf).
 double getMaxLat()
          Returns the maximum latitude in the given dataset.
 double getMaxLon()
          Returns the maximum longitude in the given dataset.
 double getMinLat()
          Returns the minimum latitude in the given dataset.
 double getMinLon()
          Returns the minimum longitude in the given dataset.
 int indexOf(Location loc)
          Returns the index of the given location, or -1 if it doesn't exist.
 boolean isLatitudeX()
          Returns true if latitude will be stored as X, otherwise false if as Y.
 void set(Location loc, double value)
          Set the value at the given Location.
 void setLatitudeX(boolean latitudeX)
          Set latitudeX.
 
Methods inherited from interface org.opensha.commons.data.xyz.XYZ_DataSet
abs, add, contains, contains, exp, exp, get, get, get, getMaxX, getMaxY, getMaxZ, getMinX, getMinY, getMinZ, getPoint, getPointList, getValueList, indexOf, indexOf, log, log10, pow, scale, set, set, set, setAll, size
 

Method Detail

setLatitudeX

void setLatitudeX(boolean latitudeX)
Set latitudeX. If true, latitude will be stored as X, otherwise as Y.

Parameters:
latitudeX -

isLatitudeX

boolean isLatitudeX()
Returns true if latitude will be stored as X, otherwise false if as Y.

Returns:
true if latitude will be stored as X, false otherwise

getMinLat

double getMinLat()
Returns the minimum latitude in the given dataset.

Returns:
the minimum latitude, or positive infinity if the dataset is empty

getMaxLat

double getMaxLat()
Returns the maximum latitude in the given dataset.

Returns:
the maximum latitude, or negative infinity if the dataset is empty

getMinLon

double getMinLon()
Returns the minimum longitude in the given dataset.

Returns:
the minimum longitude, or positive infinity if the dataset is empty

getMaxLon

double getMaxLon()
Returns the maximum longitude in the given dataset.

Returns:
the maximum longitude, or negative infinity if the dataset is empty

set

void set(Location loc,
         double value)
Set the value at the given Location. If the location doesn't exist in the dataset then it will be added.

Parameters:
loc - - the location at which to set
value - - the value to set
Throws:
NullPointerException - if the loc is null

get

double get(Location loc)
Get the value at the given Location, or null if it doesn't exist.

Parameters:
loc - - the location at which to get
Returns:
the value at the given location

indexOf

int indexOf(Location loc)
Returns the index of the given location, or -1 if it doesn't exist.

Parameters:
loc - - the location at which to return the index
Returns:
the index of the given location, or -1 if it isn't in the dataset.

getLocation

Location getLocation(int index)
Returns the location at the given index. If index < 0 or index >= size(), an exception will be thrown.

Parameters:
index - - the index at which to get the location
Returns:
the location at the given index

contains

boolean contains(Location loc)
Returns true if the dataset contains the given Location, false otherwise.

Parameters:
loc - - the location to test
Returns:
true if the dataset contains the given location, false otherwise

getLocationList

LocationList getLocationList()
Returns a list of all locations in the correct order (as defined by indexOf).

Returns:
list of all locations in the dataset

copy

GeoDataSet copy()
Returns a shallow copy of this GeoDataSet. Internal points are not cloned.

Specified by:
copy in interface XYZ_DataSet
Returns:
shallow copy of this GeoDataSet