Package nz.org.riskscape.engine.output
Class ShapefileWriter2
java.lang.Object
nz.org.riskscape.engine.output.RiskscapeWriter
nz.org.riskscape.engine.output.ShapefileWriter2
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class ShapefileWriter2
extends nz.org.riskscape.engine.output.RiskscapeWriter
A RiskscapeWriter
that talks to geotools's codecs to avoid the performance impact of using all the feature
source diffing code and index generation.
Writing out > 300k rows with the ShapefileWriter began to slow things down, eventually grinding to a halt at about 550k rows due to a slight mismatch and possible misuse of the Geotools ContentStore API.
See ShapefileFeatureWriter
for more details/reference, as a lot of
the behaviour / details of how the codec work were figured out from there.
Varies from the previous writer by dropping column prefixes from parent struct.
TODO * add in file size checks from other code
-
Field Summary
-
Constructor Summary
ConstructorDescriptionShapefileWriter2
(File shpPath, nz.org.riskscape.engine.types.Struct type, nz.org.riskscape.engine.SRIDSet sridSet, nz.org.riskscape.problem.ProblemSink problemSink) ShapefileWriter2
(File shpPath, nz.org.riskscape.engine.types.Struct type, nz.org.riskscape.engine.SRIDSet sridSet, nz.org.riskscape.problem.ProblemSink problemSink, boolean prjSingleLine) -
Method Summary
-
Field Details
-
timeZone
-
charset
-
-
Constructor Details
-
ShapefileWriter2
public ShapefileWriter2(File shpPath, nz.org.riskscape.engine.types.Struct type, nz.org.riskscape.engine.SRIDSet sridSet, nz.org.riskscape.problem.ProblemSink problemSink) throws IOException - Throws:
IOException
-
ShapefileWriter2
public ShapefileWriter2(File shpPath, nz.org.riskscape.engine.types.Struct type, nz.org.riskscape.engine.SRIDSet sridSet, nz.org.riskscape.problem.ProblemSink problemSink, boolean prjSingleLine) throws IOException - Throws:
IOException
-
-
Method Details
-
createDbaseHeader
protected org.geotools.data.shapefile.dbf.DbaseFileHeader createDbaseHeader() -
createShpWriter
- Throws:
IOException
-
createDbaseWriter
- Throws:
IOException
-
close
- Throws:
IOException
-
write
public void write(nz.org.riskscape.engine.Tuple value) - Specified by:
write
in classnz.org.riskscape.engine.output.RiskscapeWriter
-
getStoredAt
- Specified by:
getStoredAt
in classnz.org.riskscape.engine.output.RiskscapeWriter
-