ucar.visad
Class GeoUtils

java.lang.Object
  extended by ucar.visad.GeoUtils

public class GeoUtils
extends Object

Earth-centric utilities

Author:
IDV Development Team

Field Summary
static String addressToolTip
          Address tooltip
static String lastAddress
          Keep around the last address
 
Method Summary
static LatLonPoint getLocationFromAddress(String address, int[] master)
          Look up the location of the given address
static LatLonPoint getLocationOfAddress()
          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 getSavedAddresses()
          Get saved addresses
static void initAddressBox(JComboBox box)
          Initialize the list of addresses in box
static LinearLatLonSet latLonRectToSet(ucar.unidata.geoloc.LatLonRect rect)
          Convert a LatLonRect to a LinearLatLonSet.
static void main(String[] args)
          Test main
static 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 addresses
static EarthLocation toEarthLocation(LatLonPoint llp)
          Create an EarthLocation with altitude 0 from the given llp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lastAddress

public static String lastAddress
Keep around the last address


addressToolTip

public static final String addressToolTip
Address tooltip

See Also:
Constant Field Values
Method Detail

toEarthLocation

public static EarthLocation toEarthLocation(LatLonPoint llp)
                                     throws VisADException,
                                            RemoteException
Create an EarthLocation with altitude 0 from the given llp

Parameters:
llp - Location
Returns:
Earth location
Throws:
RemoteException - On badness
VisADException - On badness

getLocationOfAddress

public static LatLonPoint 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

public static LatLonPoint getLocationOfAddress(JComponent extraComp)
Get the location of an address.

Parameters:
extraComp - the component to put the address in.
Returns:
the location as a LatLonPoint

getLocationFromAddress

public static LatLonPoint getLocationFromAddress(String address,
                                                 int[] master)
Look up the location of the given address

Parameters:
address - The address
master - master
Returns:
The location or null if not found

getSavedAddresses

public static List getSavedAddresses()
Get saved addresses

Returns:
list of addresses

setSavedAddresses

public static void setSavedAddresses(List add)
set saved addresses

Parameters:
add - list of addresses

initAddressBox

public static void initAddressBox(JComboBox box)
Initialize the list of addresses in box

Parameters:
box - the box to add to.

main

public static void main(String[] args)
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

public static double normalizeLongitude(Range lonRange,
                                        double value)
Normalize a longitude between the range of the max/min

Parameters:
lonRange - the range of the longitude
value - the longitude value return longitude normalized to range

normalizeLongitude

public static float normalizeLongitude(Range lonRange,
                                       float value)
Normalize a longitude between the range of the max/min

Parameters:
lonRange - the range of the longitude
value - the longitude value return 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.