|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.h2gis.drivers.shp.internal.ShapefileWriter
public class ShapefileWriter
ShapefileWriter allows for the storage of geometries in esris shp format.
During writing, an index will also be created. To create a ShapefileWriter,
do something like
GeometryCollection geoms;
File shp = new File("myshape.shp");
File shx = new File("myshape.shx");
ShapefileWriter writer = new ShapefileWriter(
shp.getChannel(),shx.getChannel()
);
writer.write(geoms,ShapeType.ARC);
This example assumes that each shape in the collection is a LineString.
| Constructor Summary | |
|---|---|
ShapefileWriter(FileChannel shpChannel,
FileChannel shxChannel)
Creates a new instance of ShapeFileWriter |
|
| Method Summary | |
|---|---|
void |
close()
Close the underlying Channels. |
FileChannel |
getShpChannel()
|
void |
writeGeometry(com.vividsolutions.jts.geom.Geometry g)
Write a single Geometry to this shapefile. |
void |
writeHeaders(ShapeType type)
Write the headers for this shapefile.Use this function before inserting the first geometry, then when all geometries are inserted. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ShapefileWriter(FileChannel shpChannel,
FileChannel shxChannel)
throws IOException
shpChannel - shxChannel -
IOException| Method Detail |
|---|
public FileChannel getShpChannel()
public void writeHeaders(ShapeType type)
throws IOException
type - Shape type
IOException
public void writeGeometry(com.vividsolutions.jts.geom.Geometry g)
throws IOException
g -
IOException
public void close()
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||