Class GeometryEncoder<T extends Geometry>

    • Constructor Detail

      • GeometryEncoder

        protected GeometryEncoder​(Encoder encoder)
      • GeometryEncoder

        protected GeometryEncoder​(Encoder encoder,
                                  boolean encodeGmlId)
    • Method Detail

      • encode

        public void encode​(T geometry,
                           AttributesImpl atts,
                           GMLWriter handler,
                           String gmlId)
                    throws Exception
        Encodes a geometry value with a given gmlId (implementations might choose to use it to generate gml:id attributes, depending on the GML version. The default implementation does not use gmlId and simply delegates to encode(Geometry, AttributesImpl, GMLWriter)
        Parameters:
        geometry - The Geometry to be encoded
        atts - Its attributes
        handler - The handler used to write XML
        gmlId - If not null, some implementation will use to as the gml:id (and to build ids for the nested features)
        Throws:
        Exception
      • cloneWithGmlId

        protected AttributesImpl cloneWithGmlId​(AttributesImpl atts,
                                                String gmlId)
        Returns a new AttributesImpl based on the provided on, with the addition of a gml:id attribute
        Parameters:
        atts - The base attributes (can be null)
        gmlId - The desired gml:id value
        Returns:
        The provided atts object if gmlId is null, a clone of the provided one plus the gml:id attribute otherwise
      • addGmlId

        protected void addGmlId​(AttributesImpl attributes,
                                String gmlId)
        Adds a gmlId to an existing and non null attribute set