use of com.revolsys.record.schema.RecordDefinitionBuilder in project com.revolsys.open by revolsys.
the class RecordStoreLayerTest method beforeTest.
@Before
public void beforeTest() {
FileUtil.deleteDirectory(testDirectory, false);
final File testFile = new File(testDirectory, "test.gdb");
this.recordStore = FileGdbRecordStoreFactory.newRecordStore(testFile);
this.recordStore.initialize();
this.recordDefinition = //
new RecordDefinitionBuilder(TEST).addField("NAME", DataTypes.STRING, //
50).addField("COUNT", //
DataTypes.INT).addField("GEOMETRY", //
DataTypes.POINT).setGeometryFactory(//
GEOMETRY_FACTORY).getRecordDefinition();
this.recordStore.getRecordDefinition(this.recordDefinition);
this.layer = new RecordStoreLayer(this.recordStore, TEST, true);
this.layer.initialize();
this.layer.setEditable(true);
}
use of com.revolsys.record.schema.RecordDefinitionBuilder in project com.revolsys.open by revolsys.
the class GeometryReader method newRecordDefinition.
default RecordDefinition newRecordDefinition(final String name) {
final GeometryFactory geometryFactory = getGeometryFactory();
final RecordDefinition recordDefinition = //
new RecordDefinitionBuilder(name).addField("GEOMETRY", //
DataTypes.GEOMETRY).setGeometryFactory(//
geometryFactory).getRecordDefinition();
return recordDefinition;
}
use of com.revolsys.record.schema.RecordDefinitionBuilder in project com.revolsys.open by revolsys.
the class PointReader method newRecordDefinition.
default RecordDefinition newRecordDefinition(final String name) {
final GeometryFactory geometryFactory = getGeometryFactory();
final RecordDefinition recordDefinition = //
new RecordDefinitionBuilder(name).addField("POINT", //
DataTypes.POINT).setGeometryFactory(//
geometryFactory).getRecordDefinition();
return recordDefinition;
}
use of com.revolsys.record.schema.RecordDefinitionBuilder in project com.revolsys.open by revolsys.
the class LabelCountMap method writeCounts.
public void writeCounts(final Object target, final String labelTitle) {
final RecordDefinitionBuilder recordDefinitionBuilder = new RecordDefinitionBuilder("Counts");
recordDefinitionBuilder.addField(labelTitle, DataTypes.STRING, 50);
recordDefinitionBuilder.addField("Count", DataTypes.LONG, 10);
final RecordDefinition recordDefinition = recordDefinitionBuilder.getRecordDefinition();
try (RecordWriter recordWriter = RecordWriter.newRecordWriter(recordDefinition, target)) {
for (final String label : getLabels()) {
final Long count = getCount(label);
recordWriter.write(label, count);
}
}
}
use of com.revolsys.record.schema.RecordDefinitionBuilder in project com.revolsys.open by revolsys.
the class AbstractScaledIntegerPointCloudGeometryReader method newRecordDefinition.
public RecordDefinition newRecordDefinition(final String name) {
final GeometryFactory geometryFactory = getGeometryFactory();
final RecordDefinition recordDefinition = //
new RecordDefinitionBuilder(name).addField("POINT", //
DataTypes.POINT).setGeometryFactory(//
geometryFactory).getRecordDefinition();
return recordDefinition;
}
Aggregations