igeo.io

## Class IShapeFileImporter

- java.lang.Object
- - igeo.io.IShapeFileImporter

-     public class IShapeFileImporter
      extends java.lang.Object

  ESRI Shapefile Importer
  Author:
    Satoru Sugihara

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `IShapeFileImporter.Constraint`
    `static class` | `IShapeFileImporter.GridConstraint`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) static IShapeFileImporter.Constraint` | `constraint`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IShapeFileImporter()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `checkBufLen(byte[] buf, int idx, int len)`
    `static byte[]` | `copy(byte[] buf, int idx, int len)`
    `static java.lang.String` | `getFileNameWithExtension(java.lang.String filename, java.lang.String extension)`
    `static java.lang.String` | `getFilePrefix(java.lang.String filename)`
    `static java.io.File` | `getFileWithExtension(java.io.File file, java.lang.String extension)`
    `static void` | `main(java.lang.String[] args)`
    `static void` | `makeMultiPatch(byte[] buf, int id)`
    `static int` | `makeMultiPatch(java.io.InputStream is, int id, int byteLenh, java.util.ArrayList<IObject[]> createdObjects)`
    `static void` | `makeMultiPoint(byte[] buf, int id)`
    `static int` | `makeMultiPoint(java.io.InputStream is, int id, int byteLenh, java.util.ArrayList<IObject[]> createdObjects)`
    `static void` | `makeMultiPointZ(byte[] buf, int id)`
    `static int` | `makeMultiPointZ(java.io.InputStream is, int id, int byteLenh, java.util.ArrayList<IObject[]> createdObjects)`
    `static void` | `makePoint(byte[] buf, int id)`
    `static int` | `makePoint(java.io.InputStream is, int id, int byteLen, java.util.ArrayList<IObject[]> createdObjects)`
    `static void` | `makePointZ(byte[] buf, int id)`
    `static int` | `makePointZ(java.io.InputStream is, int id, int byteLen, java.util.ArrayList<IObject[]> createdObjects)`
    `static void` | `makePolyline(byte[] buf, int id)`
    `static int` | `makePolyline(java.io.InputStream is, int id, int byteLenh, java.util.ArrayList<IObject[]> createdObjects)`
    `static void` | `makePolylineZ(byte[] buf, int id)`
    `static int` | `makePolylineZ(java.io.InputStream is, int id, int byteLenh, java.util.ArrayList<IObject[]> createdObjects)`
    `static java.util.ArrayList<IObject>` | `read(java.io.File file, IServerI server)` Reading a SHP file and creating objects in a server.
    `static java.util.ArrayList<IObject>` | `read(java.io.InputStream shpStream, java.io.InputStream dbfStream, IServerI server)`
    `static java.util.ArrayList<IObject>` | `read(java.lang.String filename, IServerI server)` Reading a SHP file and creating objects in a server.
    `static IEsri.Attributes[]` | `readDBF(java.io.File file, IServerI server)` Reading a DBF file The main entry of the importer class.
    `static IEsri.Attributes[]` | `readDBF(java.io.InputStream is, IServerI server)` Reading an DBF file
    `static IEsri.Attributes[]` | `readDBF(java.lang.String filename, IServerI server)` Reading a DBF file The main entry of the importer class.
    `static IEsri.AttributeHeader` | `readDBFHeader(java.io.InputStream is)`
    `static IEsri.Attributes` | `readDBFRecord(java.io.InputStream is, IEsri.AttributeHeader header)`
    `static double` | `readDoubleLE(byte[] buf, int idx)`
    `static double` | `readDoubleLE(java.io.InputStream is)`
    `static double[]` | `readDoubles(byte[] buf, int num, int idx)`
    `static double[]` | `readDoubles(java.io.InputStream is, int num)`
    `static long` | `readIntBE(byte[] buf, int idx)` big endian integer
    `static long` | `readIntBE(java.io.InputStream is)`
    `static int[]` | `readIntegers(byte[] buf, int num, int idx)`
    `static int[]` | `readIntegers(java.io.InputStream is, int num)`
    `static long` | `readIntLE(byte[] buf, int idx)` little endian integer
    `static long` | `readIntLE(java.io.InputStream is)` little endian integer
    `static IVec` | `readPoint(byte[] buf, int idx)`
    `static IVec` | `readPoint(java.io.InputStream is)`
    `static IVec[]` | `readPoints(byte[] buf, int num, int idx)`
    `static IVec[]` | `readPoints(java.io.InputStream is, int num)`
    `static IVec` | `readPointZ(byte[] buf, int idx)`
    `static IVec` | `readPointZ(java.io.InputStream is, int byteLen)`
    `static int` | `readShortBE(java.io.InputStream is)`
    `static int` | `readShortLE(java.io.InputStream is)` little endian integer
    `static java.util.ArrayList<IObject[]>` | `readSHP(java.io.File file, IServerI server)` Reading a SHP file and creating objects in a server.
    `static java.util.ArrayList<IObject[]>` | `readSHP(java.io.InputStream is, IServerI server)` Reading an SHP file and creating objects in a server.
    `static java.util.ArrayList<IObject[]>` | `readSHP(java.lang.String filename, IServerI server)` Reading a SHP file and creating objects in a server.
    `static void` | `readSHPHeader(java.io.InputStream is)`
    `static boolean` | `readSHPRecord(java.io.InputStream is, boolean skipRecord, java.util.ArrayList<IObject[]> createdObjects)`
    `static void` | `skip(java.io.InputStream is, long len)`
    `static java.lang.String` | `stringWithoutSpace(byte[] buf)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### constraint

          static IShapeFileImporter.Constraint constraint

  - ### Constructor Detail

    - #### IShapeFileImporter

          public IShapeFileImporter()

  - ### Method Detail

    - #### copy

          public static byte[] copy(byte[] buf,
                                    int idx,
                                    int len)

    - #### checkBufLen

          public static boolean checkBufLen(byte[] buf,
                                            int idx,
                                            int len)

    - #### readIntBE

          public static long readIntBE(java.io.InputStream is)
                                throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### readShortBE

          public static int readShortBE(java.io.InputStream is)
                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### readIntBE

          public static long readIntBE(byte[] buf,
                                       int idx)

      big endian integer

    - #### readIntLE

          public static long readIntLE(java.io.InputStream is)
                                throws java.io.IOException

      little endian integer
      Throws:
        `java.io.IOException`

    - #### readShortLE

          public static int readShortLE(java.io.InputStream is)
                                 throws java.io.IOException

      little endian integer
      Throws:
        `java.io.IOException`

    - #### readIntLE

          public static long readIntLE(byte[] buf,
                                       int idx)

      little endian integer

    - #### readDoubleLE

          public static double readDoubleLE(java.io.InputStream is)
                                     throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### readDoubleLE

          public static double readDoubleLE(byte[] buf,
                                            int idx)

    - #### readSHPHeader

          public static void readSHPHeader(java.io.InputStream is)

    - #### readSHPRecord

          public static boolean readSHPRecord(java.io.InputStream is,
                                              boolean skipRecord,
                                              java.util.ArrayList<IObject[]> createdObjects)

    - #### skip

          public static void skip(java.io.InputStream is,
                                  long len)
                           throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### readPoint

          public static IVec readPoint(java.io.InputStream is)
                                throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### readPoint

          public static IVec readPoint(byte[] buf,
                                       int idx)

    - #### readPointZ

          public static IVec readPointZ(java.io.InputStream is,
                                        int byteLen)
                                 throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### readPointZ

          public static IVec readPointZ(byte[] buf,
                                        int idx)

    - #### readPoints

          public static IVec[] readPoints(java.io.InputStream is,
                                          int num)
                                   throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### readPoints

          public static IVec[] readPoints(byte[] buf,
                                          int num,
                                          int idx)

    - #### readIntegers

          public static int[] readIntegers(byte[] buf,
                                           int num,
                                           int idx)

    - #### readIntegers

          public static int[] readIntegers(java.io.InputStream is,
                                           int num)
                                    throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### readDoubles

          public static double[] readDoubles(java.io.InputStream is,
                                             int num)
                                      throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### readDoubles

          public static double[] readDoubles(byte[] buf,
                                             int num,
                                             int idx)

    - #### makePoint

          public static void makePoint(byte[] buf,
                                       int id)

    - #### makePoint

          public static int makePoint(java.io.InputStream is,
                                      int id,
                                      int byteLen,
                                      java.util.ArrayList<IObject[]> createdObjects)

    - #### makePointZ

          public static void makePointZ(byte[] buf,
                                        int id)

    - #### makePointZ

          public static int makePointZ(java.io.InputStream is,
                                       int id,
                                       int byteLen,
                                       java.util.ArrayList<IObject[]> createdObjects)

    - #### makeMultiPoint

          public static void makeMultiPoint(byte[] buf,
                                            int id)

    - #### makeMultiPoint

          public static int makeMultiPoint(java.io.InputStream is,
                                           int id,
                                           int byteLenh,
                                           java.util.ArrayList<IObject[]> createdObjects)

    - #### makeMultiPointZ

          public static void makeMultiPointZ(byte[] buf,
                                             int id)

    - #### makeMultiPointZ

          public static int makeMultiPointZ(java.io.InputStream is,
                                            int id,
                                            int byteLenh,
                                            java.util.ArrayList<IObject[]> createdObjects)

    - #### makePolyline

          public static void makePolyline(byte[] buf,
                                          int id)

    - #### makePolyline

          public static int makePolyline(java.io.InputStream is,
                                         int id,
                                         int byteLenh,
                                         java.util.ArrayList<IObject[]> createdObjects)

    - #### makePolylineZ

          public static void makePolylineZ(byte[] buf,
                                           int id)

    - #### makePolylineZ

          public static int makePolylineZ(java.io.InputStream is,
                                          int id,
                                          int byteLenh,
                                          java.util.ArrayList<IObject[]> createdObjects)

    - #### makeMultiPatch

          public static void makeMultiPatch(byte[] buf,
                                            int id)

    - #### makeMultiPatch

          public static int makeMultiPatch(java.io.InputStream is,
                                           int id,
                                           int byteLenh,
                                           java.util.ArrayList<IObject[]> createdObjects)

    - #### getFilePrefix

          public static java.lang.String getFilePrefix(java.lang.String filename)

    - #### getFileNameWithExtension

          public static java.lang.String getFileNameWithExtension(java.lang.String filename,
                                                                  java.lang.String extension)

    - #### getFileWithExtension

          public static java.io.File getFileWithExtension(java.io.File file,
                                                          java.lang.String extension)

    - #### read

          public static java.util.ArrayList<IObject> read(java.io.File file,
                                                          IServerI server)

      Reading a SHP file and creating objects in a server. The main entry of the importer class.
      Parameters:
        `file` - An importing file object.
        `server` - A server interface to put imported objects in.
      Returns:
        ArrayList of created IObject.

    - #### read

          public static java.util.ArrayList<IObject> read(java.io.InputStream shpStream,
                                                          java.io.InputStream dbfStream,
                                                          IServerI server)

    - #### read

          public static java.util.ArrayList<IObject> read(java.lang.String filename,
                                                          IServerI server)

      Reading a SHP file and creating objects in a server. The main entry of the importer class.
      Parameters:
        `filename` - An importing file name.
        `server` - A server interface to put imported objects in.
      Returns:
        ArrayList of created IObject.

    - #### readSHP

          public static java.util.ArrayList<IObject[]> readSHP(java.io.File file,
                                                               IServerI server)

      Reading a SHP file and creating objects in a server. The main entry of the importer class.
      Parameters:
        `file` - An importing file object.
        `server` - A server interface to put imported objects in.
      Returns:
        ArrayList of created IObject.

    - #### readSHP

          public static java.util.ArrayList<IObject[]> readSHP(java.lang.String filename,
                                                               IServerI server)

      Reading a SHP file and creating objects in a server. The main entry of the importer class.
      Parameters:
        `filename` - An importing file name.
        `server` - A server interface to put imported objects in.
      Returns:
        ArrayList of created IObject.

    - #### readSHP

          public static java.util.ArrayList<IObject[]> readSHP(java.io.InputStream is,
                                                               IServerI server)

      Reading an SHP file and creating objects in a server.
      Parameters:
        `is` - input stream of an importing file.
        `server` - A server interface to put imported objects in.
      Returns:
        ArrayList of created IObject.

    - #### main

          public static void main(java.lang.String[] args)

    - #### readDBF

          public static IEsri.Attributes[] readDBF(java.io.File file,
                                                   IServerI server)

      Reading a DBF file The main entry of the importer class.
      Parameters:
        `file` - An importing file object.
        `server` - A server interface to put imported objects in.
      Returns:
        ArrayList of created IObject.

    - #### readDBF

          public static IEsri.Attributes[] readDBF(java.lang.String filename,
                                                   IServerI server)

      Reading a DBF file The main entry of the importer class.
      Parameters:
        `filename` - An importing filename.
        `server` - A server interface to put imported objects in.
      Returns:
        ArrayList of created IObject.

    - #### readDBF

          public static IEsri.Attributes[] readDBF(java.io.InputStream is,
                                                   IServerI server)

      Reading an DBF file
      Parameters:
        `is` - input stream of an importing file.
        `server` - A server interface to put imported objects in.
      Returns:
        ArrayList of created IObject.

    - #### stringWithoutSpace

          public static java.lang.String stringWithoutSpace(byte[] buf)

    - #### readDBFRecord

          public static IEsri.Attributes readDBFRecord(java.io.InputStream is,
                                                       IEsri.AttributeHeader header)

    - #### readDBFHeader

          public static IEsri.AttributeHeader readDBFHeader(java.io.InputStream is)