Class GeoBoxHandler

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

public class GeoBoxHandler extends BaseKlvHandler implements Trimmable
This handler expects four latitude-longitude pairs. It generates a WKT polygon for each four-pair set.
  • Constructor Details

    • GeoBoxHandler

      public GeoBoxHandler(String attributeName, String latitude1, String longitude1, String latitude2, String longitude2, String latitude3, String longitude3, String latitude4, String longitude4)
      Parameters:
      attributeName - the name of the metacard attribute being generated
      latitude1 - the name of the stanag 4609 field
      longitude1 - the name of the stanag 4609 field
      latitude2 - the name of the stanag 4609 field
      longitude2 - the name of the stanag 4609 field
      latitude3 - the name of the stanag 4609 field
      longitude3 - the name of the stanag 4609 field
      latitude4 - the name of the stanag 4609 field
      longitude4 - the name of the stanag 4609 field
  • Method Details

    • getLatitude1

      public String getLatitude1()
    • getLatitude2

      public String getLatitude2()
    • getLatitude3

      public String getLatitude3()
    • getLatitude4

      public String getLatitude4()
    • getLongitude1

      public String getLongitude1()
    • getLongitude2

      public String getLongitude2()
    • getLongitude3

      public String getLongitude3()
    • getLongitude4

      public String getLongitude4()
    • 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 GeoBoxHandler 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)