Agisoft Metashape
Agisoft Metashape => Python and Java API => Topic started by: 3DWinter on May 05, 2021, 01:09:46 AM
-
Hello,
I have processed imagery (Align, BuildDense, BuildDEM, BuildOrtho) in stateplane projection. Metashape.CoordinateSystem('EPSG::26934')
Then I imported a shapefile with the same projection and datum:
#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:
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:
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.
-
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
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....
-
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.