Class ShapefileDatasetWriter
java.lang.Object
ch.so.agi.gretl.internal.shapefile.core.ShapefileDatasetWriter
- All Implemented Interfaces:
AutoCloseable
Streaming, low-level writer for a complete Shapefile dataset (
.shp, .shx,
.dbf, plus an optional .cpg and .prj).
The dataset is written to temporary *.tmp files and only committed to the final names
in finish(). close() without a successful finish() deletes the temporary
files and leaves no partial output.
This class knows nothing about INTERLIS or IOX. It accepts plain JTS geometries and DBF attribute value arrays; the translation from IOX objects is the responsibility of the writer adapter built in a later phase.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()cpgPath()dbfPath()voidfinish()static ShapefileDatasetWriteropen(Path targetShp, ShapefileSchema schema, ShapefileWriteOptions options) prjPath()intshpPath()shxPath()void
-
Method Details
-
open
public static ShapefileDatasetWriter open(Path targetShp, ShapefileSchema schema, ShapefileWriteOptions options) throws IOException, ShapefileMappingException - Throws:
IOExceptionShapefileMappingException
-
write
public void write(com.vividsolutions.jts.geom.Geometry geometry, Object[] dbfValues) throws IOException, ShapefileMappingException - Throws:
IOExceptionShapefileMappingException
-
finish
- Throws:
IOExceptionShapefileMappingException
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
shpPath
-
shxPath
-
dbfPath
-
cpgPath
-
prjPath
-
recordCount
public int recordCount()
-