1
Python and Java API / How to export orthomosaic with sqare pixel?
« on: August 21, 2024, 02:56:53 PM »
Hello!
I am trying to create a task to export orthomosaic with specified resolution in meters.
When do it manually (in metashape withot python), i achive it by the next steps:
1. I open "export orthomosaic" menu
2. I set resolusion in meters to 0.1
3. The pixel size (m) correspondingly changes for new resolution. If it isn't sqare, i simply copy res in X into Y. (as i see it changes te res in meterers a littlebit, but it's not a bit deal).
Now i am trying to recreate this behaviour in python code. For now i have this:
As far as i understand, i have to specify resolution_x and resolution_y instead of resolution, but i don't understand how to calculate them.
Note: I work in EPSG::3857
I am trying to create a task to export orthomosaic with specified resolution in meters.
When do it manually (in metashape withot python), i achive it by the next steps:
1. I open "export orthomosaic" menu
2. I set resolusion in meters to 0.1
3. The pixel size (m) correspondingly changes for new resolution. If it isn't sqare, i simply copy res in X into Y. (as i see it changes te res in meterers a littlebit, but it's not a bit deal).
Now i am trying to recreate this behaviour in python code. For now i have this:
Code: [Select]
def export_ortho(self, export_path, resolution):
task = Metashape.Tasks.ExportRaster()
task.source_data = Metashape.OrthomosaicData
task.path = export_path
task.resolution = resolution
return task
As far as i understand, i have to specify resolution_x and resolution_y instead of resolution, but i don't understand how to calculate them.
Note: I work in EPSG::3857