Package ucar.visad

Class GeoUtils

java.lang.Object
ucar.visad.GeoUtils

public class GeoUtils extends Object
Earth-centric utilities
Author:
IDV Development Team
  • Field Details

    • lastAddress

      public static String lastAddress
      Keep around the last address
    • addressToolTip

      public static final String addressToolTip
      Address tooltip
      See Also:
  • Method Details

    • 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
      Returns:
      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
      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.