1
Python and Java API / Exporting Orthomosaic Tiles with Zoom Levels via Network Processing
« on: February 01, 2023, 11:54:58 AM »
Hello Everyone,
I'm working on a network processing script to create orthomosaic tiles in zip format (RasterFormatXYZ) but for some reason zoom levels are not being applied. When exporting using the code below, the index.html file shows zoom level of 0, with folders from 0 to 6 instead of 12 to 23.
What could be causing this problem? Any assistance would be greatly appreciated!
I'm working on a network processing script to create orthomosaic tiles in zip format (RasterFormatXYZ) but for some reason zoom levels are not being applied. When exporting using the code below, the index.html file shows zoom level of 0, with folders from 0 to 6 instead of 12 to 23.
What could be causing this problem? Any assistance would be greatly appreciated!
Code: [Select]
import Metashape, sys
SERVER_IP = "192.168.0.101"
root = "//192.168.0.137/shared"
Metashape.app.settings.network_path = "//192.168.0.137/shared"
project_path = "/projects/test.psx"
output_folder = root + "/output"
doc = Metashape.Document()
doc.open(root + project_path)
chunk = doc.chunk
tasks = []
task = Metashape.Tasks.ExportRaster()
task.path = output_folder + '/orthomosaic_tile.zip'
task.source_data = Metashape.OrthomosaicData
task.format = Metashape.RasterFormat.RasterFormatXYZ
task.raster_transform = Metashape.RasterTransformType.RasterTransformNone
task.min_zoom_level = 12
task.max_zoom_level = 23
tasks.append(task)
network_tasks = []
for task in tasks:
if task.target == Metashape.Tasks.DocumentTarget:
network_tasks.append(task.toNetworkTask(doc))
else:
network_tasks.append(task.toNetworkTask(chunk))
client = Metashape.NetworkClient()
client.connect(SERVER_IP)
batch_id = client.createBatch(doc.path, network_tasks)
client.setBatchPaused(batch_id, paused=False)