public class GeoJsonMetacardTransformer extends Object implements MetacardTransformer
MetacardTransformer interface to transform a single Metacard
instance to GeoJSON. This class places what is returned by Metacard.getLocation() in the
geometry JSON object in the GeoJSON output. The rest of the attributes of the Metacard are placed
in the properties object in the JSON. See geojson.org for the GeoJSON specification.MetacardTransformer,
Metacard,
Attribute| Modifier and Type | Field and Description |
|---|---|
protected static MimeType |
DEFAULT_MIME_TYPE |
static String |
ID |
static String |
ISO_8601_DATE_FORMAT |
protected static String |
METACARD_TYPE_PROPERTY_KEY |
| Constructor and Description |
|---|
GeoJsonMetacardTransformer() |
| Modifier and Type | Method and Description |
|---|---|
static org.json.simple.JSONObject |
convertToJSON(Metacard metacard) |
String |
toString() |
BinaryContent |
transform(Metacard metacard,
Map<String,Serializable> arguments)
Transforms the provided
Metacard into a BinaryContent |
public static final String ISO_8601_DATE_FORMAT
public static final String ID
protected static final String METACARD_TYPE_PROPERTY_KEY
protected static final MimeType DEFAULT_MIME_TYPE
public static org.json.simple.JSONObject convertToJSON(Metacard metacard) throws CatalogTransformerException
CatalogTransformerExceptionpublic BinaryContent transform(Metacard metacard, Map<String,Serializable> arguments) throws CatalogTransformerException
MetacardTransformerMetacard into a BinaryContenttransform in interface MetacardTransformermetacard - the Metacard to be transformedarguments - any arguments to be used in the transformation. Keys are specific to each
MetacardTransformer implementationBinaryContent the result of the Metacard transformationCatalogTransformerException - if the Metacard can not be transformedThis work is licensed under a Creative Commons Attribution 4.0 International License.