#include <utils/GrassGISProxy.hpp>
|
| GrassGISProxy ()=delete |
|
| GrassGISProxy (const std::string &GISBase, const std::string &Location, const std::string &Mapset="PERMANENT") |
|
virtual | ~GrassGISProxy () |
|
void | setLocation (const std::string &Location) |
|
void | setMapset (const std::string &Mapset) |
|
void | clearTasks () |
|
void | appendTask (const std::string &Command, const std::map< std::string, std::string > &Arguments={}, const std::vector< std::string > &Options={}) |
|
int | runJob () |
|
int | runSingleTask (const std::string &Command, const std::map< std::string, std::string > &Arguments={}, const std::vector< std::string > &Options={}) const |
|
void | setOutputFile (const std::string &FullPath) |
|
void | setErrorFile (const std::string &FullPath) |
|
const std::vector< std::string > & | jobLines () const |
|
bool | isLocationExist () const |
|
bool | createLocation (const std::string &EPSG) const |
|
std::map< std::string, double > | region () const |
|
std::map< std::string, std::string > | gisenv () const |
|
std::vector< std::string > | mapsets () const |
|
◆ GrassGISProxy() [1/2]
openfluid::utils::GrassGISProxy::GrassGISProxy |
( |
| ) |
|
|
delete |
◆ GrassGISProxy() [2/2]
openfluid::utils::GrassGISProxy::GrassGISProxy |
( |
const std::string & |
GISBase, |
|
|
const std::string & |
Location, |
|
|
const std::string & |
Mapset = "PERMANENT" |
|
) |
| |
◆ ~GrassGISProxy()
virtual openfluid::utils::GrassGISProxy::~GrassGISProxy |
( |
| ) |
|
|
virtual |
◆ appendTask()
void openfluid::utils::GrassGISProxy::appendTask |
( |
const std::string & |
Command, |
|
|
const std::map< std::string, std::string > & |
Arguments = {} , |
|
|
const std::vector< std::string > & |
Options = {} |
|
) |
| |
Appends a task to the current GRASS job.
- Parameters
-
[in] | Command | the GRASS command to execute |
[in] | Arguments | a key-value map of arguments to pass to the GRASS command |
[in] | Options | options to pass to the GRASS command |
◆ clearTasks()
void openfluid::utils::GrassGISProxy::clearTasks |
( |
| ) |
|
|
inline |
Clears all appended tasks.
◆ createLocation()
bool openfluid::utils::GrassGISProxy::createLocation |
( |
const std::string & |
EPSG | ) |
const |
Creates the location defined for the current GRASS session, with the given EPSG code
- Parameters
-
[in] | EPSG | the EPSG code for the location |
- Returns
- true if the location has been created, false if it could not be created or if it already exists
◆ gisenv()
std::map<std::string,std::string> openfluid::utils::GrassGISProxy::gisenv |
( |
| ) |
const |
Returns the environment informations as a key-value map, given by the results of the "g.gisenv -n --q" GRASS command
- Returns
- a key-value map about containing environment informations
◆ isAvailable()
static bool openfluid::utils::GrassGISProxy::isAvailable |
( |
| ) |
|
|
static |
◆ isLocationExist()
bool openfluid::utils::GrassGISProxy::isLocationExist |
( |
| ) |
const |
Returns true if the location already exists
- Returns
- true if the location already exists, false otherwise
◆ jobLines()
const std::vector<std::string>& openfluid::utils::GrassGISProxy::jobLines |
( |
| ) |
const |
|
inline |
Returns the current command lines of the job
- Returns
- a list of command lines
◆ mapsets()
std::vector<std::string> openfluid::utils::GrassGISProxy::mapsets |
( |
| ) |
const |
Returns the list of mapsets in the current location, given by the results of the "g.mapsets separator='\n' -l" GRASS command
- Returns
- a vector of strings containing the mapsets list
◆ region()
std::map<std::string,double> openfluid::utils::GrassGISProxy::region |
( |
| ) |
const |
Returns the region informations as a key-value map, given by the results of the "g.region -gucep" GRASS command
- Returns
- a key-value map about containing region informations
◆ runJob()
int openfluid::utils::GrassGISProxy::runJob |
( |
| ) |
|
Runs a GRASS job made of appended tasks. Once finished, the task queue is cleared.
- Returns
- the exit code of the execution
◆ runSingleTask()
int openfluid::utils::GrassGISProxy::runSingleTask |
( |
const std::string & |
Command, |
|
|
const std::map< std::string, std::string > & |
Arguments = {} , |
|
|
const std::vector< std::string > & |
Options = {} |
|
) |
| const |
Runs a single GRASS task.
- Parameters
-
[in] | Command | the GRASS command to execute |
[in] | Arguments | a key-value map of arguments to pass to the GRASS command |
[in] | Options | options to pass to the GRASS command |
- Returns
- the exit code of the execution
◆ setErrorFile()
void openfluid::utils::GrassGISProxy::setErrorFile |
( |
const std::string & |
FullPath | ) |
|
|
inline |
Sets the file path where the standard error stream will be redirected. If not set or empty, the stream is redirected to a temporary file.
- Parameters
-
[in] | FullPath | the full path for the error file |
◆ setLocation()
void openfluid::utils::GrassGISProxy::setLocation |
( |
const std::string & |
Location | ) |
|
|
inline |
Sets the current location to use for next GRASS execution
- Parameters
-
[in] | Location | the location directory |
◆ setMapset()
void openfluid::utils::GrassGISProxy::setMapset |
( |
const std::string & |
Mapset | ) |
|
|
inline |
Sets the current mapset to use for next GRASS execution
- Parameters
-
[in] | Mapset | the mapset directory |
◆ setOutputFile()
void openfluid::utils::GrassGISProxy::setOutputFile |
( |
const std::string & |
FullPath | ) |
|
|
inline |
Sets the file path where the standard output stream will be redirected. If not set or empty, the stream is redirected to a temporary file.
- Parameters
-
[in] | FullPath | the full path for the output file |
The documentation for this class was generated from the following file: