Class LatitudeLongitudeHandler

java.lang.Object
org.codice.alliance.libs.klv.BaseKlvHandler
org.codice.alliance.libs.klv.LatitudeLongitudeHandler
All Implemented Interfaces:
KlvHandler, Trimmable

public class LatitudeLongitudeHandler extends BaseKlvHandler implements Trimmable
This handler expects pairs of latitude and longitude values. It generates WKT Points.
  • Constructor Details

    • LatitudeLongitudeHandler

      public LatitudeLongitudeHandler(String attributeName, String latitudeFieldName, String longitudeFieldName)
  • Method Details

    • getLongitudeFieldName

      public String getLongitudeFieldName()
    • getLatitudeFieldName

      public String getLatitudeFieldName()
    • getRawGeoData

      public Map<String,List<Double>> getRawGeoData()
    • asAttribute

      public Optional<ddf.catalog.data.Attribute> asAttribute()
      Description copied from interface: KlvHandler
      After KlvHandler.accept(KlvDataElement) has been called with all of the incoming data, this method will convert it to an Attribute. If there is insufficient data to create an Attribute, then the Optional will be empty.
      Specified by:
      asAttribute in interface KlvHandler
      Returns:
      optional attribute
    • asSubsampledHandler

      public LatitudeLongitudeHandler asSubsampledHandler(int subsampleCount)
    • trim

      public void trim()
      Trim the arrays of lat and lon values to the same length.
      Specified by:
      trim in interface Trimmable
    • accept

      public void accept(org.codice.ddf.libs.klv.KlvDataElement klvDataElement)
      Description copied from interface: KlvHandler
      The handler accepts the incoming KLV metadata. If the incoming KLV metadata is not the datatype expected by this handler, then the handler should log a warning and return.
      Specified by:
      accept in interface KlvHandler
      Parameters:
      klvDataElement - incoming klv metadata
    • reset

      public void reset()
      Description copied from interface: KlvHandler
      Reset the handler to its initial state.
      Specified by:
      reset in interface KlvHandler
    • accept

      public void accept(String name, Double value)