com.isti.util.gis
Class LocationPlaces.LocationDistHolder

java.lang.Object
  extended by com.isti.util.gis.LocationPlaces.LocationDistHolder
Enclosing class:
LocationPlaces

protected static class LocationPlaces.LocationDistHolder
extends java.lang.Object

Class LocationDistHolder holds a location-distance object, a number-of-points and a maximum-distance value.


Constructor Summary
LocationPlaces.LocationDistHolder(java.io.File locFileObj, int numPoints, double maxDistKm)
          Creates a location-distance holder object.
LocationPlaces.LocationDistHolder(java.io.File locFileObj, int numPoints, double maxDistKm, boolean quarryFlag)
          Creates a location-distance holder object.
 
Method Summary
 LocationDistance getLocDistObj()
          Returns the location-distance object.
 LocationDistanceInformation[] getNearestPoints(double latVal, double lonVal)
          Returns an array of 'LocationDistanceInformation' objects for the nearest points to the given point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationPlaces.LocationDistHolder

public LocationPlaces.LocationDistHolder(java.io.File locFileObj,
                                         int numPoints,
                                         double maxDistKm,
                                         boolean quarryFlag)
Creates a location-distance holder object.

Parameters:
locFileObj - the "locations" file to load.
numPoints - a number-of-points value.
maxDistKm - the maximum-distance limit (in kilometers) for the returned points, or 0.0 for no limit.
quarryFlag - true if the locations are "quarry" places; false if not.

LocationPlaces.LocationDistHolder

public LocationPlaces.LocationDistHolder(java.io.File locFileObj,
                                         int numPoints,
                                         double maxDistKm)
Creates a location-distance holder object.

Parameters:
locFileObj - the "locations" file to load.
numPoints - a number-of-points value.
maxDistKm - the maximum-distance limit (in kilometers) for the returned points, or 0.0 for no limit.
Method Detail

getLocDistObj

public LocationDistance getLocDistObj()
Returns the location-distance object.

Returns:
The location-distance object, or null if the "locations" file could not be loaded.

getNearestPoints

public LocationDistanceInformation[] getNearestPoints(double latVal,
                                                      double lonVal)
Returns an array of 'LocationDistanceInformation' objects for the nearest points to the given point. The spherical distance (in meters) and azimuth value (in degrees) for each point is determined and entered into the returned 'LocationDistanceInformation' objects.

Parameters:
latVal - the latitude for the given point, in degrees.
lonVal - the longitude for the given point, in degrees.
Returns:
An array of 'LocationDistanceInformation' objects, or an empty array if no points within the maximum-distance limit could be found, or null if an error occurred.