Forum

Author Topic: reset region using shapefile  (Read 2533 times)

xabierr

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
reset region using shapefile
« on: April 28, 2021, 05:22:35 AM »
As far as I understand, the Reset Region option is currently based on the sparse cloud only. I am trying to align multiple surveys (different times) to the same region extent.

Is there away to select/crop points in the sparse point cloud OR reset the region using a shapefile? If not, is there any workaround?

cheers,

Javier   

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: reset region using shapefile
« Reply #1 on: April 28, 2021, 04:05:20 PM »
Hello Javier,

Can you please elaborate, what do you mean by resetting region by a shape file? Which information is available in the shape file?

Would it be sufficient to "copy" the bounding box from the active chunk in the project all the other chunks in the same project?
Best regards,
Alexey Pasumansky,
Agisoft LLC

xabierr

  • Jr. Member
  • **
  • Posts: 84
    • View Profile
Re: reset region using shapefile
« Reply #2 on: April 29, 2021, 01:01:08 AM »
Thanks Alexey.

I mean cropping the bounding box extent to a polygon shapefile extent OR cropping the sparse point cloud to the extent of the polygon shapefile.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: reset region using shapefile
« Reply #3 on: May 04, 2021, 04:43:48 PM »
Hello Javier,

The attached script example should crop the tie point cloud based on the single selected polygonal shape.
Best regards,
Alexey Pasumansky,
Agisoft LLC

bisenberger

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Digital Mapping & Graphics
Re: reset region using shapefile
« Reply #4 on: March 08, 2023, 06:36:43 AM »
Hi Alexey,
I couldn't get the script to work. I'm running Metashape Pro version 2.0.1.
Digital Mapping & Graphics LLC
https://digital-mapping.net/

Corensia

  • Jr. Member
  • **
  • Posts: 52
    • View Profile
Re: reset region using shapefile
« Reply #5 on: March 09, 2023, 07:52:23 AM »
Hi bisenberger,
The script I modified below should work in Metashape 2.0.

Hope it helps!

bisenberger

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Digital Mapping & Graphics
Re: reset region using shapefile
« Reply #6 on: March 11, 2023, 04:15:33 PM »
Hi bisenberger,
The script I modified below should work in Metashape 2.0.

Hope it helps!

Thanks Corensia, but I can't get it to work. The script shows up in the Custom menu pull down. I have a shape selected, set to outer boundary, when I run the script it says "No tie points, script aborted".

Digital Mapping & Graphics LLC
https://digital-mapping.net/

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Re: reset region using shapefile
« Reply #7 on: March 11, 2023, 06:36:45 PM »
Hi bisenberger,

try this modified script. The original was testing on presence of chunk.point_cloud instead of chunk.tie_points

Should run now...
« Last Edit: March 11, 2023, 07:00:29 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

bisenberger

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Digital Mapping & Graphics
Re: reset region using shapefile
« Reply #8 on: March 17, 2023, 04:16:42 AM »
Hi bisenberger,

try this modified script. The original was testing on presence of chunk.point_cloud instead of chunk.tie_points

Should run now...

Thanks Paulo, but it removed most of the tie points within the shape. Ended up just adjusting the bounding box using the shape as a reference.
Digital Mapping & Graphics LLC
https://digital-mapping.net/

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Re: reset region using shapefile
« Reply #9 on: March 17, 2023, 09:46:57 PM »
Yes bisenberger,

I noticed that also, it seems the multiprocessing.dumy Pool used somehow does not finish the whole tie point selection before cropping...

This multiprocessing approach is over my head, maybe Alexey can help more on this point..

Another way to use is removing the multiprocessing and then t will work correctly but slower....
Best Regards,
Paul Pelletier,
Surveyor