Class GenericFeatureConverterWfs11
java.lang.Object
org.codice.ddf.spatial.ogc.wfs.catalog.converter.impl.AbstractFeatureConverter
org.codice.ddf.spatial.ogc.wfs.v110.catalog.converter.impl.GenericFeatureConverterWfs11
- All Implemented Interfaces:
com.thoughtworks.xstream.converters.Converter,com.thoughtworks.xstream.converters.ConverterMatcher,org.codice.ddf.spatial.ogc.wfs.catalog.converter.FeatureConverter
This class works in conjunction with XStream to convert a
Metacard to XML according to
the GML 3.1.1 spec. It will also convert respective XML into a Metacard.-
Field Summary
Fields inherited from class org.codice.ddf.spatial.ogc.wfs.catalog.converter.impl.AbstractFeatureConverter
coordinateOrder, ERROR_PARSING_MESSAGE, metacardType, sourceId, UTF8_ENCODING, wfsUrl -
Constructor Summary
ConstructorsConstructorDescriptionGenericFeatureConverterWfs11(org.codice.ddf.spatial.ogc.wfs.catalog.mapper.MetacardMapper metacardMapper) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanConvert(Class clazz) Method to determine if this converter knows how to convert the specified Class.protected SerializablegetValueForMetacardAttribute(ddf.catalog.data.AttributeType.AttributeFormat attributeFormat, com.thoughtworks.xstream.io.HierarchicalStreamReader reader) voidmarshal(Object value, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context) protected org.locationtech.jts.geom.GeometryConverts the GML XML document String to a JTS Geometry using the Geotools librariesprotected org.locationtech.jts.geom.GeometryConverts the GML XML document to a JTS Geometry using the Geotools librariesvoidsetSourceId(String sourceId) protected voidswapCoordinates(org.locationtech.jts.geom.Geometry geo) unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader hreader, com.thoughtworks.xstream.converters.UnmarshallingContext context) This method will unmarshal an XML instance of a "gml:member" to aMetacard.Methods inherited from class org.codice.ddf.spatial.ogc.wfs.catalog.converter.impl.AbstractFeatureConverter
copyXml, createMetacardFromFeature, getMetacardType, getSrs, parseDateFromXml, setCoordinateOrder, setMetacardType, setSrs, setWfsUrlMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.codice.ddf.spatial.ogc.wfs.catalog.converter.FeatureConverter
getMetacardType, setCoordinateOrder, setMetacardType, setWfsUrl
-
Constructor Details
-
GenericFeatureConverterWfs11
-
GenericFeatureConverterWfs11
public GenericFeatureConverterWfs11(org.codice.ddf.spatial.ogc.wfs.catalog.mapper.MetacardMapper metacardMapper)
-
-
Method Details
-
canConvert
Method to determine if this converter knows how to convert the specified Class.- Specified by:
canConvertin interfacecom.thoughtworks.xstream.converters.ConverterMatcher- Overrides:
canConvertin classAbstractFeatureConverter- Parameters:
clazz- the class to check
-
marshal
public void marshal(Object value, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context) -
unmarshal
public Object unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader hreader, com.thoughtworks.xstream.converters.UnmarshallingContext context) This method will unmarshal an XML instance of a "gml:member" to aMetacard.- Parameters:
hreader- the stream reader responsible for reading this xml doccontext- a reference back to the Xstream unmarshalling context. Allows you to call "convertAnother" which will lookup other registered converters.
-
setSourceId
- Specified by:
setSourceIdin interfaceorg.codice.ddf.spatial.ogc.wfs.catalog.converter.FeatureConverter- Overrides:
setSourceIdin classAbstractFeatureConverter
-
getValueForMetacardAttribute
protected Serializable getValueForMetacardAttribute(ddf.catalog.data.AttributeType.AttributeFormat attributeFormat, com.thoughtworks.xstream.io.HierarchicalStreamReader reader) - Overrides:
getValueForMetacardAttributein classAbstractFeatureConverter
-
readGml
Converts the GML XML document to a JTS Geometry using the Geotools libraries- Parameters:
doc- - the document that is expected to be a valid GML 3.1.1 compliant XML doc- Returns:
- JTS Geometry representing the GML
-
readGml
Converts the GML XML document String to a JTS Geometry using the Geotools libraries- Parameters:
xml- - a document that is expected to be a valid GML 3.1.1 compliant XML doc- Returns:
- JTS Geometry representing the GML
-
swapCoordinates
protected void swapCoordinates(org.locationtech.jts.geom.Geometry geo)
-