org.gbif.occurrencestore.utils.parse.geospatial
Class GeospatialParseUtils

java.lang.Object
  extended by org.gbif.occurrencestore.utils.parse.geospatial.GeospatialParseUtils

public class GeospatialParseUtils
extends Object

Utilities for assisting in the parsing of latitude and longitude strings into Decimals, the handling of depth and altitude ranges

Author:
tim

Method Summary
static ParseResult<LongPrecisionStatus> parseAltitude(String minimum, String maximum, String precisionAsString)
          Attempts to parse the depth information provided, and return the altitude in meters.
static ParseResult<LongPrecisionStatus> parseDepth(String minimum, String maximum, String precisionAsString)
          Attempts to parse the depth information provided, and return the depth in centimetres.
static ParseResult<LatLngStatus> parseLatLng(String latitude, String longitude)
          This parses string representations of latitude and longitude values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseLatLng

public static ParseResult<LatLngStatus> parseLatLng(String latitude,
                                                    String longitude)
This parses string representations of latitude and longitude values. It tries its best to interpret the values and indicates any problems in its result as GeospatialIssue. When the ParseResult.STATUS is either SUCCESS or FAIL the payload will always be non-null and the LatLngStatus.getIssue() method should return any issues there were. In case the issue is ERROR the payload will usually be null.

Parameters:
latitude - The verbatim latitude
longitude - The verbatim longitude
Returns:
The parse result

parseDepth

public static ParseResult<LongPrecisionStatus> parseDepth(String minimum,
                                                          String maximum,
                                                          String precisionAsString)
Attempts to parse the depth information provided, and return the depth in centimetres. This unit (centimetres) is defined by the previous implementation of the portal and this implementation is a port of the existing code

Parameters:
minimum - verbatim minimum depth
maximum - verbatim maximum depth
precisionAsString - verbatim precision
Returns:
The parse result

parseAltitude

public static ParseResult<LongPrecisionStatus> parseAltitude(String minimum,
                                                             String maximum,
                                                             String precisionAsString)
Attempts to parse the depth information provided, and return the altitude in meters. This unit (metres) is defined by the previous implementation of the portal and this implementation is a port of the existing code

Parameters:
minimum - verbatim minimum altitude
maximum - verbatim maximum altitude
precisionAsString - verbatim precision
Returns:
The parse result


Copyright © 2011 Global Biodiversity Information Facility. All Rights Reserved.