public static class PylaskiUtilities.Settings extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.lang.String |
host |
Constructor and Description |
---|
Settings()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addObservable(java.lang.String observable)
Adds an observable to be requested from the API.
|
java.net.URI |
getDataURI()
Generates the REST URI for retrieving past and present observable
data.
|
java.net.URI |
getForecastURI()
Generates the REST URI for retrieving future/forecast observable
data.
|
java.net.URI |
getForecastURI(boolean hrrrx)
Generates the REST URI for retrieving future/forecast observable
data.
|
PylaskiUtilities.Selection |
getSelectionType()
The selection type (inferred from the location settings).
|
void |
removeDate()
Removes the date range filter.
|
void |
removeObservable(java.lang.String observable)
Removes a previously added observable.
|
void |
setDate(java.util.Date at)
Sets the date around a central time.
|
void |
setDate(java.util.Date from,
java.util.Date to)
Sets the date range for data search.
|
void |
setDate(java.util.Date at,
int buffer)
Sets the date around a central time.
|
void |
setLocation(double lat,
double lon)
Sets the location to a single coordinate.
|
void |
setLocation(double lat,
double lon,
double radius)
Sets the location to within a radius around a single coordinate.
|
void |
setLocation(double minLat,
double minLon,
double maxLat,
double maxLon)
Sets the location to within a rectangle.
|
void |
setObservables(java.lang.String[] observables)
Sets the list of observables.
|
public java.lang.String host
public Settings()
public PylaskiUtilities.Selection getSelectionType()
public void setLocation(double lat, double lon)
lat
- Latitudelon
- Longitudepublic void setLocation(double lat, double lon, double radius)
lat
- Latitudelon
- Longituderadius
- Radius (in meters)public void setLocation(double minLat, double minLon, double maxLat, double maxLon)
minLat
- Minimum latitudeminLon
- Minimum longitudemaxLat
- Maximum latitudemaxLon
- Maximum longitudepublic void setDate(java.util.Date from, java.util.Date to) throws java.lang.Exception
from
- A date object to search fromto
- A date object to search to - must be after the "from" datejava.lang.Exception
- Raised if "to" date is at or before the "from" datepublic void setDate(java.util.Date at, int buffer) throws java.lang.Exception
at
- A date object to search aroundbuffer
- A buffer to pad the date with (in milliseconds)java.lang.Exception
- An exception that should never be raised when using this
particular methodpublic void setDate(java.util.Date at) throws java.lang.Exception
at
- A date object to search aroundjava.lang.Exception
- An exception that should never be raised when using this
particular methodpublic void removeDate()
public void addObservable(java.lang.String observable)
observable
- An observable as a string - refer to the Pylaski
documentation (link above)public void removeObservable(java.lang.String observable)
observable
- An observable as a stringpublic void setObservables(java.lang.String[] observables)
observables
- A list of observables - refer to the Pylaski documentation
(link above)public java.net.URI getDataURI() throws java.net.URISyntaxException
java.net.URISyntaxException
- If the URI is invalidpublic java.net.URI getForecastURI(boolean hrrrx) throws java.net.URISyntaxException
hrrrx
- Whether to use the HRRRx forecast datajava.net.URISyntaxException
- If the URI is invalidpublic java.net.URI getForecastURI() throws java.net.URISyntaxException
java.net.URISyntaxException
- If the URI is invalid