def jsons(_id, x, y, z):
    """
    Returns the tile, look at leaflet for details
    """
    the_data = data.readRegion(_id , (x, y, z))
    content = json.dumps({
                "position": [x, y, z],
                "count": len(the_data),
                "data": the_data,
                "bound" : data.areaboundWithId(_id, (x, y, z))
                });
    return Response(mimetype="application/json", status=200, response=content)
Exemple #2
0
 def get(self, _id, z, x, y):
     x, y, z = int(x), int(y), int(z)
     the_data = data.readRegion(_id , (x, y, z))
     content = json.dumps({
                 "position": [x, y, z],
                 "count": len(the_data),
                 "data": the_data,
                 "bound" : data.areaboundWithId(_id, (x, y, z))
                 });
     self.set_status(200)
     self.set_header('Content-Type', 'application/json')
     self.write(content)