OsmAnd/OsmAnd-java/src/main/java/net/osmand/binary/BinaryVectorTileReader.java
2018-06-15 15:24:05 +02:00

22 lines
689 B
Java

package net.osmand.binary;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.geom.GeometryFactory;
import com.wdtinc.mapbox_vector_tile.adapt.jts.MvtReader;
import com.wdtinc.mapbox_vector_tile.adapt.jts.TagKeyValueMapConverter;
import net.osmand.data.GeometryTile;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.List;
public class BinaryVectorTileReader {
public static GeometryTile readTile(File file) throws IOException {
GeometryFactory geomFactory = new GeometryFactory();
return new GeometryTile(
MvtReader.loadMvt(new FileInputStream(file), geomFactory, new TagKeyValueMapConverter()));
}
}