Package ucar.visad
Class GeoUtils
java.lang.Object
ucar.visad.GeoUtils
Earth-centric utilities
- Author:
- IDV Development Team
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic LatLonPointgetLocationFromAddress(String address, int[] master) Look up the location of the given addressstatic LatLonPointPrompt the user for a street address and try to find its location.static LatLonPointgetLocationOfAddress(JComponent extraComp) Get the location of an address.static ListGet saved addressesstatic voidinitAddressBox(JComboBox box) Initialize the list of addresses in boxstatic LinearLatLonSetlatLonRectToSet(ucar.unidata.geoloc.LatLonRect rect) Convert a LatLonRect to a LinearLatLonSet.static voidTest mainstatic doublenormalizeLongitude(double lonValue) Normalize a longitude value to the range between -180 and 180.static double[]normalizeLongitude(double[] lonValues) Normalize longitude values to the range between -180 and 180.static float[]normalizeLongitude(float[] lonValues) Normalize longitude values to the range between -180 and 180.static doublenormalizeLongitude(Range lonRange, double value) Normalize a longitude between the range of the max/min.static floatnormalizeLongitude(Range lonRange, float value) Normalize a longitude between the range of the max/min.static doublenormalizeLongitude360(double lonValue) Normalize a longitude value to the range between 0 and 360.static double[]normalizeLongitude360(double[] lonValues) Normalize longitude values to the range between 0 and 360.static float[]normalizeLongitude360(float[] lonValues) Normalize longitude values to the range between 0 and 360.static voidsetSavedAddresses(List add) set saved addressesstatic EarthLocationCreate an EarthLocation with altitude 0 from the given llp
-
Field Details
-
lastAddress
Keep around the last address -
addressToolTip
Address tooltip- See Also:
-
-
Method Details
-
toEarthLocation
Create an EarthLocation with altitude 0 from the given llp- Parameters:
llp- Location- Returns:
- Earth location
- Throws:
RemoteException- On badnessVisADException- On badness
-
getLocationOfAddress
Prompt the user for a street address and try to find its location. This supports addresses, zip codes, city/state and simple lat/lon entries- Returns:
- Location of address or null
-
latLonRectToSet
public static LinearLatLonSet latLonRectToSet(ucar.unidata.geoloc.LatLonRect rect) throws VisADException Convert a LatLonRect to a LinearLatLonSet.- Parameters:
rect- the LatLonRect- Returns:
- the corresponding LinearLatLonSet
- Throws:
VisADException- Problem creating the set
-
getLocationOfAddress
Get the location of an address.- Parameters:
extraComp- the component to put the address in.- Returns:
- the location as a LatLonPoint
-
getLocationFromAddress
Look up the location of the given address- Parameters:
address- The addressmaster- master- Returns:
- The location or null if not found
-
getSavedAddresses
Get saved addresses- Returns:
- list of addresses
-
setSavedAddresses
set saved addresses- Parameters:
add- list of addresses
-
initAddressBox
Initialize the list of addresses in box- Parameters:
box- the box to add to.
-
main
Test main- Parameters:
args- args
-
normalizeLongitude
public static double normalizeLongitude(double lonValue) Normalize a longitude value to the range between -180 and 180.- Parameters:
lonValue- longitude value to adjust (in degrees)- Returns:
- adjusted value.
-
normalizeLongitude
public static double[] normalizeLongitude(double[] lonValues) Normalize longitude values to the range between -180 and 180.- Parameters:
lonValues- longitude values to adjust (in degrees)- Returns:
- adjusted values.
-
normalizeLongitude
Normalize a longitude between the range of the max/min.- Parameters:
lonRange- the range of the longitudevalue- the longitude value- Returns:
- longitude normalized to range
-
normalizeLongitude
Normalize a longitude between the range of the max/min.- Parameters:
lonRange- the range of the longitudevalue- the longitude value- Returns:
- longitude normalized to range
-
normalizeLongitude
public static float[] normalizeLongitude(float[] lonValues) Normalize longitude values to the range between -180 and 180.- Parameters:
lonValues- longitude values to adjust (in degrees)- Returns:
- adjusted values.
-
normalizeLongitude360
public static double normalizeLongitude360(double lonValue) Normalize a longitude value to the range between 0 and 360.- Parameters:
lonValue- longitude value to adjust (in degrees)- Returns:
- adjusted value.
-
normalizeLongitude360
public static double[] normalizeLongitude360(double[] lonValues) Normalize longitude values to the range between 0 and 360.- Parameters:
lonValues- longitude values to adjust (in degrees)- Returns:
- adjusted values.
-
normalizeLongitude360
public static float[] normalizeLongitude360(float[] lonValues) Normalize longitude values to the range between 0 and 360.- Parameters:
lonValues- longitude values to adjust (in degrees)- Returns:
- adjusted value.
-