Forum

Author Topic: When cliping raster to boundary error message: Unsupported datum transformation  (Read 2217 times)

3DWinter

  • Full Member
  • ***
  • Posts: 103
    • View Profile
Hello,
I have processed imagery (Align, BuildDense, BuildDEM, BuildOrtho) in stateplane projection.
Code: [Select]
Metashape.CoordinateSystem('EPSG::26934')Then I imported a shapefile with the same projection and datum:
Code: [Select]
#import shape
chunk.importShapes(path=r'125_bounds.shp',boundary_type=Metashape.Shape.OuterBoundary)
Then when I try to clip the DEM and ortho during export:
Code: [Select]
chunk.exportRaster(path=r'new_file.tif',source_data=Metashape.DataSource.ElevationData,white_background=False,clip_to_boundary=True,nodata_value=-99)I get the following error:
Code: [Select]
RuntimeError: Unsupported datum transformation
Is this workflow limited to only latlong?

Maybe relevant, when importing the shapefile in the API I cannot see it- shapefile was created in ArcGIS. Rasterio reads the shapefile just fine.

Paulo

  • Hero Member
  • *****
  • Posts: 1303
    • View Profile
Hi 3DWinter,

I suspect your shape file's corresponding prj does not correctly define the 'EPSG::26934' crs. I would try to delete the prj and use importShapes with crs parameter as
Code: [Select]
chunk.importShapes(path = r'125_bounds.shp', boundary_type = Metashape.Shape.OuterBoundary, crs = Metashape.CoordinateSystem('EPSG::26934'))
see then if your shape appears correctly in Otho view....
Best Regards,
Paul Pelletier,
Surveyor

3DWinter

  • Full Member
  • ***
  • Posts: 103
    • View Profile
Thanks for the help Paulo.
My bad, I miss read the Metashape API manual (attached), as one can only import  CRS if the shapefiles is in CSV format.