|
|
@ -212,8 +212,7 @@ def query(filter_dummy, query):
|
|
|
|
return json.dumps(l)
|
|
|
|
return json.dumps(l)
|
|
|
|
|
|
|
|
|
|
|
|
@app.route(baseURL+'/map/<containerID>')
|
|
|
|
@app.route(baseURL+'/map/<containerID>')
|
|
|
|
@app.route(baseURL+'/map/<containerID>/<annotate>')
|
|
|
|
def getMap(containerID):
|
|
|
|
def getMap(containerID, annotate=None):
|
|
|
|
|
|
|
|
s = 'select map, overlay from containers where id = :id;'
|
|
|
|
s = 'select map, overlay from containers where id = :id;'
|
|
|
|
r = db_engine.execute(text(s), id=containerID)
|
|
|
|
r = db_engine.execute(text(s), id=containerID)
|
|
|
|
l = []
|
|
|
|
l = []
|
|
|
@ -234,13 +233,6 @@ def getMap(containerID, annotate=None):
|
|
|
|
# width, height = pointer.size
|
|
|
|
# width, height = pointer.size
|
|
|
|
# pointerLayer.paste(pointer, (x - int(width/2), y-int(height/2)))
|
|
|
|
# pointerLayer.paste(pointer, (x - int(width/2), y-int(height/2)))
|
|
|
|
mapimage = Image.alpha_composite(mapImage, overlayImage)
|
|
|
|
mapimage = Image.alpha_composite(mapImage, overlayImage)
|
|
|
|
if annotate=='a':
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
annotationName = mapFile.split('.')[0] + '-annotated.' + mapFile.split('.')[1]
|
|
|
|
|
|
|
|
annotationImage = Image.open('maps/' + annotationName).convert("RGBA")
|
|
|
|
|
|
|
|
mapimage = Image.alpha_composite(mapimage, annotationImage)
|
|
|
|
|
|
|
|
except FileNotFoundError:
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
return serveImage(mapimage)
|
|
|
|
return serveImage(mapimage)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|