|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.h2gis.drivers.shp.internal.SHPDriver
public class SHPDriver
Merge ShapeFileReader and DBFReader.
TODO Handle SHP without SHX and/or DBF
How to use:
In Write mode,
Declare fields by calling initDriver(java.io.File, ShapeType, org.h2gis.drivers.dbf.internal.DbaseFileHeader)
then write row using
| Constructor Summary | |
|---|---|
SHPDriver()
|
|
| Method Summary | |
|---|---|
void |
close()
Close the file, free resources. |
DbaseFileHeader |
getDbaseFileHeader()
|
int |
getFieldCount()
|
int |
getGeometryFieldIndex()
|
Object[] |
getRow(long rowId)
|
long |
getRowCount()
|
ShapefileHeader |
getShapeFileHeader()
|
void |
initDriver(File shpFile,
ShapeType shapeType,
DbaseFileHeader dbaseHeader)
Init Driver for Write mode |
void |
initDriverFromFile(File shpFile)
Init this driver from existing files, then open theses files. |
void |
initDriverFromFile(File shpFile,
String forceEncoding)
Init this driver from existing files, then open theses files. |
void |
insertRow(Object[] values)
|
void |
setGeometryFieldIndex(int geometryFieldIndex)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SHPDriver()
| Method Detail |
|---|
public void setGeometryFieldIndex(int geometryFieldIndex)
geometryFieldIndex - The geometry field index in getRow() array.
public void insertRow(Object[] values)
throws IOException
IOExceptionpublic int getGeometryFieldIndex()
public void initDriver(File shpFile,
ShapeType shapeType,
DbaseFileHeader dbaseHeader)
throws IOException
shpFile - shapeType - dbaseHeader -
IOException
public void initDriverFromFile(File shpFile)
throws IOException
shpFile - Shape file path.
IOException
public void initDriverFromFile(File shpFile,
String forceEncoding)
throws IOException
shpFile - Shape file path.forceEncoding - If defined use this encoding instead of the one defined in dbf header.
IOExceptionpublic DbaseFileHeader getDbaseFileHeader()
public long getRowCount()
getRowCount in interface FileDriverpublic ShapefileHeader getShapeFileHeader()
public void close()
throws IOException
FileDriver
close in interface FileDriverIOExceptionpublic int getFieldCount()
public Object[] getRow(long rowId)
throws IOException
getRow in interface FileDriverrowId - Row index [0-getRowCount()[
IOException - Read error
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||