/usr/lib/python3/dist-packages/mapbox_vector_tile/__init__.py is in python3-mapbox-vector-tile 0.5.0+ds-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | from . import encoder
from . import decoder
def decode(tile, y_coord_down=False):
vector_tile = decoder.TileData()
message = vector_tile.getMessage(tile, y_coord_down)
return message
def encode(layers, quantize_bounds=None, y_coord_down=False, extents=4096,
on_invalid_geometry=None, round_fn=None):
vector_tile = encoder.VectorTile(extents, on_invalid_geometry,
round_fn=round_fn)
if (isinstance(layers, list)):
for layer in layers:
vector_tile.addFeatures(layer['features'], layer['name'],
quantize_bounds, y_coord_down)
else:
vector_tile.addFeatures(layers['features'], layers['name'],
quantize_bounds, y_coord_down)
return vector_tile.tile.SerializeToString()
|