Forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Ilya_1

Pages: [1]
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:
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

2
I need to delete points, orthophotomosaic and dem from project files.
I've tried to do it with several methods, including
```python
    def remove(self):
            self.doc.chunk.tie_points = None
            self.doc.chunk.remove((self.doc.chunk.elevation,))
            self.doc.chunk.remove((self.doc.chunk.orthomosaic,))
        self.doc.save()
```
This does delete poiters to the data, but the data itself still using disk space.

Pages: [1]