Class TWKBReader


  • public class TWKBReader
    extends Object
    Reads Tiny Well-known Binary (TWKB)into a JTS geometry.

    This class is designed to support reuse of a single instance to read multiple geometries. This * class is not thread-safe; each thread should create its own instance.

    Author:
    James Hughes, Andrea Aime
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected static class  TWKBReader.TWKBMetadata  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected CoordinateSequenceFactory csFactory  
    • Constructor Summary

      Constructors 
      Constructor Description
      TWKBReader​(GeometryFactory geometryFactory)  
    • Field Detail

      • csFactory

        protected CoordinateSequenceFactory csFactory
    • Constructor Detail

      • TWKBReader

        public TWKBReader​(GeometryFactory geometryFactory)
    • Method Detail

      • read

        public Geometry read​(byte[] bytes)
                      throws ParseException,
                             IOException
        Throws:
        ParseException
        IOException
      • read

        public Geometry read​(InStream is)
                      throws IOException,
                             ParseException
        Throws:
        IOException
        ParseException
      • readCoordinateSequence

        protected CoordinateSequence readCoordinateSequence​(int numPts,
                                                            TWKBReader.TWKBMetadata metadata)
                                                     throws IOException
        Throws:
        IOException
      • readNextDouble

        protected double readNextDouble​(double scale)
                                 throws IOException
        Throws:
        IOException