Forum

Author Topic: Measurment Unit Choice  (Read 3037 times)

dpitman

  • Full Member
  • ***
  • Posts: 246
    • View Profile
Measurment Unit Choice
« on: July 17, 2020, 05:17:05 PM »
Need the ability to specify UNITS for measurements.  For example, volume measurements are typically reported in cubic yards or cubic meters.  There should be a preference for this exclusive of which CRS unit is specified.

This is really very basic stuff.

Thanks

dpitman

  • Full Member
  • ***
  • Posts: 246
    • View Profile
Re: Measurment Unit Choice
« Reply #1 on: January 09, 2021, 11:29:43 PM »
Bump

In addition to a choice of preferred unit for measurements, how about being able to export a .csv file with all of the shapes and their respective values.   Perhaps this can be accomplished with Python?

Thank you!


« Last Edit: January 09, 2021, 11:36:28 PM by dpitman »

Paulo

  • Hero Member
  • *****
  • Posts: 1320
    • View Profile
Re: Measurment Unit Choice
« Reply #2 on: January 10, 2021, 02:07:27 AM »
Hey dpitman,

there is already a script for reporting all polygon area and volume measurements to a txt or CSV file See attachment.  This script supposes that units are meter. For different unit (ft), we would need to know the Metashape.app.settings.value key for units. I dont know what it is, maybe Agisoft can inform on this issue?

The following info would be exported to a txt file in case of 2 polygons....
Code: [Select]
Shape_ID Shape_Label Layer_Label      Area_m2 Method     Volumen_m3(below) Volumen_m3(above) Volumen_m3(total)
0 Predio      Limite      223268.63837 bestfit 41813.84809 106715.69601 64901.84792
4 Pile        Pilas      822.75264 bestfit 4.30027         1604.94371 1600.64345

The script can be modified to include other measurements (perimeter_2D, perimeter_3D) and could also include polylines...
« Last Edit: January 10, 2021, 02:13:16 AM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

dpitman

  • Full Member
  • ***
  • Posts: 246
    • View Profile
Re: Measurment Unit Choice
« Reply #3 on: January 10, 2021, 04:46:51 AM »
I was hoping that was the case, thank you Paul.
 
It would be nice to adjust the script to output volume in cubic yards if someone better at python wants to help out.  Otherwise, I could convert in a spreadsheet.

Is there a repository somewhere with publicly available scripts?

Dave

dpitman

  • Full Member
  • ***
  • Posts: 246
    • View Profile
Re: Measurment Unit Choice
« Reply #4 on: January 10, 2021, 06:53:41 AM »
Paul, I have little experience with Python.  I read in the manual 3 ways to run a script in MS.

1. Use the MS console as a python console.

I copied the contents of the file you provided into the console and tap enter. 
It returns this:
"SyntaxError: invalid character in identifier"

2. From the tools menu, select run script.

I do that and browse to the file location and tap enter.
It returns:
" Invalid character identifier ( line 1)"

Can you shed some light on how to acutally run this script one way or another?

Thank you,
Dave




Paulo

  • Hero Member
  • *****
  • Posts: 1320
    • View Profile
Re: Measurment Unit Choice
« Reply #5 on: January 10, 2021, 07:08:09 AM »
Dave,

I think I found this script somewhere in this forum, I do not really remember. You can also check https://github.com/agisoft-llc/metashape-scripts  for Metashape script repository.

If you want to convert to  US survey foot then ,  I have adapted the script so as to output in ft2 and yd3 and change file header...

In attached example, I have same previous pile now referenced in NAD83 / Texas South (ftUS) and result would be following file:

Code: [Select]
Shape_ID Shape_Label Layer_Label     Area_ft2 Method    Volumen_yd3(below) Volumen_yd3(above) Volumen_yd3(total)
       0 Pile        Pilas        8856.04617 bestfit      5.76479       2050.60541       2044.84062


Best Regards,
Paul Pelletier,
Surveyor

Paulo

  • Hero Member
  • *****
  • Posts: 1320
    • View Profile
Re: Measurment Unit Choice
« Reply #6 on: January 10, 2021, 07:24:31 AM »
just use run script, browse to file I sent you, and click OK

A custom menu will appear on menu bar and just click  on it to access script....
Best Regards,
Paul Pelletier,
Surveyor

dpitman

  • Full Member
  • ***
  • Posts: 246
    • View Profile
Re: Measurment Unit Choice
« Reply #7 on: January 10, 2021, 07:36:16 AM »
Wow, thank you Paul !

The manual didn't say anything about the "custom menu" appearing in the menu bar.  I was clicking "ok" and I wouldn't see anything happen.  With your help, I see it now.   :D

Paulo

  • Hero Member
  • *****
  • Posts: 1320
    • View Profile
Re: Measurment Unit Choice
« Reply #8 on: January 10, 2021, 12:06:05 PM »
Another example with 3 pile measurements exported to 2 files, one with metric units and  another with US survey foot.
Comparison with Measure tool in Metashape ....
« Last Edit: January 10, 2021, 01:33:28 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

dpitman

  • Full Member
  • ***
  • Posts: 246
    • View Profile
Re: Measurment Unit Choice
« Reply #9 on: January 10, 2021, 05:55:56 PM »
I played with the script a little and broke it a few times.   It is very good.
It's going to save me some time and possible errors in compiling reports.

Thanks again ! 

Dave

 
« Last Edit: January 10, 2021, 09:09:29 PM by dpitman »