ucar.visad
Class GeoUtils

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

public class GeoUtils
extends Object

Earth-centric utilities

Version:
$Id: GeoUtils.java,v 1.21 2006/07/17 15:30:16 jeffmc Exp $
Author:
IDV Development Team

Field Summary
static String addressToolTip
          Address tooltip
 
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 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 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

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

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 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.