Forum

Author Topic: Java API - Getting Started  (Read 1861 times)

KBL

  • Newbie
  • *
  • Posts: 31
    • View Profile
Java API - Getting Started
« on: November 23, 2020, 12:44:54 AM »
Hello, I've downloaded the Java API, but I'm having trouble getting even the sample script to run. Running it via "Run Script" generates a syntax error on "class" in "public class align_photos", so I'm assuming that the Java API is not used in the same way. I've tried running it directly from my IDE, but that does not work either.

The sample documentation is limited. Can anyone help me get the sample "align_photos" script running? From there I can make changes as needed, as the API documentation is quite helpful, once I have it running.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14753
    • View Profile
Re: Java API - Getting Started
« Reply #1 on: November 23, 2020, 01:14:13 PM »
Hello KBL,

Have you followed the instructions from the manual?
Quote
Metashape Java API allows to integrate photogrammetric processing engine into applications developed
using Java programming language. It comes in the form of software library and need to be downloaded
separately from Downloads section of Agisoft website.
To configure development environment
1. Download Metashape Java API from Agisoft web-site: https://www.agisoft.com/downloads/installer/
2. Unpack downloaded archive and copy libs and jniLibs folders to your project directory.
3. Add jars from the libs folder to your classpath.

After that, if you wish to use Metashape library in your Java code, you need to compile your program using Java compiler with the properly linked Metashape library.

"Run Script" command in Metashape Pro GUI allows only to start Python (.py) scripts
Best regards,
Alexey Pasumansky,
Agisoft LLC