return builder.build();
return builder.build();
public Osmformat.PrimitiveGroup serialize() { if (contents.size() == 0) { return null; } // System.out.format("%d Ways ",contents.size()); StringTable stable = getStringTable(); Osmformat.PrimitiveGroup.Builder builder = Osmformat.PrimitiveGroup .newBuilder(); for (Way i : contents) { Osmformat.Way.Builder bi = Osmformat.Way.newBuilder(); bi.setId(i.getId()); long lastid = 0; for (WayNode j : i.getWayNodes()) { long id = j.getNodeId(); bi.addRefs(id - lastid); lastid = id; } for (Tag t : i.getTags()) { bi.addKeys(stable.getIndex(t.getKey())); bi.addVals(stable.getIndex(t.getValue())); } if (!omit_metadata) { bi.setInfo(serializeMetadata(i)); } builder.addWays(bi); } return builder.build(); } }
return builder.build();
/** * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code> */ private void addPrimitivegroup( int index, org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup.Builder builderForValue) { ensurePrimitivegroupIsMutable(); primitivegroup_.add(index, builderForValue.build()); } /**
/** * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code> */ private void setPrimitivegroup( int index, org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup.Builder builderForValue) { ensurePrimitivegroupIsMutable(); primitivegroup_.set(index, builderForValue.build()); } /**
/** * <code>repeated .OSMPBF.PrimitiveGroup primitivegroup = 2;</code> */ private void addPrimitivegroup( org.openstreetmap.osmosis.osmbinary.Osmformat.PrimitiveGroup.Builder builderForValue) { ensurePrimitivegroupIsMutable(); primitivegroup_.add(builderForValue.build()); } /**