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 LatLonPoint
getLocationFromAddress
(String address, int[] master) Look up the location of the given addressstatic LatLonPoint
Prompt the user for a street address and try to find its location.static LatLonPoint
getLocationOfAddress
(JComponent extraComp) Get the location of an address.static List
Get saved addressesstatic void
initAddressBox
(JComboBox box) Initialize the list of addresses in boxstatic LinearLatLonSet
latLonRectToSet
(ucar.unidata.geoloc.LatLonRect rect) Convert a LatLonRect to a LinearLatLonSet.static void
Test mainstatic double
normalizeLongitude
(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 double
normalizeLongitude
(Range lonRange, double value) Normalize a longitude between the range of the max/min.static float
normalizeLongitude
(Range lonRange, float value) Normalize a longitude between the range of the max/min.static double
normalizeLongitude360
(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 void
setSavedAddresses
(List add) set saved addressesstatic EarthLocation
Create 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.
-