Class ShapeFileReader<E>

  • Type Parameters:
    E - is the type of elements which is red by this reader.
    All Implemented Interfaces:
    AutoCloseable, Iterable<E>

    public class ShapeFileReader<E>
    extends AbstractShapeFileReader<E>
    This class is a shape file reader that instance the default elements.

    To have a lower memory foot-print, call AbstractCommonShapeFileReader.disableSeek(). Indeed, the seek feature forces this reader to maintain a buffer of all the file content.

    The ShapeFileIndexReader, passed as parameter of the constructors, is mandatory to seek.

    The specification of the ESRI Shape file format is described in the July 98 specification document.

    Since:
    14.0
    Version:
    17.0 2020-01-04 14:41:52
    Author:
    Stéphane GALLAND, Olivier LAMOTTE
    Maven Group Id:
    org.arakhne.afc.advanced
    Maven Artifact Id:
    shapefile
    • Field Detail

      • factory

        protected final ElementFactory<E> factory
        This object describes how to create instance of shape file elements.
    • Constructor Detail

      • ShapeFileReader

        public ShapeFileReader​(InputStream inputStream,
                               ElementFactory<E> factory)
        Create a reader of shapes from specified input stream.
        Parameters:
        inputStream - is the stream to read.
        factory - is the object that describes how to create instance of elements.
      • ShapeFileReader

        public ShapeFileReader​(InputStream inputStream,
                               DBaseFileReader dbase_importer,
                               ElementFactory<E> factory)
        Create a reader of shapes from specified input stream.
        Parameters:
        inputStream - is the stream to read.
        factory - is the object that describes how to create instance of elements.
        dbase_importer - is the dBase reader to use to read the attribute's values.
      • ShapeFileReader

        public ShapeFileReader​(InputStream inputStream,
                               ShapeFileIndexReader shxReader,
                               ElementFactory<E> factory)
        Create a reader of shapes from specified input stream.
        Parameters:
        inputStream - is the stream to read.
        factory - is the object that describes how to create instance of elements.
        shxReader - is the shape file index reader used to access to the shape file record indexes.
      • ShapeFileReader

        public ShapeFileReader​(InputStream inputStream,
                               DBaseFileReader dbase_importer,
                               ShapeFileIndexReader shxReader,
                               ElementFactory<E> factory)
        Create a reader of shapes from specified input stream.
        Parameters:
        inputStream - is the stream to read.
        factory - is the object that describes how to create instance of elements.
        dbase_importer - is the dBase reader to use to read the attribute's values.
        shxReader - is the shape file index reader used to access to the shape file record indexes.
      • ShapeFileReader

        public ShapeFileReader​(ReadableByteChannel channel,
                               ElementFactory<E> factory)
        Create a reader of shapes from specified channel .
        Parameters:
        channel - is the channel to read from.
        factory - is the object that describes how to create instance of elements.
      • ShapeFileReader

        public ShapeFileReader​(ReadableByteChannel channel,
                               DBaseFileReader dbase_importer,
                               ElementFactory<E> factory)
        Create a reader of shapes from specified channel.
        Parameters:
        channel - is the channel to read from.
        factory - is the object that describes how to create instance of elements.
        dbase_importer - is the dBase reader to use to read the attribute's values.
      • ShapeFileReader

        public ShapeFileReader​(ReadableByteChannel channel,
                               ShapeFileIndexReader shxReader,
                               ElementFactory<E> factory)
        Create a reader of shapes from specified channel.
        Parameters:
        channel - is the channel to read from.
        factory - is the object that describes how to create instance of elements.
        shxReader - is the shape file index reader used to access to the shape file record indexes.
      • ShapeFileReader

        public ShapeFileReader​(ReadableByteChannel channel,
                               DBaseFileReader dbase_importer,
                               ShapeFileIndexReader shxReader,
                               ElementFactory<E> factory)
        Create a reader of shapes from specified channel.
        Parameters:
        channel - is the channel to read from.
        factory - is the object that describes how to create instance of elements.
        dbase_importer - is the dBase reader to use to read the attribute's values.
        shxReader - is the shape file index reader used to access to the shape file record indexes.
      • ShapeFileReader

        public ShapeFileReader​(File file,
                               ElementFactory<E> factory)
                        throws IOException
        Create a reader of shapes from specified file.
        Parameters:
        file - is the file to open and read.
        factory - is the object that describes how to create instance of elements.
        Throws:
        IOException - in case of error.
      • ShapeFileReader

        public ShapeFileReader​(File file,
                               DBaseFileReader dbase_importer,
                               ElementFactory<E> factory)
                        throws IOException
        Create a reader of shapes from specified file.
        Parameters:
        file - is the file to open and read.
        factory - is the object that describes how to create instance of elements.
        dbase_importer - is the dBase reader to use to read the attribute's values.
        Throws:
        IOException - in case of error.
      • ShapeFileReader

        public ShapeFileReader​(File file,
                               ShapeFileIndexReader shxReader,
                               ElementFactory<E> factory)
                        throws IOException
        Create a reader of shapes from specified file.
        Parameters:
        file - is the file to open and read.
        factory - is the object that describes how to create instance of elements.
        shxReader - is the shape file index reader used to access to the shape file record indexes.
        Throws:
        IOException - in case of error.
      • ShapeFileReader

        public ShapeFileReader​(File file,
                               DBaseFileReader dbase_importer,
                               ShapeFileIndexReader shxReader,
                               ElementFactory<E> factory)
                        throws IOException
        Create a reader of shapes from specified file.
        Parameters:
        file - is the file to open and read.
        factory - is the object that describes how to create instance of elements.
        dbase_importer - is the dBase reader to use to read the attribute's values.
        shxReader - is the shape file index reader used to access to the shape file record indexes.
        Throws:
        IOException - in case of error.
      • ShapeFileReader

        public ShapeFileReader​(URL url,
                               ElementFactory<E> factory)
                        throws IOException
        Create a reader of shapes from specified URL.
        Parameters:
        url - is the url of the stream to read.
        factory - is the object that describes how to create instance of elements.
        Throws:
        IOException - in case of error.
      • ShapeFileReader

        public ShapeFileReader​(URL url,
                               DBaseFileReader dbase_importer,
                               ElementFactory<E> factory)
                        throws IOException
        Create a reader of shapes from specified URL.
        Parameters:
        url - is the url of the stream to read.
        factory - is the object that describes how to create instance of elements.
        dbase_importer - is the dBase reader to use to read the attribute's values.
        Throws:
        IOException - in case of error.
      • ShapeFileReader

        public ShapeFileReader​(URL url,
                               ShapeFileIndexReader shxReader,
                               ElementFactory<E> factory)
                        throws IOException
        Create a reader of shapes from specified URL.
        Parameters:
        url - is the url of the stream to read.
        factory - is the object that describes how to create instance of elements.
        shxReader - is the shape file index reader used to access to the shape file record indexes.
        Throws:
        IOException - in case of error.
      • ShapeFileReader

        public ShapeFileReader​(URL url,
                               DBaseFileReader dbase_importer,
                               ShapeFileIndexReader shxReader,
                               ElementFactory<E> factory)
                        throws IOException
        Create a reader of shapes from specified URL.
        Parameters:
        url - is the url of the stream to read.
        factory - is the object that describes how to create instance of elements.
        dbase_importer - is the dBase reader to use to read the attribute's values.
        shxReader - is the shape file index reader used to access to the shape file record indexes.
        Throws:
        IOException - in case of error.