tile info - raise error

parent 25608314
......@@ -294,6 +294,7 @@ def tiles(request, purchase_id, report, date, z, x, y):
if not os.path.exists(image_path):
# raise Http404
return HttpResponse(None, content_type="image/png")
# image_path = USERS_PATH + 'none.png'
image = open(image_path, "rb").read()
return HttpResponse(image, content_type="image/png")
......@@ -306,6 +307,9 @@ def tileinfo(request):
absolute_path = USERS_PATH + request.user.email + '/' + req['purchase_id'][0] + '/out'
resource_path = '/' + req['report'][0] + '/tiles' + '/' + req['date'][0] + '_TCI_60m/tilemapresource.xml'
if not os.path.exists(absolute_path + resource_path):
raise Http404
tree = ET.parse(absolute_path + resource_path)
bounding_box = tree.find('BoundingBox')
sets = [set.get('order') for set in tree.findall('TileSets/TileSet')]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment