Class GeometryWriter


  • public class GeometryWriter
    extends Object
    Well Known Binary writer
    Author:
    osbornb
    • Constructor Detail

      • GeometryWriter

        public GeometryWriter()
        Constructor
        Since:
        2.0.4
      • GeometryWriter

        public GeometryWriter​(ByteOrder byteOrder)
        Constructor
        Parameters:
        byteOrder - byte order
        Since:
        2.0.4
      • GeometryWriter

        public GeometryWriter​(ByteWriter writer)
        Constructor
        Parameters:
        writer - byte writer
        Since:
        2.0.4
    • Method Detail

      • writeGeometry

        public static byte[] writeGeometry​(Geometry geometry)
                                    throws IOException
        Write a geometry to a well-known bytes
        Parameters:
        geometry - geometry
        Returns:
        well-known bytes
        Throws:
        IOException - upon failure to write
        Since:
        2.0.3
      • writeGeometry

        public static byte[] writeGeometry​(Geometry geometry,
                                           ByteOrder byteOrder)
                                    throws IOException
        Write a geometry to a well-known bytes
        Parameters:
        geometry - geometry
        byteOrder - byte order
        Returns:
        well-known bytes
        Throws:
        IOException - upon failure to write
        Since:
        2.0.3
      • getByteWriter

        public ByteWriter getByteWriter()
        Get the byte writer
        Returns:
        byte writer
        Since:
        2.0.4
      • getBytes

        public byte[] getBytes()
        Get the written bytes
        Returns:
        written bytes
        Since:
        2.0.4
      • close

        public void close()
        Close the byte writer
        Since:
        2.0.4
      • write

        public void write​(Geometry geometry)
                   throws IOException
        Write a geometry to the byte writer
        Parameters:
        geometry - geometry
        Throws:
        IOException - upon failure to write
        Since:
        2.0.4
      • writePoint

        public void writePoint​(Point point)
                        throws IOException
        Write a Point
        Parameters:
        point - point
        Throws:
        IOException - upon failure to write
        Since:
        2.0.4
      • writeXY

        public void writeXY​(Point point)
                     throws IOException
        Write a Point X and Y value
        Parameters:
        point - point
        Throws:
        IOException - upon failure to write
        Since:
        2.0.4
      • writeZ

        public void writeZ​(Point point)
                    throws IOException
        Write a Point Z value
        Parameters:
        point - point
        Throws:
        IOException - upon failure to write
        Since:
        2.0.4
      • writeM

        public void writeM​(Point point)
                    throws IOException
        Write a Point M value
        Parameters:
        point - point
        Throws:
        IOException - upon failure to write
        Since:
        2.0.4
      • writeLineString

        public void writeLineString​(LineString lineString)
                             throws IOException
        Write a Line String
        Parameters:
        lineString - Line String
        Throws:
        IOException - upon failure to write
        Since:
        2.0.4
      • writePolygon

        public void writePolygon​(Polygon polygon)
                          throws IOException
        Write a Polygon
        Parameters:
        polygon - Polygon
        Throws:
        IOException - upon failure to write
        Since:
        2.0.4
      • writeMultiPoint

        public void writeMultiPoint​(MultiPoint multiPoint)
                             throws IOException
        Write a Multi Point
        Parameters:
        multiPoint - Multi Point
        Throws:
        IOException - upon failure to write
        Since:
        2.0.4
      • writeMultiLineString

        public void writeMultiLineString​(MultiLineString multiLineString)
                                  throws IOException
        Write a Multi Line String
        Parameters:
        multiLineString - Multi Line String
        Throws:
        IOException - upon failure to write
        Since:
        2.0.4
      • writeMultiPolygon

        public void writeMultiPolygon​(MultiPolygon multiPolygon)
                               throws IOException
        Write a Multi Polygon
        Parameters:
        multiPolygon - Multi Polygon
        Throws:
        IOException - upon failure to write
        Since:
        2.0.4
      • writeGeometryCollection

        public void writeGeometryCollection​(GeometryCollection<?> geometryCollection)
                                     throws IOException
        Write a Geometry Collection
        Parameters:
        geometryCollection - Geometry Collection
        Throws:
        IOException - upon failure to write
        Since:
        2.0.4
      • writeCircularString

        public void writeCircularString​(CircularString circularString)
                                 throws IOException
        Write a Circular String
        Parameters:
        circularString - Circular String
        Throws:
        IOException - upon failure to write
        Since:
        2.0.4
      • writeCompoundCurve

        public void writeCompoundCurve​(CompoundCurve compoundCurve)
                                throws IOException
        Write a Compound Curve
        Parameters:
        compoundCurve - Compound Curve
        Throws:
        IOException - upon failure to write
        Since:
        2.0.4
      • writeCurvePolygon

        public void writeCurvePolygon​(CurvePolygon<?> curvePolygon)
                               throws IOException
        Write a Curve Polygon
        Parameters:
        curvePolygon - Curve Polygon
        Throws:
        IOException - upon failure to write
        Since:
        2.0.4
      • writePolyhedralSurface

        public void writePolyhedralSurface​(PolyhedralSurface polyhedralSurface)
                                    throws IOException
        Write a Polyhedral Surface
        Parameters:
        polyhedralSurface - Polyhedral Surface
        Throws:
        IOException - upon failure to write
        Since:
        2.0.4
      • writeTIN

        public void writeTIN​(TIN tin)
                      throws IOException
        Write a TIN
        Parameters:
        tin - TIN
        Throws:
        IOException - upon failure to write
        Since:
        2.0.4
      • writeTriangle

        public void writeTriangle​(Triangle triangle)
                           throws IOException
        Write a Triangle
        Parameters:
        triangle - Triangle
        Throws:
        IOException - upon failure to write
        Since:
        2.0.4
      • writeGeometry

        public static void writeGeometry​(ByteWriter writer,
                                         Geometry geometry)
                                  throws IOException
        Write a geometry to the byte writer
        Parameters:
        writer - byte writer
        geometry - geometry
        Throws:
        IOException - upon failure to write
      • writePoint

        public static void writePoint​(ByteWriter writer,
                                      Point point)
                               throws IOException
        Write a Point
        Parameters:
        writer - byte writer
        point - point
        Throws:
        IOException - upon failure to write
      • writeLineString

        public static void writeLineString​(ByteWriter writer,
                                           LineString lineString)
                                    throws IOException
        Write a Line String
        Parameters:
        writer - byte writer
        lineString - Line String
        Throws:
        IOException - upon failure to write
      • writePolygon

        public static void writePolygon​(ByteWriter writer,
                                        Polygon polygon)
                                 throws IOException
        Write a Polygon
        Parameters:
        writer - byte writer
        polygon - Polygon
        Throws:
        IOException - upon failure to write
      • writeMultiPoint

        public static void writeMultiPoint​(ByteWriter writer,
                                           MultiPoint multiPoint)
                                    throws IOException
        Write a Multi Point
        Parameters:
        writer - byte writer
        multiPoint - Multi Point
        Throws:
        IOException - upon failure to write
      • writeMultiLineString

        public static void writeMultiLineString​(ByteWriter writer,
                                                MultiLineString multiLineString)
                                         throws IOException
        Write a Multi Line String
        Parameters:
        writer - byte writer
        multiLineString - Multi Line String
        Throws:
        IOException - upon failure to write
      • writeMultiPolygon

        public static void writeMultiPolygon​(ByteWriter writer,
                                             MultiPolygon multiPolygon)
                                      throws IOException
        Write a Multi Polygon
        Parameters:
        writer - byte writer
        multiPolygon - Multi Polygon
        Throws:
        IOException - upon failure to write
      • writeGeometryCollection

        public static void writeGeometryCollection​(ByteWriter writer,
                                                   GeometryCollection<?> geometryCollection)
                                            throws IOException
        Write a Geometry Collection
        Parameters:
        writer - byte writer
        geometryCollection - Geometry Collection
        Throws:
        IOException - upon failure to write
      • writeCircularString

        public static void writeCircularString​(ByteWriter writer,
                                               CircularString circularString)
                                        throws IOException
        Write a Circular String
        Parameters:
        writer - byte writer
        circularString - Circular String
        Throws:
        IOException - upon failure to write
      • writeCompoundCurve

        public static void writeCompoundCurve​(ByteWriter writer,
                                              CompoundCurve compoundCurve)
                                       throws IOException
        Write a Compound Curve
        Parameters:
        writer - byte writer
        compoundCurve - Compound Curve
        Throws:
        IOException - upon failure to write
      • writeCurvePolygon

        public static void writeCurvePolygon​(ByteWriter writer,
                                             CurvePolygon<?> curvePolygon)
                                      throws IOException
        Write a Curve Polygon
        Parameters:
        writer - byte writer
        curvePolygon - Curve Polygon
        Throws:
        IOException - upon failure to write
      • writePolyhedralSurface

        public static void writePolyhedralSurface​(ByteWriter writer,
                                                  PolyhedralSurface polyhedralSurface)
                                           throws IOException
        Write a Polyhedral Surface
        Parameters:
        writer - byte writer
        polyhedralSurface - Polyhedral Surface
        Throws:
        IOException - upon failure to write
      • writeTIN

        public static void writeTIN​(ByteWriter writer,
                                    TIN tin)
                             throws IOException
        Write a TIN
        Parameters:
        writer - byte writer
        tin - TIN
        Throws:
        IOException - upon failure to write
      • writeTriangle

        public static void writeTriangle​(ByteWriter writer,
                                         Triangle triangle)
                                  throws IOException
        Write a Triangle
        Parameters:
        writer - byte writer
        triangle - Triangle
        Throws:
        IOException - upon failure to write