private ListMultimap<String, Feature> decode(RawMap map) throws IOException { ArrayListMultimap<String, VectorTileDecoder.Feature> byLayer = ArrayListMultimap.create(); ByteArrayOutputStream bos = new ByteArrayOutputStream(); map.writeTo(bos); bos.close(); VectorTileDecoder decoder = new VectorTileDecoder(); decoder.setAutoScale(false); for (Feature feat : decoder.decode(bos.toByteArray())) { // System.out.println(feat.getLayerName() + ": "); // System.out.print(feat.getAttributes()); // System.out.println(feat.getGeometry()); byLayer.put(feat.getLayerName(), feat); } return byLayer; }
private ListMultimap<String, Feature> decode(RawMap map) throws IOException { ArrayListMultimap<String, VectorTileDecoder.Feature> byLayer = ArrayListMultimap.create(); ByteArrayOutputStream bos = new ByteArrayOutputStream(); map.writeTo(bos); bos.close(); VectorTileDecoder decoder = new VectorTileDecoder(); decoder.setAutoScale(false); for (Feature feat : decoder.decode(bos.toByteArray())) { // System.out.println(feat.getLayerName() + ": "); // System.out.print(feat.getAttributes()); // System.out.println(feat.getGeometry()); byLayer.put(feat.getLayerName(), feat); } return byLayer; }