Forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - benj_G

Pages: [1]
1
Python and Java API / DEM palette TMS export
« on: November 24, 2022, 05:27:32 PM »
Hi,
in version 1.8.1.13915 if I have a DEM in
Code: [Select]
COMPD_CS["NAD83 / Alberta 3TM ref merid 114 W + GSD95",PROJCS["NAD83 / Alberta 3TM ref merid 114 W",GEOGCS["NAD83",DATUM["North American Datum 1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9102"]],AUTHORITY["EPSG","4269"]],PROJECTION["Transverse_Mercator",AUTHORITY["EPSG","9807"]],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-114],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","3776"]],VERT_CS["NAD83 (EPSG::4269) to GSD95",VERT_DATUM["NAD83 (EPSG::4269) to GSD95",2005],UNIT["metre",1,AUTHORITY["EPSG","9001"]]]]and i whant to export it to TMS palette color in global mercator style there is not problem.

but now in latest 1.8.4.14856 it told me "Error: Vertical datum out of range". We can't reproject on the fly anymore ?

my little code snippet
Code: [Select]
projectionDSM = Metashape.OrthoProjection()
projectionDSM.type = Metashape.OrthoProjection.Type.Planar
projectionDSM.crs = Metashape.CoordinateSystem('EPSG::3857')
# export DEM raster palette
if kwargs['formatOrthoTiles'] == "TMS" :
    task = Metashape.Tasks.ExportRaster()
    task.description = 'DSM'
    task.title = 'DSM'
    task.format = Metashape.RasterFormat.RasterFormatTMS
    task.image_format = Metashape.ImageFormat.ImageFormatPNG
    task.source_data = Metashape.DataSource.ElevationData
    task.raster_transform = Metashape.RasterTransformType.RasterTransformPalette
    task.projection = projectionDSM
    task.global_profile = True
    task.save_alpha = True
    task.white_background = False
    task.path = pathDemExport
    tasks.append(task)

Thanks in advance for any help

Edit: if I export in tif with 3857 it's ok.
Edit2: same problem in GUI

2
Feature Requests / Ntv2 plannimetric shift
« on: June 22, 2022, 01:25:41 AM »
It would be cool if MS could handle ntv2 planimetric coordinate conversion (Eg. like proj and epsg:4326 <-> epsg:31468 with BeTA2007 grid).

In fact for the moment i can transform cameras from dji p4rtk 4326 in 31468 With beta2007 with proj lib,  and make the photogrametric processing in 31468. But when i want to export cloud or mesh to cesium (only wgs) MS make helmert (ToWGS) and WE loose prĂ©cision.

Thanks Agisoft team if you could integrate proj lib or pyproj in metashape

3
Python and Java API / batch add in user-defined coordinate proj
« on: December 24, 2020, 05:15:54 PM »
hi,
i try to batch add to "user-defined coordinate projection" these 8 WKT lines :
Code: [Select]
'COMPD_CS["RGF93 / CC43 + NGF-IGN69 height",PROJCS["RGF93 / CC43",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",42.25],PARAMETER["standard_parallel_2",43.75],PARAMETER["latitude_of_origin",43],PARAMETER["central_meridian",3],PARAMETER["false_easting",1700000],PARAMETER["false_northing",2200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","3943"]],VERT_CS["NGF-IGN69 height",VERT_DATUM["Nivellement General de la France - IGN69",2005,AUTHORITY["EPSG","5119"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Up",UP],AUTHORITY["EPSG","5720"]]]'
'COMPD_CS["RGF93 / CC44 + NGF-IGN69 height",PROJCS["RGF93 / CC44",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",43.25],PARAMETER["standard_parallel_2",44.75],PARAMETER["latitude_of_origin",44],PARAMETER["central_meridian",3],PARAMETER["false_easting",1700000],PARAMETER["false_northing",3200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","3944"]],VERT_CS["NGF-IGN69 height",VERT_DATUM["Nivellement General de la France - IGN69",2005,AUTHORITY["EPSG","5119"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Up",UP],AUTHORITY["EPSG","5720"]]]'
'COMPD_CS["RGF93 / CC45 + NGF-IGN69 height",PROJCS["RGF93 / CC45",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",44.25],PARAMETER["standard_parallel_2",45.75],PARAMETER["latitude_of_origin",45],PARAMETER["central_meridian",3],PARAMETER["false_easting",1700000],PARAMETER["false_northing",4200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","3945"]],VERT_CS["NGF-IGN69 height",VERT_DATUM["Nivellement General de la France - IGN69",2005,AUTHORITY["EPSG","5119"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Up",UP],AUTHORITY["EPSG","5720"]]]'
'COMPD_CS["RGF93 / CC46 + NGF-IGN69 height",PROJCS["RGF93 / CC46",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",45.25],PARAMETER["standard_parallel_2",46.75],PARAMETER["latitude_of_origin",46],PARAMETER["central_meridian",3],PARAMETER["false_easting",1700000],PARAMETER["false_northing",5200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","3946"]],VERT_CS["NGF-IGN69 height",VERT_DATUM["Nivellement General de la France - IGN69",2005,AUTHORITY["EPSG","5119"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Up",UP],AUTHORITY["EPSG","5720"]]]'
'COMPD_CS["RGF93 / CC47 + NGF-IGN69 height",PROJCS["RGF93 / CC47",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",46.25],PARAMETER["standard_parallel_2",47.75],PARAMETER["latitude_of_origin",47],PARAMETER["central_meridian",3],PARAMETER["false_easting",1700000],PARAMETER["false_northing",6200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","3947"]],VERT_CS["NGF-IGN69 height",VERT_DATUM["Nivellement General de la France - IGN69",2005,AUTHORITY["EPSG","5119"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Up",UP],AUTHORITY["EPSG","5720"]]]'
'COMPD_CS["RGF93 / CC48 + NGF-IGN69 height",PROJCS["RGF93 / CC48",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",47.25],PARAMETER["standard_parallel_2",48.75],PARAMETER["latitude_of_origin",48],PARAMETER["central_meridian",3],PARAMETER["false_easting",1700000],PARAMETER["false_northing",7200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","3948"]],VERT_CS["NGF-IGN69 height",VERT_DATUM["Nivellement General de la France - IGN69",2005,AUTHORITY["EPSG","5119"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Up",UP],AUTHORITY["EPSG","5720"]]]'
'COMPD_CS["RGF93 / CC49 + NGF-IGN69 height",PROJCS["RGF93 / CC49",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",48.25],PARAMETER["standard_parallel_2",49.75],PARAMETER["latitude_of_origin",49],PARAMETER["central_meridian",3],PARAMETER["false_easting",1700000],PARAMETER["false_northing",8200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","3949"]],VERT_CS["NGF-IGN69 height",VERT_DATUM["Nivellement General de la France - IGN69",2005,AUTHORITY["EPSG","5119"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Up",UP],AUTHORITY["EPSG","5720"]]]'
'COMPD_CS["RGF93 / CC50 + NGF-IGN69 height",PROJCS["RGF93 / CC50",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",49.25],PARAMETER["standard_parallel_2",50.75],PARAMETER["latitude_of_origin",50],PARAMETER["central_meridian",3],PARAMETER["false_easting",1700000],PARAMETER["false_northing",9200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","3950"]],VERT_CS["NGF-IGN69 height",VERT_DATUM["Nivellement General de la France - IGN69",2005,AUTHORITY["EPSG","5119"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Up",UP],AUTHORITY["EPSG","5720"]]]'

It can be saved or executed at startup of metashape it doesn't matter.
thanks in advence for help

4
Python and Java API / API1.6 exportRaster DEM shaded
« on: February 06, 2020, 12:01:00 PM »
Hi everyone,

we run a full timeline python script with :

Code: [Select]
metashape.exe -r script.py
In this script we export DEM.

In version API1.5 we do :

Code: [Select]
chunk.exportDem(DemPATH, image_format=Metashape.ImageFormatTIFF,nodata=-99999,write_world=True)
and we have a tiff DEM shaded.

we want to migrate our script to API1.6 so we run:

Code: [Select]
chunk.exportRaster(DemPATH,source_data=Metashape.ElevationData,image_format=Metashape.ImageFormatTIFF,nodata_value=-99999,save_world=True)
but we have a tiff DEM not shaded.

if we run the last same command with GUI python console the DEM is shaded and it's ok !


can you explain how to apply shaded DEM by python scripting.

thanks in andvance for your help.

benjamin

5
Python and Java API / Apply patch on multiple shapes
« on: July 08, 2019, 11:28:16 AM »
hi,

In the api python metashape, I found a really useful script for me. This script applies patch of the first picture of the list to the first shape of the list. But I have several shapes. so I made a loop that runs through all the shapes but this script always applies the same image to different shapes.
how to apply the first rank image of each shapes?
thanks in advance for help

Code: [Select]
import Metashape
chunk = Metashape.app.document.chunk
ortho = chunk.orthomosaic
camera = chunk.cameras[0]
patch = Metashape.Orthomosaic.Patch()
patch.image_keys = [camera.key]
for shape in chunk.shapes.items():
ortho.patches[shape] = patch
ortho.update()

6
General / lever arm center focal or center CCD
« on: December 13, 2018, 03:53:08 PM »
Hi everybody,
can you tell me if photoscan takes the focal center or center CCD in order to properly inform the lever arm and the reference for borsight.
thanks a lot in advance.
benjamin

7
General / cesium points export
« on: April 11, 2018, 06:11:26 PM »
hi !
thanks for your export feature in cesium3Dtiles !!!! but you export in a ZIP file.
I have a page html and JS that works when I unzip. do you have a method to access the zip by JS or html without unzip the ton of Go inside?
thanks in advance
benjamin

8
Python and Java API / Export Orthophoto with tile scheme and naming
« on: March 12, 2018, 02:06:36 PM »
I work with updated photoscan and lidar data.
But when exporting photoscan respects a tiling scheme type "NAME-positionX-positionX.tif" Or I would like to export my Orthoimages with an export schema (NAME-roundedprojX-roundedprojY.tif).
 I already have a "SHP" that contains this tiling.
My question is: is it possible to automate this export process with a python script?
thanks in advance

Pages: [1]