Search in sources :

Example 1 with Builder

use of de.topobyte.osm4j.pbf.protobuf.Osmformat.PrimitiveBlock.Builder in project osm4j-pbf by topobyte.

the class EntitySplitBlockwise method copy.

private void copy(BlockWriter blockWriter, List<PrimitiveGroup> gs, Osmformat.PrimitiveBlock primBlock, Compression compression) throws IOException {
    Osmformat.PrimitiveBlock.Builder builder = Osmformat.PrimitiveBlock.newBuilder();
    for (Osmformat.PrimitiveGroup group : gs) {
        builder.addPrimitivegroup(group);
    }
    copyExtraData(builder, primBlock);
    Osmformat.PrimitiveBlock block = builder.build();
    blockWriter.write(Constants.BLOCK_TYPE_DATA, null, compression, block.toByteString());
}
Also used : Builder(de.topobyte.osm4j.pbf.protobuf.Osmformat.PrimitiveBlock.Builder) PrimitiveBlock(de.topobyte.osm4j.pbf.protobuf.Osmformat.PrimitiveBlock) PrimitiveBlock(de.topobyte.osm4j.pbf.protobuf.Osmformat.PrimitiveBlock) Osmformat(de.topobyte.osm4j.pbf.protobuf.Osmformat) PrimitiveGroup(de.topobyte.osm4j.pbf.protobuf.Osmformat.PrimitiveGroup)

Example 2 with Builder

use of de.topobyte.osm4j.pbf.protobuf.Osmformat.PrimitiveBlock.Builder in project osm4j-pbf by topobyte.

the class EntitySplit method copy.

private void copy(BlockWriter blockWriter, List<PrimitiveGroup> gs, Osmformat.PrimitiveBlock primBlock, Compression compression) throws IOException {
    Osmformat.PrimitiveBlock.Builder builder = Osmformat.PrimitiveBlock.newBuilder();
    for (Osmformat.PrimitiveGroup group : gs) {
        builder.addPrimitivegroup(group);
    }
    copyExtraData(builder, primBlock);
    Osmformat.PrimitiveBlock block = builder.build();
    blockWriter.write(Constants.BLOCK_TYPE_DATA, null, compression, block.toByteString());
}
Also used : Builder(de.topobyte.osm4j.pbf.protobuf.Osmformat.PrimitiveBlock.Builder) PrimitiveBlock(de.topobyte.osm4j.pbf.protobuf.Osmformat.PrimitiveBlock) PrimitiveBlock(de.topobyte.osm4j.pbf.protobuf.Osmformat.PrimitiveBlock) Osmformat(de.topobyte.osm4j.pbf.protobuf.Osmformat) PrimitiveGroup(de.topobyte.osm4j.pbf.protobuf.Osmformat.PrimitiveGroup)

Aggregations

Osmformat (de.topobyte.osm4j.pbf.protobuf.Osmformat)2 PrimitiveBlock (de.topobyte.osm4j.pbf.protobuf.Osmformat.PrimitiveBlock)2 Builder (de.topobyte.osm4j.pbf.protobuf.Osmformat.PrimitiveBlock.Builder)2 PrimitiveGroup (de.topobyte.osm4j.pbf.protobuf.Osmformat.PrimitiveGroup)2