Class EWKBUtils.EWKBTarget

  • Enclosing class:
    EWKBUtils

    public static final class EWKBUtils.EWKBTarget
    extends GeometryUtils.Target
    Converter output target that writes a EWKB.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private byte[] buf  
      private int dimensionSystem  
      private java.io.ByteArrayOutputStream output  
      private int srid  
      private int type  
    • Constructor Summary

      Constructors 
      Constructor Description
      EWKBTarget​(java.io.ByteArrayOutputStream output, int dimensionSystem)
      Creates a new EWKB output target.
    • Field Detail

      • output

        private final java.io.ByteArrayOutputStream output
      • dimensionSystem

        private final int dimensionSystem
      • buf

        private final byte[] buf
      • type

        private int type
      • srid

        private int srid
    • Constructor Detail

      • EWKBTarget

        public EWKBTarget​(java.io.ByteArrayOutputStream output,
                          int dimensionSystem)
        Creates a new EWKB output target.
        Parameters:
        output - output stream
        dimensionSystem - dimension system to use
    • Method Detail

      • startPolygon

        protected void startPolygon​(int numInner,
                                    int numPoints)
        Description copied from class: GeometryUtils.Target
        Invoked before writing a POLYGON. If polygon is empty, both parameters are 0.
        Overrides:
        startPolygon in class GeometryUtils.Target
        Parameters:
        numInner - number of inner polygons
        numPoints - number of points in outer polygon
      • startPolygonInner

        protected void startPolygonInner​(int numInner)
        Description copied from class: GeometryUtils.Target
        Invoked before writing an inner polygon in POLYGON.
        Overrides:
        startPolygonInner in class GeometryUtils.Target
        Parameters:
        numInner - number of points in inner polygon
      • writeHeader

        private void writeHeader​(int type)
      • startCollectionItem

        protected GeometryUtils.Target startCollectionItem​(int index,
                                                           int total)
        Description copied from class: GeometryUtils.Target
        Invoked before writing of a collection item.
        Overrides:
        startCollectionItem in class GeometryUtils.Target
        Parameters:
        index - 0-based index of this item in the collection
        total - total number of items in the collection
        Returns:
        output target that should be used for processing of this collection item. May return this target or an custom sub-target.
      • addCoordinate

        protected void addCoordinate​(double x,
                                     double y,
                                     double z,
                                     double m,
                                     int index,
                                     int total)
        Description copied from class: GeometryUtils.Target
        Invoked to add a coordinate to a geometry.
        Specified by:
        addCoordinate in class GeometryUtils.Target
        Parameters:
        x - X coordinate
        y - Y coordinate
        z - Z coordinate (NaN if not used)
        m - M coordinate (NaN if not used)
        index - 0-based index of coordinate in the current sequence
        total - total number of coordinates in the current sequence
      • writeInt

        private void writeInt​(int v)
      • writeDouble

        private void writeDouble​(double v)