Class GMLGeometryWriter


  • public class GMLGeometryWriter
    extends Object
    Writes or creates a formatted string containing the GML representation of a JTS Geometry. Supports a user-defined line prefix and a user-defined maximum number of coordinates per line. Indents components of Geometries to provide a nicely-formatted representation.
    • Constructor Detail

      • GMLGeometryWriter

        public GMLGeometryWriter()
    • Method Detail

      • setLinePrefix

        public void setLinePrefix​(String linePrefix)
      • setSRSName

        public void setSRSName​(String srsName)
        Sets the srsName attribute to be output on the Geometry element. If null no attribute will be output.
        Parameters:
        srsName -
      • setGID

        public void setGID​(String gid)
        Sets the gid attribute to be output on the Geometry element. If null no attribute will be output.
        Parameters:
        srsName -
      • setMaximumCoordinatesPerLine

        public void setMaximumCoordinatesPerLine​(int maxCoordinatesPerLine)
      • write

        public String write​(org.locationtech.jts.geom.Geometry geom)
      • write

        public void write​(org.locationtech.jts.geom.Geometry g,
                          StringBuffer buf)
        Generates the GML representation of a JTS Geometry.
        Parameters:
        g - Geometry to output