Class Shapefile


  • public class Shapefile
    extends java.lang.Object
    • Constructor Detail

      • Shapefile

        public Shapefile​(java.net.URL url)
        Creates and initialises a shapefile from a url
        Parameters:
        url - The url of the shapefile
      • Shapefile

        public Shapefile​(java.io.InputStream IS)
    • Method Detail

      • getInputStream

        private EndianDataInputStream getInputStream()
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • readStream

        public void readStream​(GeometryFactory geometryFactory)
                        throws java.io.IOException,
                               ShapefileException,
                               java.lang.Exception
        Initialises a shapefile from disk. Use Shapefile(String) if you don't want to use LEDataInputStream directly (recomened)
        Throws:
        java.io.IOException
        ShapefileException
        java.lang.Exception
      • next

        public Geometry next()
                      throws java.io.IOException
        Returns the next geometry in the shapefile stream
        Returns:
        null at EOF
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • getShapeTypeDescription

        public static java.lang.String getShapeTypeDescription​(int index)
        Returns a string for the shape type of index.
        Parameters:
        index - An int coresponding to the shape type to be described
        Returns:
        A string descibing the shape type
      • getShapeHandler

        public static ShapeHandler getShapeHandler​(Geometry geom,
                                                   int ShapeFileDimentions)
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getShapeHandler

        public static ShapeHandler getShapeHandler​(int type)
                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • readIndex

        public void readIndex​(java.io.InputStream is)
                       throws java.io.IOException
        Throws:
        java.io.IOException