private void processNodes(Osmformat.DenseNodes nodes, PbfFieldDecoder fieldDecoder) { List<Long> idList = nodes.getIdList(); List<Long> latList = nodes.getLatList(); List<Long> lonList = nodes.getLonList(); Iterator<Integer> keysValuesIterator = nodes.getKeysValsList().iterator(); tags = new HashMap<>(Math.max(3, 2 * (nodes.getKeysValsList().size() / 2) / idList.size()));
private void processNodes( Osmformat.DenseNodes nodes, PbfFieldDecoder fieldDecoder ) List<Long> idList = nodes.getIdList(); List<Long> latList = nodes.getLatList(); List<Long> lonList = nodes.getLonList(); Iterator<Integer> keysValuesIterator = nodes.getKeysValsList().iterator();
private void processNodes(Osmformat.DenseNodes nodes, PbfFieldDecoder fieldDecoder) { List<Long> idList = nodes.getIdList(); List<Long> latList = nodes.getLatList(); List<Long> lonList = nodes.getLonList(); Iterator<Integer> keysValuesIterator = nodes.getKeysValsList().iterator(); tags = new HashMap<String, String>(Math.max(3, 2 * (nodes.getKeysValsList().size() / 2) / idList.size()));
private void processNodes(Osmformat.DenseNodes nodes, PbfFieldDecoder fieldDecoder) { List<Long> idList = nodes.getIdList(); List<Long> latList = nodes.getLatList(); List<Long> lonList = nodes.getLonList(); Iterator<Integer> keysValuesIterator = nodes.getKeysValsList().iterator(); tags = new HashMap<String, String>(Math.max(3, 2 * (nodes.getKeysValsList().size() / 2) / idList.size()));
private void processNodes(DenseNodes nodes, PbfFieldDecoder fieldDecoder) { List<Long> idList = nodes.getIdList(); List<Long> latList = nodes.getLatList(); List<Long> lonList = nodes.getLonList(); Iterator<Integer> keysValuesIterator = nodes.getKeysValsList().iterator(); if (nodes.hasDenseinfo()) { denseInfo = nodes.getDenseinfo(); } else { denseInfo = null;
if (!getIdList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, getDenseinfo()); if (!getLatList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream if (!getLonList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream if (!getKeysValsList().isEmpty()) { size += 1; size += com.google.protobuf.CodedOutputStream
for (int i = 0; i < nodes.getIdCount(); i++) { lastId += nodes.getId(i); lastLat += nodes.getLat(i); lastLon += nodes.getLon(i); if (nodes.getKeysValsCount() > 0) { Map<String, String> tags = new HashMap<>(nodes.getKeysValsCount()); while (nodes.getKeysVals(tagLocation) > 0) { String k = getStringById(nodes.getKeysVals(tagLocation)); tagLocation++; String v = getStringById(nodes.getKeysVals(tagLocation)); tagLocation++; tags.put(k, v); if (nodes.hasDenseinfo()) { Osmformat.DenseInfo di = nodes.getDenseinfo(); lastTimestamp += di.getTimestamp(i); lastChangeset += di.getChangeset(i);
int lastuserSid = 0, lastuid = 0; DenseInfo di = null; if (nodes.hasDenseinfo()) { di = nodes.getDenseinfo(); for (int i = 0; i < nodes.getIdCount(); i++) { Node tmp; List<Tag> tags = new ArrayList<Tag>(0); long lat = nodes.getLat(i) + lastLat; lastLat = lat; long lon = nodes.getLon(i) + lastLon; lastLon = lon; long id = nodes.getId(i) + lastId; lastId = id; double latf = parseLat(lat), lonf = parseLon(lon); if (nodes.getKeysValsCount() > 0) { while (nodes.getKeysVals(j) != 0) { int keyid = nodes.getKeysVals(j++); int valid = nodes.getKeysVals(j++); tags.add(new Tag(getStringById(keyid), getStringById(valid)));
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (getIdList().size() > 0) { output.writeUInt32NoTag(10); output.writeUInt32NoTag(idMemoizedSerializedSize); output.writeMessage(5, getDenseinfo()); if (getLatList().size() > 0) { output.writeUInt32NoTag(66); output.writeUInt32NoTag(latMemoizedSerializedSize); output.writeSInt64NoTag(lat_.getLong(i)); if (getLonList().size() > 0) { output.writeUInt32NoTag(74); output.writeUInt32NoTag(lonMemoizedSerializedSize); output.writeSInt64NoTag(lon_.getLong(i)); if (getKeysValsList().size() > 0) { output.writeUInt32NoTag(82); output.writeUInt32NoTag(keysValsMemoizedSerializedSize);
int kv = 0; // index into the keysvals array try { for (int n = 0; n < nodes.getIdCount(); n++) { if (nodeCount++ % 5000000 == 0) { LOG.info("node {}", human(nodeCount)); long id = nodes.getId(n) + lastId; long lat = nodes.getLat(n) + lastLat; long lon = nodes.getLon(n) + lastLon; lastId = id; lastLat = lat; node.setLatLon(parseLat(lat), parseLon(lon)); if (nodes.getKeysValsCount() > 0) { while (nodes.getKeysVals(kv) != 0) { int kid = nodes.getKeysVals(kv++); int vid = nodes.getKeysVals(kv++); String key = getStringById(kid); String val = getStringById(vid);
/** * <pre> * DELTA coded * </pre> * * <code>repeated sint64 lon = 9 [packed = true];</code> */ @java.lang.Override public java.util.List<java.lang.Long> getLonList() { return java.util.Collections.unmodifiableList( instance.getLonList()); } /**
/** * <pre> * DELTA coded * </pre> * * <code>repeated sint64 id = 1 [packed = true];</code> */ @java.lang.Override public java.util.List<java.lang.Long> getIdList() { return java.util.Collections.unmodifiableList( instance.getIdList()); } /**
/** * <pre> * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless. * </pre> * * <code>repeated int32 keys_vals = 10 [packed = true];</code> */ @java.lang.Override public java.util.List<java.lang.Integer> getKeysValsList() { return java.util.Collections.unmodifiableList( instance.getKeysValsList()); } /**
/** * <pre> * DELTA coded * </pre> * * <code>repeated sint64 lat = 8 [packed = true];</code> */ @java.lang.Override public java.util.List<java.lang.Long> getLatList() { return java.util.Collections.unmodifiableList( instance.getLatList()); } /**
/** * <pre> * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless. * </pre> * * <code>repeated int32 keys_vals = 10 [packed = true];</code> */ @java.lang.Override public int getKeysVals(int index) { return instance.getKeysVals(index); } /**
/** * <pre> * DELTA coded * </pre> * * <code>repeated sint64 id = 1 [packed = true];</code> */ @java.lang.Override public int getIdCount() { return instance.getIdCount(); } /**
/** * <pre> *repeated Info info = 4; * </pre> * * <code>optional .OSMPBF.DenseInfo denseinfo = 5;</code> */ @java.lang.Override public org.openstreetmap.osmosis.osmbinary.Osmformat.DenseInfo getDenseinfo() { return instance.getDenseinfo(); } /**
/** * <pre> * DELTA coded * </pre> * * <code>repeated sint64 id = 1 [packed = true];</code> */ @java.lang.Override public long getId(int index) { return instance.getId(index); } /**
/** * <pre> * Special packing of keys and vals into one array. May be empty if all nodes in this block are tagless. * </pre> * * <code>repeated int32 keys_vals = 10 [packed = true];</code> */ @java.lang.Override public int getKeysValsCount() { return instance.getKeysValsCount(); } /**
/** * <pre> * DELTA coded * </pre> * * <code>repeated sint64 lat = 8 [packed = true];</code> */ @java.lang.Override public long getLat(int index) { return instance.getLat(index); } /**