Package org.codice.alliance.libs.klv
Class GeoBoxHandler
java.lang.Object
org.codice.alliance.libs.klv.BaseKlvHandler
org.codice.alliance.libs.klv.GeoBoxHandler
- All Implemented Interfaces:
KlvHandler,Trimmable
This handler expects four latitude-longitude pairs. It generates a WKT polygon for each four-pair
set.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaccept(org.codice.ddf.libs.klv.KlvDataElement klvDataElement) The handler accepts the incoming KLV metadata.Optional<ddf.catalog.data.Attribute> AfterKlvHandler.accept(KlvDataElement)has been called with all of the incoming data, this method will convert it to anAttribute.asSubsampledHandler(int subsampleCount) voidreset()Reset the handler to its initial state.voidtrim()Trim the arrays of lat and lon values to the same length.Methods inherited from class org.codice.alliance.libs.klv.BaseKlvHandler
asAttribute, getAttributeName, getMinimumListSize, subsample
-
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 generatedlatitude1- the name of the stanag 4609 fieldlongitude1- the name of the stanag 4609 fieldlatitude2- the name of the stanag 4609 fieldlongitude2- the name of the stanag 4609 fieldlatitude3- the name of the stanag 4609 fieldlongitude3- the name of the stanag 4609 fieldlatitude4- the name of the stanag 4609 fieldlongitude4- the name of the stanag 4609 field
-
-
Method Details
-
getLatitude1
-
getLatitude2
-
getLatitude3
-
getLatitude4
-
getLongitude1
-
getLongitude2
-
getLongitude3
-
getLongitude4
-
getRawGeoData
-
asAttribute
Description copied from interface:KlvHandlerAfterKlvHandler.accept(KlvDataElement)has been called with all of the incoming data, this method will convert it to anAttribute. If there is insufficient data to create an Attribute, then the Optional will be empty.- Specified by:
asAttributein interfaceKlvHandler- Returns:
- optional attribute
-
asSubsampledHandler
-
trim
public void trim()Trim the arrays of lat and lon values to the same length. -
accept
public void accept(org.codice.ddf.libs.klv.KlvDataElement klvDataElement) Description copied from interface:KlvHandlerThe 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:
acceptin interfaceKlvHandler- Parameters:
klvDataElement- incoming klv metadata
-
reset
public void reset()Description copied from interface:KlvHandlerReset the handler to its initial state.- Specified by:
resetin interfaceKlvHandler
-
accept
-