org.gbif.datatester.tests
Class ElevationErrorTest

java.lang.Object
  extended by org.gbif.datatester.AbstractDataTest
      extended by org.gbif.datatester.AbstractRecordTest
          extended by org.gbif.datatester.tests.ElevationErrorTest
All Implemented Interfaces:
DataTest

public class ElevationErrorTest
extends AbstractRecordTest

Generic elevation error test. Given a point (latitude and longitude in decimal degrees with WGS84 datum), an uncertainty value for the point (in meters), and an elevation range from the original record, the test gets the associated elevation from a digital elevation map (DEM) and compares with the original elevation. It's actually a range comparison, because the point uncertainty value determines an area with a minimum and maximum elevation taken from the DEM. If the original range doesn't fully contain the range as provided by the DEM, then this test assigns an error tag.

Records that only have a single field for elevation should populate both min and max original values with the same value. Interaction with the DEM should be performed by an external class that implements the ExternalGeospatialRasterReader interface.

The test accepts seven parameters: longitudeConcept, latitudeConcept, uncertaintyConcept, minimumElevationConcept, maximumElevationConcept, rasterDataReader and rasterAttributeId. The first five parameters must contain the identifier of known Concepts with a "double" DataType. uncertaintyConcept is optional. When not provided, 10 meters will be used for uncertainty values. rasterDataReader must contain a class name (including java package) of an external class implementing the ExternalGeospatialRasterReader interface. rasterAttributeId must specify an attribute identifier (some value associated with a raster file, or the raster file name itself) that is necessary to interact with the external lookup class.

A typical configuration entry for this test would look like:

  <test id="10" class="org.gbif.datatester.tests.ElevationErrorTest">
    <parameter name="longitudeConcept">
      <value v="Longitude" />
    </parameter>
    <parameter name="latitudeConcept">
      <value v="Latitude" />
    </parameter>
    <parameter name="uncertaintyConcept">
      <value v="Uncertainty" />
    </parameter>
    <parameter name="minimumElevationConcept">
      <value v="MinElevation" />
    </parameter>
    <parameter name="maximumElevationConcept">
      <value v="MaxElevation" />
    </parameter>
    <parameter name="rasterDataReader">
      <value v="myClassThatCanReadGridFiles" />
    </parameter>
    <parameter name="rasterAttributeId">
      <value v="Elevation" />
    </parameter>
  </test>
 

Version:
$Revision: 1.4 $
Author:
Alexandre Marino ( marino at cria . org . br ) Renato De Giovanni ( renato at cria . org . br )

Field Summary
static java.lang.String CALCULATED_ELEVATION_TAG_ID
          Shortcut to the "calculated elevation" tag.
static java.lang.String CALCULATED_MAXIMUM_ELEVATION_TAG_ID
          Shortcut to the "calculated maximum elevation" tag.
static java.lang.String CALCULATED_MINIMUM_ELEVATION_TAG_ID
          Shortcut to the "calculated minimum elevation" tag.
static java.lang.String ELEVATION_ERROR_TAG_ID
          Shortcut to the "elevation error" tag.
static java.lang.String NO_DATA_TAG_ID
          Shortcut to the "no data" tag.
 
Fields inherited from class org.gbif.datatester.AbstractDataTest
instanceId, knownConcepts, locale, result
 
Constructor Summary
ElevationErrorTest()
          Contructs a generic elevation error test.
 
Method Summary
protected  void doInitialize()
          Internal method to initialize the test.
protected  boolean doTest(GenericRecord genericRecord)
          Detect inconsistencies in elevation versus related coordinates.
 java.lang.String getVersion()
          Outputs the current version of this test based on the CVS revision.
 
Methods inherited from class org.gbif.datatester.AbstractRecordTest
doTest, minNumberOfRecords, test
 
Methods inherited from class org.gbif.datatester.AbstractDataTest
declareMandatoryConcept, declareOptionalConcept, declareParameter, declareTag, getDescription, getInstanceId, getInstanceXml, getMandatoryConcepts, getOptionalConcepts, getParametersMetadata, getParameterValue, getPossibleTags, getResourceBundle, getResult, getString, initialize, initialize, loadResourceBundle, setLocale, setResourceBundleBaseName, test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELEVATION_ERROR_TAG_ID

public static final java.lang.String ELEVATION_ERROR_TAG_ID

Shortcut to the "elevation error" tag.

See Also:
Constant Field Values

CALCULATED_ELEVATION_TAG_ID

public static final java.lang.String CALCULATED_ELEVATION_TAG_ID

Shortcut to the "calculated elevation" tag.

See Also:
Constant Field Values

CALCULATED_MAXIMUM_ELEVATION_TAG_ID

public static final java.lang.String CALCULATED_MAXIMUM_ELEVATION_TAG_ID

Shortcut to the "calculated maximum elevation" tag.

See Also:
Constant Field Values

CALCULATED_MINIMUM_ELEVATION_TAG_ID

public static final java.lang.String CALCULATED_MINIMUM_ELEVATION_TAG_ID

Shortcut to the "calculated minimum elevation" tag.

See Also:
Constant Field Values

NO_DATA_TAG_ID

public static final java.lang.String NO_DATA_TAG_ID

Shortcut to the "no data" tag.

See Also:
Constant Field Values
Constructor Detail

ElevationErrorTest

public ElevationErrorTest()

Contructs a generic elevation error test.

Method Detail

doInitialize

protected void doInitialize()
                     throws DataTesterException

Internal method to initialize the test.

Overrides:
doInitialize in class AbstractDataTest
Throws:
DataTesterException

doTest

protected boolean doTest(GenericRecord genericRecord)
                  throws DataTesterException

Detect inconsistencies in elevation versus related coordinates.

Specified by:
doTest in class AbstractDataTest
Parameters:
genericRecord - Record to be tested.
Returns:
False if at least one tag has been attached.
Throws:
DataTesterException

getVersion

public java.lang.String getVersion()

Outputs the current version of this test based on the CVS revision.

Specified by:
getVersion in interface DataTest
Specified by:
getVersion in class AbstractDataTest
Returns:
Test version.