def main(project, task, date_time): TM, TM_ = unit.int_('get_bbox2db') logging.info('time is {}'.format(TM)) bounds_, coordinate = unit.get_bounds(project, task) #coordinate is a dict, and bounds is a list respectivelly. google_xyz = unit.cvtLatlon2xyz(18, *bounds_) bbox_list, box_numbers = unit.get_Locus_bboxs(project, **coordinate) unit.to_table_BBOXS(project, task, box_numbers, date_time, *bbox_list)
def main(project, task, date_time): # after task processed in locus, obtain tile's lat&lon and transfer to google xy, # and save google_xy and project task id to database table GOOGLEXY2ID TM, TM_ = unit.int_('get_xy2db') bounds_, coordinate = unit.get_bounds(project, task) #coordinate is a dict, and bounds is a list respectivelly. google_xyz = unit.cvtLatlon2xyz(18, *bounds_) image_count = image_(project, task) #########to talbe GOOGLEXY2ID unit.to_table_GOOGLEXY2ID(project, task, date_time, image_count, bounds_, google_xyz)
try: list_bbox = time2bbox.main(label, from_time, to_time, *viewport) # model of search bbox in time except: logging.error('model calling failed!') raise logging.info('convert done, back to flask.') js = json.dumps(list_bbox) return js if __name__ == "__main__": TM, TM_ = unit.int_('flaskapp_front2back') print TM app.run() ''' #coding:utf-8 import requests import json import pymysql import logging import time import sys import cv2 #sys.path.append('../../yuuav_background_mason') import unit from flask import Flask,request
try: cursor.execute(sql_read) except: logging.error('cursor execute error!') raise result=cursor.fetchall() logging.error('fetchall of sql') db.close() return result ####################################### if __name__ == '__main__': TM,TM_=unit.int_('bbox2mysql') coordinate = {} table=read_index_table() count=1 for row in table: id_project=row[0] id_task=row[1] coordinate['sW_lat']=row[2] coordinate['sW_lon']=row[3] coordinate['nE_lat']=row[4] coordinate['nE_lon']=row[5] bbox_list, box_numbers=unit.get_Locus_bboxs(id_project,**coordinate) unit.to_table_BBOXS(id_project, id_task, box_numbers, TM_, *bbox_list)
def main(label,from_time,to_time,*big_bounds): TM,TM_=unit.int_('time2bbox') bbox_list=select_bbox(label,from_time,to_time,*big_bounds) #bbox_list=list(bbox_tuple) return bbox_list
except: logging.info('model calling failed!', exec_info=True) return 'model calling failed!' raise msg = 'model get_bbox2db and get_xy2db calling done, and data have been stored into YUUAV database, now back to flask.' logging.info('{}'.format(msg)) return msg ##### else: logging.error('processing image....please waite!') #after the upload images are processed by locus, then save the info to mysql if __name__ == '__main__': TM, TM_ = unit.int_('flaskapp_back2locus') logging.info('Hello, this is YUUAV flask app, waiting for request ....') app.run() ''' #test ############################ import requests # text front2back app time2map url_haha= 'http://localhost:5000/back2locus/' querystring_haha= {"project_id": "193", "task_id": "2534", "date_time": "20180714"} response = requests.request('GET', url_haha, params=querystring_haha) image_src = response.text
def main(from_time, to_time, *google_xyz): TM, TM_ = unit.int_('time2image') results_list = select_project_task(from_time, to_time, *google_xyz) return results_list
sys.path.append('../../yuuav_background_mason') import unit def getUid(uuid_): code = uuid_ abc = code.split('-') delimiter = '' # uid_code = delimiter.join(abc) return uid_code TM,TM_=unit.int_('xy2mysql') headers = unit.get_headers() # search to get old locus data # get project id list row = 1 # count for task or mysql row index = 0 # count for error numbers for page in range(1, 7): logging.info('project page {}'.format(page)) url_project = "http://atilas.locussocial.com:9876/api/projects/?ordering=-id&page={}".format(page) logging.info('requests project ...') response_project = requests.request("GET", url_project, headers=headers)