Class GeometryReader


  • public class GeometryReader
    extends Object
    Well Known Binary reader
    Author:
    osbornb
    • Constructor Detail

      • GeometryReader

        public GeometryReader​(byte[] bytes)
        Constructor
        Parameters:
        bytes - geometry bytes
        Since:
        2.0.4
      • GeometryReader

        public GeometryReader​(ByteReader reader)
        Constructor
        Parameters:
        reader - byte reader
        Since:
        2.0.4
    • Method Detail

      • readGeometry

        public static Geometry readGeometry​(byte[] bytes)
                                     throws IOException
        Read a geometry from well-known bytes
        Parameters:
        bytes - geometry bytes
        Returns:
        geometry
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3
      • readGeometry

        public static Geometry readGeometry​(byte[] bytes,
                                            GeometryFilter filter)
                                     throws IOException
        Read a geometry from well-known bytes
        Parameters:
        bytes - geometry bytes
        filter - geometry filter
        Returns:
        geometry
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3
      • readGeometry

        public static <T extends Geometry> T readGeometry​(byte[] bytes,
                                                          Class<T> expectedType)
                                                   throws IOException
        Read a geometry from well-known bytes
        Type Parameters:
        T - geometry type
        Parameters:
        bytes - geometry bytes
        expectedType - expected type
        Returns:
        geometry
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3
      • readGeometry

        public static <T extends Geometry> T readGeometry​(byte[] bytes,
                                                          GeometryFilter filter,
                                                          Class<T> expectedType)
                                                   throws IOException
        Read a geometry from well-known bytes
        Type Parameters:
        T - geometry type
        Parameters:
        bytes - geometry bytes
        filter - geometry filter
        expectedType - expected type
        Returns:
        geometry
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3
      • getByteReader

        public ByteReader getByteReader()
        Get the byte reader
        Returns:
        byte reader
        Since:
        2.0.4
      • close

        public void close()
        Close the byte reader
        Since:
        2.0.4
      • read

        public Geometry read​(GeometryFilter filter)
                      throws IOException
        Read a geometry from the byte reader
        Parameters:
        filter - geometry filter
        Returns:
        geometry
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • read

        public <T extends Geometry> T read​(Class<T> expectedType)
                                    throws IOException
        Read a geometry from the byte reader
        Type Parameters:
        T - geometry type
        Parameters:
        expectedType - expected type
        Returns:
        geometry
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • read

        public <T extends Geometry> T read​(GeometryFilter filter,
                                           Class<T> expectedType)
                                    throws IOException
        Read a geometry from the byte reader
        Type Parameters:
        T - geometry type
        Parameters:
        filter - geometry filter
        expectedType - expected type
        Returns:
        geometry
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • read

        public <T extends Geometry> T read​(GeometryFilter filter,
                                           GeometryType containingType,
                                           Class<T> expectedType)
                                    throws IOException
        Read a geometry from the byte reader
        Type Parameters:
        T - geometry type
        Parameters:
        filter - geometry filter
        containingType - containing geometry type
        expectedType - expected type
        Returns:
        geometry
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readGeometryType

        public GeometryTypeInfo readGeometryType()
                                          throws IOException
        Read the geometry type info
        Returns:
        geometry type info
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readPoint

        public Point readPoint​(boolean hasZ,
                               boolean hasM)
                        throws IOException
        Read a Point
        Parameters:
        hasZ - has z flag
        hasM - has m flag
        Returns:
        point
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readLineString

        public LineString readLineString​(boolean hasZ,
                                         boolean hasM)
                                  throws IOException
        Read a Line String
        Parameters:
        hasZ - has z flag
        hasM - has m flag
        Returns:
        line string
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readLineString

        public LineString readLineString​(GeometryFilter filter,
                                         boolean hasZ,
                                         boolean hasM)
                                  throws IOException
        Read a Line String
        Parameters:
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        line string
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readPolygon

        public Polygon readPolygon​(boolean hasZ,
                                   boolean hasM)
                            throws IOException
        Read a Polygon
        Parameters:
        hasZ - has z flag
        hasM - has m flag
        Returns:
        polygon
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readPolygon

        public Polygon readPolygon​(GeometryFilter filter,
                                   boolean hasZ,
                                   boolean hasM)
                            throws IOException
        Read a Polygon
        Parameters:
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        polygon
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readMultiPoint

        public MultiPoint readMultiPoint​(boolean hasZ,
                                         boolean hasM)
                                  throws IOException
        Read a Multi Point
        Parameters:
        hasZ - has z flag
        hasM - has m flag
        Returns:
        multi point
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readMultiPoint

        public MultiPoint readMultiPoint​(GeometryFilter filter,
                                         boolean hasZ,
                                         boolean hasM)
                                  throws IOException
        Read a Multi Point
        Parameters:
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        multi point
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readMultiLineString

        public MultiLineString readMultiLineString​(boolean hasZ,
                                                   boolean hasM)
                                            throws IOException
        Read a Multi Line String
        Parameters:
        hasZ - has z flag
        hasM - has m flag
        Returns:
        multi line string
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readMultiLineString

        public MultiLineString readMultiLineString​(GeometryFilter filter,
                                                   boolean hasZ,
                                                   boolean hasM)
                                            throws IOException
        Read a Multi Line String
        Parameters:
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        multi line string
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readMultiPolygon

        public MultiPolygon readMultiPolygon​(boolean hasZ,
                                             boolean hasM)
                                      throws IOException
        Read a Multi Polygon
        Parameters:
        hasZ - has z flag
        hasM - has m flag
        Returns:
        multi polygon
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readMultiPolygon

        public MultiPolygon readMultiPolygon​(GeometryFilter filter,
                                             boolean hasZ,
                                             boolean hasM)
                                      throws IOException
        Read a Multi Polygon
        Parameters:
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        multi polygon
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readGeometryCollection

        public GeometryCollection<Geometry> readGeometryCollection​(boolean hasZ,
                                                                   boolean hasM)
                                                            throws IOException
        Read a Geometry Collection
        Parameters:
        hasZ - has z flag
        hasM - has m flag
        Returns:
        geometry collection
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readGeometryCollection

        public GeometryCollection<Geometry> readGeometryCollection​(GeometryFilter filter,
                                                                   boolean hasZ,
                                                                   boolean hasM)
                                                            throws IOException
        Read a Geometry Collection
        Parameters:
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        geometry collection
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readCircularString

        public CircularString readCircularString​(boolean hasZ,
                                                 boolean hasM)
                                          throws IOException
        Read a Circular String
        Parameters:
        hasZ - has z flag
        hasM - has m flag
        Returns:
        circular string
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readCircularString

        public CircularString readCircularString​(GeometryFilter filter,
                                                 boolean hasZ,
                                                 boolean hasM)
                                          throws IOException
        Read a Circular String
        Parameters:
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        circular string
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readCompoundCurve

        public CompoundCurve readCompoundCurve​(boolean hasZ,
                                               boolean hasM)
                                        throws IOException
        Read a Compound Curve
        Parameters:
        hasZ - has z flag
        hasM - has m flag
        Returns:
        compound curve
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readCompoundCurve

        public CompoundCurve readCompoundCurve​(GeometryFilter filter,
                                               boolean hasZ,
                                               boolean hasM)
                                        throws IOException
        Read a Compound Curve
        Parameters:
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        compound curve
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readCurvePolygon

        public CurvePolygon<Curve> readCurvePolygon​(boolean hasZ,
                                                    boolean hasM)
                                             throws IOException
        Read a Curve Polygon
        Parameters:
        hasZ - has z flag
        hasM - has m flag
        Returns:
        curve polygon
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readCurvePolygon

        public CurvePolygon<Curve> readCurvePolygon​(GeometryFilter filter,
                                                    boolean hasZ,
                                                    boolean hasM)
                                             throws IOException
        Read a Curve Polygon
        Parameters:
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        curve polygon
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readPolyhedralSurface

        public PolyhedralSurface readPolyhedralSurface​(boolean hasZ,
                                                       boolean hasM)
                                                throws IOException
        Read a Polyhedral Surface
        Parameters:
        hasZ - has z flag
        hasM - has m flag
        Returns:
        polyhedral surface
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readPolyhedralSurface

        public PolyhedralSurface readPolyhedralSurface​(GeometryFilter filter,
                                                       boolean hasZ,
                                                       boolean hasM)
                                                throws IOException
        Read a Polyhedral Surface
        Parameters:
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        polyhedral surface
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readTIN

        public TIN readTIN​(boolean hasZ,
                           boolean hasM)
                    throws IOException
        Read a TIN
        Parameters:
        hasZ - has z flag
        hasM - has m flag
        Returns:
        TIN
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readTIN

        public TIN readTIN​(GeometryFilter filter,
                           boolean hasZ,
                           boolean hasM)
                    throws IOException
        Read a TIN
        Parameters:
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        TIN
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readTriangle

        public Triangle readTriangle​(boolean hasZ,
                                     boolean hasM)
                              throws IOException
        Read a Triangle
        Parameters:
        hasZ - has z flag
        hasM - has m flag
        Returns:
        triangle
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readTriangle

        public Triangle readTriangle​(GeometryFilter filter,
                                     boolean hasZ,
                                     boolean hasM)
                              throws IOException
        Read a Triangle
        Parameters:
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        triangle
        Throws:
        IOException - upon failure to read
        Since:
        2.0.4
      • readGeometry

        public static Geometry readGeometry​(ByteReader reader)
                                     throws IOException
        Read a geometry from the byte reader
        Parameters:
        reader - byte reader
        Returns:
        geometry
        Throws:
        IOException - upon failure to read
      • readGeometry

        public static Geometry readGeometry​(ByteReader reader,
                                            GeometryFilter filter)
                                     throws IOException
        Read a geometry from the byte reader
        Parameters:
        reader - byte reader
        filter - geometry filter
        Returns:
        geometry
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3
      • readGeometry

        public static <T extends Geometry> T readGeometry​(ByteReader reader,
                                                          Class<T> expectedType)
                                                   throws IOException
        Read a geometry from the byte reader
        Type Parameters:
        T - geometry type
        Parameters:
        reader - byte reader
        expectedType - expected type
        Returns:
        geometry
        Throws:
        IOException - upon failure to read
      • readGeometry

        public static <T extends Geometry> T readGeometry​(ByteReader reader,
                                                          GeometryFilter filter,
                                                          Class<T> expectedType)
                                                   throws IOException
        Read a geometry from the byte reader
        Type Parameters:
        T - geometry type
        Parameters:
        reader - byte reader
        filter - geometry filter
        expectedType - expected type
        Returns:
        geometry
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3
      • readGeometry

        public static <T extends Geometry> T readGeometry​(ByteReader reader,
                                                          GeometryFilter filter,
                                                          GeometryType containingType,
                                                          Class<T> expectedType)
                                                   throws IOException
        Read a geometry from the byte reader
        Type Parameters:
        T - geometry type
        Parameters:
        reader - byte reader
        filter - geometry filter
        containingType - containing geometry type
        expectedType - expected type
        Returns:
        geometry
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3
      • readGeometryType

        public static GeometryTypeInfo readGeometryType​(ByteReader reader)
                                                 throws IOException
        Read the geometry type info
        Parameters:
        reader - byte reader
        Returns:
        geometry type info
        Throws:
        IOException - upon failure to read
      • readPoint

        public static Point readPoint​(ByteReader reader,
                                      boolean hasZ,
                                      boolean hasM)
                               throws IOException
        Read a Point
        Parameters:
        reader - byte reader
        hasZ - has z flag
        hasM - has m flag
        Returns:
        point
        Throws:
        IOException - upon failure to read
      • readLineString

        public static LineString readLineString​(ByteReader reader,
                                                boolean hasZ,
                                                boolean hasM)
                                         throws IOException
        Read a Line String
        Parameters:
        reader - byte reader
        hasZ - has z flag
        hasM - has m flag
        Returns:
        line string
        Throws:
        IOException - upon failure to read
      • readLineString

        public static LineString readLineString​(ByteReader reader,
                                                GeometryFilter filter,
                                                boolean hasZ,
                                                boolean hasM)
                                         throws IOException
        Read a Line String
        Parameters:
        reader - byte reader
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        line string
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3
      • readPolygon

        public static Polygon readPolygon​(ByteReader reader,
                                          boolean hasZ,
                                          boolean hasM)
                                   throws IOException
        Read a Polygon
        Parameters:
        reader - byte reader
        hasZ - has z flag
        hasM - has m flag
        Returns:
        polygon
        Throws:
        IOException - upon failure to read
      • readPolygon

        public static Polygon readPolygon​(ByteReader reader,
                                          GeometryFilter filter,
                                          boolean hasZ,
                                          boolean hasM)
                                   throws IOException
        Read a Polygon
        Parameters:
        reader - byte reader
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        polygon
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3
      • readMultiPoint

        public static MultiPoint readMultiPoint​(ByteReader reader,
                                                boolean hasZ,
                                                boolean hasM)
                                         throws IOException
        Read a Multi Point
        Parameters:
        reader - byte reader
        hasZ - has z flag
        hasM - has m flag
        Returns:
        multi point
        Throws:
        IOException - upon failure to read
      • readMultiPoint

        public static MultiPoint readMultiPoint​(ByteReader reader,
                                                GeometryFilter filter,
                                                boolean hasZ,
                                                boolean hasM)
                                         throws IOException
        Read a Multi Point
        Parameters:
        reader - byte reader
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        multi point
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3
      • readMultiLineString

        public static MultiLineString readMultiLineString​(ByteReader reader,
                                                          boolean hasZ,
                                                          boolean hasM)
                                                   throws IOException
        Read a Multi Line String
        Parameters:
        reader - byte reader
        hasZ - has z flag
        hasM - has m flag
        Returns:
        multi line string
        Throws:
        IOException - upon failure to read
      • readMultiLineString

        public static MultiLineString readMultiLineString​(ByteReader reader,
                                                          GeometryFilter filter,
                                                          boolean hasZ,
                                                          boolean hasM)
                                                   throws IOException
        Read a Multi Line String
        Parameters:
        reader - byte reader
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        multi line string
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3
      • readMultiPolygon

        public static MultiPolygon readMultiPolygon​(ByteReader reader,
                                                    boolean hasZ,
                                                    boolean hasM)
                                             throws IOException
        Read a Multi Polygon
        Parameters:
        reader - byte reader
        hasZ - has z flag
        hasM - has m flag
        Returns:
        multi polygon
        Throws:
        IOException - upon failure to read
      • readMultiPolygon

        public static MultiPolygon readMultiPolygon​(ByteReader reader,
                                                    GeometryFilter filter,
                                                    boolean hasZ,
                                                    boolean hasM)
                                             throws IOException
        Read a Multi Polygon
        Parameters:
        reader - byte reader
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        multi polygon
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3
      • readGeometryCollection

        public static GeometryCollection<Geometry> readGeometryCollection​(ByteReader reader,
                                                                          boolean hasZ,
                                                                          boolean hasM)
                                                                   throws IOException
        Read a Geometry Collection
        Parameters:
        reader - byte reader
        hasZ - has z flag
        hasM - has m flag
        Returns:
        geometry collection
        Throws:
        IOException - upon failure to read
      • readGeometryCollection

        public static GeometryCollection<Geometry> readGeometryCollection​(ByteReader reader,
                                                                          GeometryFilter filter,
                                                                          boolean hasZ,
                                                                          boolean hasM)
                                                                   throws IOException
        Read a Geometry Collection
        Parameters:
        reader - byte reader
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        geometry collection
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3
      • readCircularString

        public static CircularString readCircularString​(ByteReader reader,
                                                        boolean hasZ,
                                                        boolean hasM)
                                                 throws IOException
        Read a Circular String
        Parameters:
        reader - byte reader
        hasZ - has z flag
        hasM - has m flag
        Returns:
        circular string
        Throws:
        IOException - upon failure to read
      • readCircularString

        public static CircularString readCircularString​(ByteReader reader,
                                                        GeometryFilter filter,
                                                        boolean hasZ,
                                                        boolean hasM)
                                                 throws IOException
        Read a Circular String
        Parameters:
        reader - byte reader
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        circular string
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3
      • readCompoundCurve

        public static CompoundCurve readCompoundCurve​(ByteReader reader,
                                                      boolean hasZ,
                                                      boolean hasM)
                                               throws IOException
        Read a Compound Curve
        Parameters:
        reader - byte reader
        hasZ - has z flag
        hasM - has m flag
        Returns:
        compound curve
        Throws:
        IOException - upon failure to read
      • readCompoundCurve

        public static CompoundCurve readCompoundCurve​(ByteReader reader,
                                                      GeometryFilter filter,
                                                      boolean hasZ,
                                                      boolean hasM)
                                               throws IOException
        Read a Compound Curve
        Parameters:
        reader - byte reader
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        compound curve
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3
      • readCurvePolygon

        public static CurvePolygon<Curve> readCurvePolygon​(ByteReader reader,
                                                           boolean hasZ,
                                                           boolean hasM)
                                                    throws IOException
        Read a Curve Polygon
        Parameters:
        reader - byte reader
        hasZ - has z flag
        hasM - has m flag
        Returns:
        curve polygon
        Throws:
        IOException - upon failure to read
      • readCurvePolygon

        public static CurvePolygon<Curve> readCurvePolygon​(ByteReader reader,
                                                           GeometryFilter filter,
                                                           boolean hasZ,
                                                           boolean hasM)
                                                    throws IOException
        Read a Curve Polygon
        Parameters:
        reader - byte reader
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        curve polygon
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3
      • readPolyhedralSurface

        public static PolyhedralSurface readPolyhedralSurface​(ByteReader reader,
                                                              boolean hasZ,
                                                              boolean hasM)
                                                       throws IOException
        Read a Polyhedral Surface
        Parameters:
        reader - byte reader
        hasZ - has z flag
        hasM - has m flag
        Returns:
        polyhedral surface
        Throws:
        IOException - upon failure to read
      • readPolyhedralSurface

        public static PolyhedralSurface readPolyhedralSurface​(ByteReader reader,
                                                              GeometryFilter filter,
                                                              boolean hasZ,
                                                              boolean hasM)
                                                       throws IOException
        Read a Polyhedral Surface
        Parameters:
        reader - byte reader
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        polyhedral surface
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3
      • readTIN

        public static TIN readTIN​(ByteReader reader,
                                  boolean hasZ,
                                  boolean hasM)
                           throws IOException
        Read a TIN
        Parameters:
        reader - byte reader
        hasZ - has z flag
        hasM - has m flag
        Returns:
        TIN
        Throws:
        IOException - upon failure to read
      • readTIN

        public static TIN readTIN​(ByteReader reader,
                                  GeometryFilter filter,
                                  boolean hasZ,
                                  boolean hasM)
                           throws IOException
        Read a TIN
        Parameters:
        reader - byte reader
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        TIN
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3
      • readTriangle

        public static Triangle readTriangle​(ByteReader reader,
                                            boolean hasZ,
                                            boolean hasM)
                                     throws IOException
        Read a Triangle
        Parameters:
        reader - byte reader
        hasZ - has z flag
        hasM - has m flag
        Returns:
        triangle
        Throws:
        IOException - upon failure to read
      • readTriangle

        public static Triangle readTriangle​(ByteReader reader,
                                            GeometryFilter filter,
                                            boolean hasZ,
                                            boolean hasM)
                                     throws IOException
        Read a Triangle
        Parameters:
        reader - byte reader
        filter - geometry filter
        hasZ - has z flag
        hasM - has m flag
        Returns:
        triangle
        Throws:
        IOException - upon failure to read
        Since:
        2.0.3