no.sesat.search.mode.command
Class GeoSearchUtil

java.lang.Object
  extended by no.sesat.search.mode.command.GeoSearchUtil

public final class GeoSearchUtil
extends Object

Utility class for Geographical bounding box and circle transformations. Converts a bounding box to a centerpoint with radius. An example usecase is from map's current bounding box to be able to using the centerpoint with radius to search in this geographical area.

Version:
$Id: GeoSearchUtil.java 7225 2009-04-09 00:32:20Z ssmiweve $

Field Summary
static String GEO_SORT_BY
          Deprecated. will be removed in next release. is a definition provided by the search, not this class.
static String RADIUS_MEASURE_UNIT_TYPE
          Deprecated. will be removed in next release. is a definition provided by the search, not this class.
 
Method Summary
static String getCenter(ParametersDataObject requestParameters)
          Calcluates a center point from minX,maxX,minY,maxY parameters.
static String getRadiusRestriction(ParametersDataObject pdo)
          Retruns the radius to search from a given centerpoint or map selection.
static boolean hasCenterPoint(ParametersDataObject requestParameters)
          Responsible for checking if a ParameterDataObject has parameters for centerpoint.
static boolean isGeoSearch(ParametersDataObject requestParameters)
          Responsible for checking if the parameters found in the ParameterDataObject is enough to calculate getCenter(..) getRadiusRestriction(..)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RADIUS_MEASURE_UNIT_TYPE

public static final String RADIUS_MEASURE_UNIT_TYPE
Deprecated. will be removed in next release. is a definition provided by the search, not this class.
Measure unit to use for radius.

See Also:
Constant Field Values

GEO_SORT_BY

public static final String GEO_SORT_BY
Deprecated. will be removed in next release. is a definition provided by the search, not this class.
The sort by to use when the search is a geo search.

See Also:
Constant Field Values
Method Detail

getCenter

public static String getCenter(ParametersDataObject requestParameters)
Calcluates a center point from minX,maxX,minY,maxY parameters. If a centerpoint is given in the request, return new LatLong converted centerpoint.

Parameters:
requestParameters - Parameters for the request.
Returns:
The center point in latlong format.

isGeoSearch

public static boolean isGeoSearch(ParametersDataObject requestParameters)
Responsible for checking if the parameters found in the ParameterDataObject is enough to calculate getCenter(..) getRadiusRestriction(..)

Parameters:
requestParameters -
Returns:
true if the given parameter object contains minX,maxX,minY,maxY values.

hasCenterPoint

public static boolean hasCenterPoint(ParametersDataObject requestParameters)
Responsible for checking if a ParameterDataObject has parameters for centerpoint.

Parameters:
requestParameters - The ParameterDataObject to check.
Returns:
true if the given object has x,y and restriction radius.

getRadiusRestriction

public static String getRadiusRestriction(ParametersDataObject pdo)
Retruns the radius to search from a given centerpoint or map selection.

Parameters:
pdo - The ParameterDataObject.
Returns:
The radius from the centerpoint to search.


Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.