use of com.revolsys.io.endian.ResourceEndianOutput in project com.revolsys.open by revolsys.
the class ShapefileRecordWriter method init.
@Override
protected void init() throws IOException {
super.init();
final RecordDefinitionImpl recordDefinition = (RecordDefinitionImpl) getRecordDefinition();
if (recordDefinition != null) {
this.geometryFieldName = recordDefinition.getGeometryFieldName();
if (this.geometryFieldName != null) {
this.out = new ResourceEndianOutput(this.resource);
writeHeader(this.out);
if (!hasField(this.geometryFieldName)) {
addFieldDefinition(this.geometryFieldName, XBaseFieldDefinition.OBJECT_TYPE, 0, 0);
}
final Resource indexResource = this.resource.newResourceChangeExtension("shx");
if (indexResource != null) {
this.indexOut = new ResourceEndianOutput(indexResource);
writeHeader(this.indexOut);
}
this.geometryFactory = getProperty(IoConstants.GEOMETRY_FACTORY);
final Object geometryType = getProperty(IoConstants.GEOMETRY_TYPE);
if (geometryType != null) {
this.geometryDataType = DataTypes.getDataType(geometryType.toString());
}
}
}
}
Aggregations