Forum

Author Topic: Export multiple Ortho/DEM sections  (Read 20704 times)

Damian

  • Newbie
  • *
  • Posts: 42
    • View Profile
Export multiple Ortho/DEM sections
« on: January 21, 2019, 07:10:37 PM »
Hello!

My company works very often with huge projects (both private and public sector) where I prepare DEM and Ortho for big investments like highways, quarries etc. As I result I am expected to provide a lot of maps' sections which are usually used for projecting process. Currenty I am working on 100km of highway where as a result I will prepare around 400 sections of maps 1:2000 - ortho and DEM just for investment preparation. To do it I need to set a outer boundary separately for every section, check the export options, name it properly (ortho_6_142_25_03, dem..., etc.) and eventually save. It can take up to 2 days of work.

It is not a problem to prepare a shape with name as an attribute. It would be perfect if I just selected multiple boundaries, then used option like: "export multiple", "name after attribute..." and after few minutes/hours I would have all sections automaticly exported. Have you already taken into consideration such feature?

In attachement you can find the example of investment, where I need to export every section separately.

Thank you in advance for reply!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15074
    • View Profile
Re: Export multiple Ortho/DEM sections
« Reply #1 on: January 21, 2019, 08:13:34 PM »
Hello Damian,

I think that this workflow can be automated with the custom Python script.

Can you please confirm that the following functionality of the script will fit your needs:
- script asks if you wish to export orthomosaics, DEM or both,
- script asks for the output folder (or folders?) locations,
- script asks if you wish to export the orthomosaics/DEMs for the selected polygonal shapes or for all the polygonal shapes.
The naming will be applied as following:
ortho_{shape_NAME_attribute}.tif
and
dem_{shape_NAME_attribute}.tif
Best regards,
Alexey Pasumansky,
Agisoft LLC

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15074
    • View Profile
Re: Export multiple Ortho/DEM sections
« Reply #2 on: January 21, 2019, 09:50:18 PM »
Please check if the attached script fits your needs (the name of the attribute should be specified in the script body before starting the script, see line #4).
Best regards,
Alexey Pasumansky,
Agisoft LLC

Damian

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Export multiple Ortho/DEM sections
« Reply #3 on: February 04, 2019, 12:06:26 PM »
Hello Alexey

I am very sorry for a delay in replying. I found free time to check the script. It works fine, although  one improvement would be also good - script asks for resolution of ortho and dem, script exports dem as xyz or colour pallete.
In case of ortho I also wonder if there is a way to resign from alpha channel.

I am new in python scripting, so some of my questions might have an obvious answer. Looking forward to hearing it from you!
Best regards

« Last Edit: February 04, 2019, 12:21:17 PM by Damian »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15074
    • View Profile
Re: Export multiple Ortho/DEM sections
« Reply #4 on: February 04, 2019, 12:42:58 PM »
Hello Damian,

For the DEM export do you mean two options: False colors (Palette) and GeoTIFF with the elevation values? Or the elevation should be saved in XYZ format?

Also whether there should be common resolution values both for ortho and DEM export?
Best regards,
Alexey Pasumansky,
Agisoft LLC

Damian

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Export multiple Ortho/DEM sections
« Reply #5 on: February 04, 2019, 01:20:37 PM »
Hello

Some clients require DEM as .xyz pointcloud file, some GeoTIFF with false colours. Resolution of DEM and ORTHO mostly differs from each other, so I would be pleased to have a choice (it is usually 5cm for ortho, JPEG 85 compression, no alpha channel; and 25 cm for DEM)

I also have problem with proper file naming. I changed the attribute name in script, however it still names files as unknown. In attachement you can find an example of shapefile.

Thank you for your help!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15074
    • View Profile
Re: Export multiple Ortho/DEM sections
« Reply #6 on: February 04, 2019, 02:28:38 PM »
Hello Damian,

An intermediate updated version of the script that allows to save DEM in RGB format, input export resolution (will be currently applied to both exports) and disable Alpha for the orthomosaic export.

As for the KML shapes, I do not see any attributes there. Do you wish just to use shape labels for the export?
Best regards,
Alexey Pasumansky,
Agisoft LLC

Damian

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Export multiple Ortho/DEM sections
« Reply #7 on: February 04, 2019, 04:19:12 PM »
Yes, labels would be also good.

One more thing - when I simply export DEM i get it as .tif, not .xyz. Could you change it?

Thank you again for support!

Damian

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Export multiple Ortho/DEM sections
« Reply #8 on: February 07, 2019, 11:29:44 AM »
Hello

I checked the script and I have some requests for update:

1. Ortho export should create also a .tfw file (so far it's just a geotiff)
2. DEM should be exported as either Geotiff RGB or XYZ file (so far its just a rgb geotiff and black and white geotiff)
3. The name of every file should be ortho_label and dem_label (so far I have problems to upload an attribute to kml and read a value from it)

Thank you for help, looking forward to getting the script.

Best regards!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15074
    • View Profile
Re: Export multiple Ortho/DEM sections
« Reply #9 on: February 07, 2019, 03:09:42 PM »
Hello Damian,

I'll try to update the script in the next iteration according to your comments.

For the export filename, the script can use shape labels, if there are no attributes with the required attribute name for the shape.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Damian

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Export multiple Ortho/DEM sections
« Reply #10 on: February 19, 2019, 10:19:48 AM »
Alexey
Have you already worked with the script? I am really looking forward to trying it.
In addition, would it be possible to add a compression choice? If not - please set the default for JPEG 85.
Thnak you!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15074
    • View Profile
Re: Export multiple Ortho/DEM sections
« Reply #11 on: February 19, 2019, 03:31:14 PM »
Hello Damian,

Please check the attached script.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Damian

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Export multiple Ortho/DEM sections
« Reply #12 on: February 25, 2019, 03:17:52 PM »
I have just cheked the script. Here what I noticed:
1. Despite the label marked as "Name" attribute, the name of the created file is still "unknown".
2. When choosing DEM as RGB export the script does not work.
3. Could you add a .tfw file creation when orthophoto export?
In the link I am to send you in a private message You can find the project I test the script on.

Looking forward to getting an answer ;)

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15074
    • View Profile
Re: Export multiple Ortho/DEM sections
« Reply #13 on: February 25, 2019, 08:39:31 PM »
Hello Damian,

Attributes are case sensitive, so can you please confirm that the shape have attribute label "NAME"? In the provided project there are no attributes.

I'm attaching the new script version:
- RBG export should work,
- World file should be written.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Damian

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Export multiple Ortho/DEM sections
« Reply #14 on: March 14, 2019, 12:14:20 PM »
Hello Alexey

Maybe I misunderstand what an attribute is. I checked in QGIS - the attribute is called "Name". There is also a label visible in Agisoft. I attach three pics.
No matter if I change in script "NAME" to "Name", it still exports ortho and dem as "Unknown". Does it work on your PC with provided data?

DEM is exported as RGB and tfw file appeard - thanks!