|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.data.shapefile.shp.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.
ShapefileDataStore
Constructor Summary | |
ShapefileWriter(java.nio.channels.FileChannel shpChannel,
java.nio.channels.FileChannel shxChannel,
Lock lock)
Creates a new instance of ShapeFileWriter |
Method Summary | |
void |
close()
Close the underlying Channels. |
void |
skipHeaders()
Allocate internal buffers and position the channels to the beginning or the record section of the shapefile. |
void |
write(com.vividsolutions.jts.geom.GeometryCollection geometries,
ShapeType type)
Bulk write method for writing a collection of (hopefully) like geometries of the given ShapeType. |
void |
writeGeometry(com.vividsolutions.jts.geom.Geometry g)
Write a single Geometry to this shapefile. |
void |
writeHeaders(com.vividsolutions.jts.geom.Envelope bounds,
ShapeType type,
int numberOfGeometries,
int fileLength)
Write the headers for this shapefile including the bounds, shape type, the number of geometries and the total fileLength (in actual bytes, NOT 16 bit words). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ShapefileWriter(java.nio.channels.FileChannel shpChannel, java.nio.channels.FileChannel shxChannel, Lock lock) throws java.io.IOException
java.io.IOException
Method Detail |
public void writeHeaders(com.vividsolutions.jts.geom.Envelope bounds, ShapeType type, int numberOfGeometries, int fileLength) throws java.io.IOException
java.io.IOException
public void skipHeaders() throws java.io.IOException
java.io.IOException
public void writeGeometry(com.vividsolutions.jts.geom.Geometry g) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public void write(com.vividsolutions.jts.geom.GeometryCollection geometries, ShapeType type) throws java.io.IOException, ShapefileException
java.io.IOException
ShapefileException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |