/**
* {@inheritDoc}
*/
public void process(WayContainer wayContainer) {
Way way;
int sequenceId;
List<Long> nodeIds;
way = wayContainer.getEntity();
nodeIds = new ArrayList<Long>(way.getWayNodes().size());
for (WayNode wayNode : way.getWayNodes()) {
nodeIds.add(wayNode.getNodeId());
}
// Keep invalid ways out of the database if desired by the user
if (way.getWayNodes().size() > 1 || keepInvalidWays) {
wayWriter.writeField(way.getId());
wayWriter.writeField(way.getVersion());
wayWriter.writeField(way.getUser().getId());
wayWriter.writeField(way.getTimestamp());
wayWriter.writeField(way.getChangesetId());
wayWriter.writeField(buildTags(way));
wayWriter.writeField(nodeIds);
if (enableBboxBuilder) {
wayWriter.writeField(wayGeometryBuilder.createWayBbox(way));
}
if (enableLinestringBuilder) {
wayWriter.writeField(wayGeometryBuilder.createWayLinestring(way));
}
wayWriter.endRecord();
sequenceId = 0;
for (WayNode wayNode : way.getWayNodes()) {
wayNodeWriter.writeField(way.getId());
wayNodeWriter.writeField(wayNode.getNodeId());
wayNodeWriter.writeField(sequenceId++);
wayNodeWriter.endRecord();
}
}