org.gbif.datatester.tests
Interface ExternalGeospatialVectorReader


public interface ExternalGeospatialVectorReader

Interface to encapsulate geospatial data lookup implementations for vector data. Some tests like GeographicErrorTest need to read simple feature vector data. This interface was designed to decouple tests from specific implementations that can perform these operations.

Since tests need to dynamically instantiate them, their constructors should not require any parameters.

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

Method Summary
 java.lang.Double getDistance(java.lang.Double longitude, java.lang.Double latitude, java.lang.String attributeId, java.lang.String value)
          Returns the distance between x,y point and a polygon associated with an attribute name/value.
 java.lang.String getFeature(java.lang.Double longitude, java.lang.Double latitude, java.lang.String attributeId)
          Returns a feature value given a point and an attribute.
 

Method Detail

getFeature

java.lang.String getFeature(java.lang.Double longitude,
                            java.lang.Double latitude,
                            java.lang.String attributeId)
                            throws TestProcessingException

Returns a feature value given a point and an attribute.

Parameters:
longitude - Longitude in decimal degrees (datum WGS84).
latitude - Latitude in decimal degrees (datum WGS84).
attributeId - Vector attribute identifier (like population, country name, etc).
Returns:
Feature value.
Throws:
TestProcessingException

getDistance

java.lang.Double getDistance(java.lang.Double longitude,
                             java.lang.Double latitude,
                             java.lang.String attributeId,
                             java.lang.String value)
                             throws TestProcessingException

Returns the distance between x,y point and a polygon associated with an attribute name/value.

Parameters:
longitude - Longitude in decimal degrees (datum WGS84).
latitude - Latitude in decimal degrees (datum WGS84).
attributeId - Vector attribute identifier (like population, country name, etc).
value - Value the attribute identifier (like "Brazil", "Madagascar", "Bahia", etc).
Returns:
kilometers. 0 if x,y in polygon associated with attribute name/value, -1 if error or if polygon not found, else the distance in kilometers.
Throws:
TestProcessingException