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

public class GenericFeatureConverterWfs11 extends AbstractFeatureConverter
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.
  • Constructor Details

    • GenericFeatureConverterWfs11

      public GenericFeatureConverterWfs11(String srs)
    • GenericFeatureConverterWfs11

      public GenericFeatureConverterWfs11(org.codice.ddf.spatial.ogc.wfs.catalog.mapper.MetacardMapper metacardMapper)
  • Method Details

    • canConvert

      public boolean canConvert(Class clazz)
      Method to determine if this converter knows how to convert the specified Class.
      Specified by:
      canConvert in interface com.thoughtworks.xstream.converters.ConverterMatcher
      Overrides:
      canConvert in class AbstractFeatureConverter
      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 a Metacard.
      Parameters:
      hreader - the stream reader responsible for reading this xml doc
      context - a reference back to the Xstream unmarshalling context. Allows you to call "convertAnother" which will lookup other registered converters.
    • setSourceId

      public void setSourceId(String sourceId)
      Specified by:
      setSourceId in interface org.codice.ddf.spatial.ogc.wfs.catalog.converter.FeatureConverter
      Overrides:
      setSourceId in class AbstractFeatureConverter
    • getValueForMetacardAttribute

      protected Serializable getValueForMetacardAttribute(ddf.catalog.data.AttributeType.AttributeFormat attributeFormat, com.thoughtworks.xstream.io.HierarchicalStreamReader reader)
      Overrides:
      getValueForMetacardAttribute in class AbstractFeatureConverter
    • readGml

      protected org.locationtech.jts.geom.Geometry readGml(Document doc)
      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

      protected org.locationtech.jts.geom.Geometry readGml(String xml)
      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)