This is an old revision of the document!


Creating an operator

TerraAIDA project aims to build InterIMAGE operators using the TerraLib library following the GNU LGLP license model. More information at http://www.dpi.inpe.br/terraaida/.

This page will present an example of how to create your own InterIMAGE operator, using TerraLib.

After created, your operator must have two files, to be inserted into InterIMAGE:

  • The binary, which will perform the implemented operation,
  • The .op file descriptor, describing the parameters, understandable by InterIMAGE GUI.

In this page we describe how to create the source-code of the operator. For information about how to define your .op file descriptor, read the Section “3.1. Operator Description File”, in the System Overview Operation Guide.

The structure of files should follow this example in order to run properly.

The operator main file will call the operator function, which checks the parameters and produces the output. The operator function header can also communicate with InterIMAGE GUI in order to be called directly. Here we create a simple operator, which gets an image by input, and outputs the regions according a certain threshold defined by the user.

Operator Main File

#include <execTAThreshold.hpp>
#include <OpSupportFunctions.hpp>
 
#include <iostream>
 
int main( int argc, char ** argv )
{
  // if executed with no parameters
  if( argc == 1 )
  {
    std::cout << std::endl << "TerraAIDA threshold operator - Version " + 
      OpSupportFunctions::getTAVersion() << std::endl;
    return EXIT_SUCCESS;
  }
 
  // if executed with parameters
  return TerraAIDA::execTAThreshold( argc, argv );
}

Operator Function Header

 

Operator Function Implementation

 

Navigation