public class ShapeUtils extends java.lang.Object implements ShapeConstants
DBF_ATTRIBUTE, DBF_AUTOINCREMENT, DBF_BINARY, DBF_CHARACTER, DBF_DATE, DBF_DOUBLE, DBF_FLOAT, DBF_LOGICAL, DBF_LONG, DBF_MEMO, DBF_NUMERIC, DBF_OLE, DBF_TIMESTAMP, DBF_TYPE_AUTOINCREMENT, DBF_TYPE_BINARY, DBF_TYPE_CHARACTER, DBF_TYPE_DATE, DBF_TYPE_DOUBLE, DBF_TYPE_FLOAT, DBF_TYPE_LOGICAL, DBF_TYPE_LONG, DBF_TYPE_MEMO, DBF_TYPE_NUMERIC, DBF_TYPE_OLE, DBF_TYPE_TIMESTAMP, PARAM_DBF, PARAM_SHP, PARAM_SHX, SHAPE_BOUNDS_ATTRIBUTE, SHAPE_DBF_DASHPATTERN, SHAPE_DBF_DASHPHASE, SHAPE_DBF_DESCRIPTION, SHAPE_DBF_FILLCOLOR, SHAPE_DBF_INFO_ATTRIBUTE, SHAPE_DBF_LINECOLOR, SHAPE_DBF_LINEWIDTH, SHAPE_DBF_SELECTCOLOR, SHAPE_FILE_HEADER_LENGTH, SHAPE_FILE_RECORD_HEADER_LENGTH, SHAPE_INDEX_ATTRIBUTE, SHAPE_MAX_MEASURE_ATTRIBUTE, SHAPE_MAX_Z_ATTRIBUTE, SHAPE_MEASURE_ATTRIBUTE, SHAPE_MIN_MEASURE_ATTRIBUTE, SHAPE_MIN_Z_ATTRIBUTE, SHAPE_TYPE_ARC, SHAPE_TYPE_MULTIPATCH, SHAPE_TYPE_MULTIPOINT, SHAPE_TYPE_MULTIPOINTM, SHAPE_TYPE_MULTIPOINTZ, SHAPE_TYPE_NULL, SHAPE_TYPE_POINT, SHAPE_TYPE_POINTM, SHAPE_TYPE_POINTZ, SHAPE_TYPE_POLYGON, SHAPE_TYPE_POLYGONM, SHAPE_TYPE_POLYGONZ, SHAPE_TYPE_POLYLINE, SHAPE_TYPE_POLYLINEM, SHAPE_TYPE_POLYLINEZ, SHAPE_Z_ATTRIBUTE
Constructor and Description |
---|
ShapeUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getStringForType(int shapeType)
Return a readable string for a shape int type.
|
static int |
readBEInt(byte[] b,
int off)
Reads a big endian integer.
|
static ESRIBoundingBox |
readBox(byte[] b,
int off)
Reads a bounding box record.
|
static double |
readLEDouble(byte[] b,
int off)
Reads a little endian double.
|
static int |
readLEInt(BinaryBufferedFile in)
Reads a little endian int from the current location of the given file.
|
static int |
readLEInt(byte[] b,
int off)
Reads a little endian integer.
|
static long |
readLELong(byte[] b,
int off)
Reads a little endian 8 byte integer.
|
static ESRIPoint |
readPoint(byte[] b,
int off)
Reads a point record.
|
static int |
writeBEInt(byte[] b,
int off,
int val)
Writes the given integer to the given buffer at the given location in big
endian format.
|
static int |
writeBox(byte[] b,
int off,
ESRIBoundingBox box)
Writes the given bounding box to the given buffer at the given location.
|
static int |
writeLEDouble(byte[] b,
int off,
double val)
Writes the given double to the given buffer at the given location in
little endian format.
|
static int |
writeLEInt(byte[] b,
int off,
int val)
Writes the given integer to the given buffer at the given location in
little endian format.
|
static int |
writeLELong(byte[] b,
int off,
long val)
Writes the given long to the given buffer at the given location in little
endian format.
|
static int |
writePoint(byte[] b,
int off,
ESRIPoint point)
Writes the given point to the given buffer at the given location.
|
public static int readBEInt(byte[] b, int off)
b
- the raw data bufferoff
- the offset into the buffer where the int residespublic static int readLEInt(byte[] b, int off)
b
- the raw data bufferoff
- the offset into the buffer where the int residespublic static int readLEInt(BinaryBufferedFile in) throws java.io.IOException
in
- an input filejava.io.IOException
public static long readLELong(byte[] b, int off)
b
- the raw data bufferoff
- the offset into the buffer where the long residespublic static double readLEDouble(byte[] b, int off)
b
- the raw data bufferoff
- the offset into the buffer where the double residespublic static ESRIPoint readPoint(byte[] b, int off)
b
- the raw data bufferoff
- the offset into the buffer where the int residespublic static ESRIBoundingBox readBox(byte[] b, int off)
b
- the raw data bufferoff
- the offset into the buffer where the int residespublic static int writeBEInt(byte[] b, int off, int val)
b
- the data bufferoff
- the offset into the buffer where writing should occurval
- the integer to writepublic static int writeLEInt(byte[] b, int off, int val)
b
- the data bufferoff
- the offset into the buffer where writing should occurval
- the integer to writepublic static int writeLELong(byte[] b, int off, long val)
b
- the data bufferoff
- the offset into the buffer where writing should occurval
- the long to writepublic static int writeLEDouble(byte[] b, int off, double val)
b
- the data bufferoff
- the offset into the buffer where writing should occurval
- the double to writepublic static int writePoint(byte[] b, int off, ESRIPoint point)
b
- the data bufferoff
- the offset into the buffer where writing should occurpoint
- the point to writepublic static int writeBox(byte[] b, int off, ESRIBoundingBox box)
b
- the data bufferoff
- the offset into the buffer where writing should occurbox
- the bounding box to writepublic static java.lang.String getStringForType(int shapeType)
shapeType
- Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details