|
@@ -6,6 +6,7 @@ import rq
|
|
|
from osgeo import ogr
|
|
|
|
|
|
from app.mission_jobs.image_slice import slice_zxy
|
|
|
+from app.utils.create_geojsonl import calc_minmax_zoom
|
|
|
from config import Config
|
|
|
from connection import Connection
|
|
|
from starearth.utils.general_utils import print_log
|
|
@@ -35,6 +36,11 @@ def image_slice_job(data_path, output_path, tile_size, tile_grid, tile_format, e
|
|
|
for file_name in os.listdir(data_path):
|
|
|
if os.path.splitext(file_name)[-1] == ".tif":
|
|
|
input_file = os.path.join(data_path, file_name)
|
|
|
+
|
|
|
+ if auto_zoom:
|
|
|
+ # min_zoom, max_zoom = calc_minmax_zoom2(input_file, epsg, tile_size)
|
|
|
+ min_zoom, max_zoom = calc_minmax_zoom(input_file, epsg, tile_size)
|
|
|
+
|
|
|
slice_zxy(
|
|
|
input_file=input_file,
|
|
|
output_path=output_path,
|
|
@@ -42,7 +48,6 @@ def image_slice_job(data_path, output_path, tile_size, tile_grid, tile_format, e
|
|
|
tile_grid=tile_grid,
|
|
|
tile_format=tile_format,
|
|
|
epsg=epsg,
|
|
|
- auto_zoom=auto_zoom,
|
|
|
min_zoom=min_zoom,
|
|
|
max_zoom=max_zoom,
|
|
|
)
|
|
@@ -79,13 +84,14 @@ def image_slice_job(data_path, output_path, tile_size, tile_grid, tile_format, e
|
|
|
|
|
|
dms_data['content'] = json.loads(dms_data['content'])
|
|
|
dms_data['content']['bbox'] = new_geometry.ExportToJson()
|
|
|
+ dms_data['content']['c_zoom_min'] = min_zoom
|
|
|
+ dms_data['content']['c_zoom_max'] = max_zoom
|
|
|
dms_data['content']['id'] = dms_id
|
|
|
dms_data['content'] = json.dumps(dms_data['content'], ensure_ascii=False)
|
|
|
|
|
|
# 修改dms
|
|
|
updateContent = requests.post(config.dms.URL + '/content/updateContent', headers=headers, data=dms_data)
|
|
|
- print_log(updateContent)
|
|
|
- print_log(updateContent.json())
|
|
|
+ print_log(str(updateContent.json()))
|
|
|
# 提交dms
|
|
|
data = {
|
|
|
'id': dms_id,
|
|
@@ -94,5 +100,4 @@ def image_slice_job(data_path, output_path, tile_size, tile_grid, tile_format, e
|
|
|
}
|
|
|
|
|
|
updateAudit = requests.post(config.dms.URL + '/content/updateAudit', headers=headers, data=data)
|
|
|
- print_log(updateAudit)
|
|
|
- print_log(updateAudit.json())
|
|
|
+ print_log(str(updateAudit.json()))
|