@Override protected void parseWays(List<Osmformat.Way> ways) { try { for (Osmformat.Way w : ways) { if (wayCount++ % 1000000 == 0) { LOG.info("way {}", human(wayCount)); } Way way = new Way(); /* Handle tags */ for (int k = 0; k < w.getKeysCount(); k++) { String key = getStringById(w.getKeys(k)); String val = getStringById(w.getVals(k)); if (retainTag(key)) way.addTag(key, val); } /* Handle nodes */ List<Long> rl = w.getRefsList(); long[] nodes = new long[rl.size()]; long ref = 0; for (int n = 0; n < nodes.length; n++) { ref += rl.get(n); nodes[n] = ref; } way.nodes = nodes; entitySink.writeWay(w.getId(), way); } } catch (IOException ex) { LOG.error("An I/O exception occurred in the OSM entity sink."); ex.printStackTrace(); } }
for (Osmformat.Way i : ways) { List<Tag> tags = new ArrayList<Tag>(); for (int j = 0; j < i.getKeysCount(); j++) { tags.add(new Tag(getStringById(i.getKeys(j)), getStringById(i.getVals(j))));
/** * <pre> * Parallel arrays. * </pre> * * <code>repeated uint32 keys = 2 [packed = true];</code> */ @java.lang.Override public int getKeysCount() { return instance.getKeysCount(); } /**