def __init__(self, req, path_multiplier=16): assert isinstance(req, Request) self.request = req self.extent = self.request.extent self.ctrans = CoordTransform(req) self.path_multiplier = path_multiplier self.tile = vector_tile_pb2.tile() self.layer = self.tile.layers.add() self.layer.name = "points" self.layer.version = 2 self.layer.extent = req.size * self.path_multiplier # == 4096 self.feature_count = 0 self.keys = [] self.values = [] self.pixels = []
def __init__(self, req, path_multiplier=16): assert isinstance(req,Request) self.request = req self.extent = self.request.extent self.ctrans = CoordTransform(req) self.path_multiplier = path_multiplier self.tile = vector_tile_pb2.tile() self.layer = self.tile.layers.add() self.layer.name = "points" self.layer.version = 2 self.layer.extent = req.size * self.path_multiplier # == 4096 self.feature_count = 0 self.keys = [] self.values = [] self.pixels = []
def __init__(self, req, tile=None, path_multiplier=16): assert isinstance(req, Request) self.request = req self.extent = self.request.extent self.ctrans = CoordTransform(req) self.path_multiplier = path_multiplier self.pixels = {} self.keys = {} self.values = {} self.feature_count = 0 if tile: self.tile = tile for layer in self.tile.layers: self.pixels[layer.name] = [] self.feature_count += len(layer.features) self.keys[layer.name] = layer.keys self.values[layer.name] = layer.values else: self.tile = vector_tile_pb2.tile()
def __init__(self, req, tile=None, path_multiplier=16): assert isinstance(req,Request) self.request = req self.extent = self.request.extent self.ctrans = CoordTransform(req) self.path_multiplier = path_multiplier self.pixels = {} self.keys = {} self.values = {} self.feature_count = 0 if tile: self.tile = tile for layer in self.tile.layers: self.pixels[layer.name] = [] self.feature_count += len(layer.features) self.keys[layer.name] = layer.keys self.values[layer.name] = layer.values else: self.tile = vector_tile_pb2.tile()