Skip to content

Command Reference / Overview

This reference section of the documentation provides information about GeoProcessor commands.


Command Overview

GeoProcessor command files contain a list of commands, one command per line. These commands are processed in sequence from top to bottom. For and If control commands, if present, will cause execution order to jump over commands.

Each command adheres to the syntax:

CommandName(ParameterName1="ParameterValue1",ParameterName2="ParameterValue2",...)

The following are guidelines for commands:

  1. Commands always follow the convention of command name at start with a list of named parameters in parentheses. The only exceptions are:
    1. Comments starting with #.
    2. Block comments /* and */ that surround one or more command lines.
    3. Command such as Exit, which will always have empty list of parameters in the parentheses.
  2. Commands are (currently) case-specific. This may be relaxed in the future.
  3. Command and parameter names use mixed case where the first letter of each word is capitalized.
  4. Parameter values must generally be surrounded by double quotes, regardless of type. This convention may be relaxed in the future.
  5. Each command must exist on a single line. # comment blocks can be edited as multiple lines.
  6. Spaces at the front of a command for indentation are allowed to improve logic presentation, such as code levels for For and If blocks. Tabs used for indentation are discouraged and may be prohibited in the future because tab width is ambiguous between different users and tools.
  7. Blank lines are allowed and will be handled as Blank commands.
  8. Unknown commands are handled as UnknownCommand commands.

Commands for Processing Vector Spatial Data Layers

Command Name                                                   Description
AddGeoLayerAttribute Add an attribute to a GeoLayer.
ClipGeoLayer Clip a GeoLayer by the boundary of another GeoLayer.
CopyGeoLayer Copy a GeoLayer to a new GeoLayer, optionally constraining the copy to a subset of the original features/attributes.
CreateGeoLayerFromGeometry Create a GeoLayer from input geometry data.
FreeGeoLayers Removes one or more GeoLayers from the GeoProcessor.
IntersectGeoLayer Intersects a GeoLayer by another GeoLayer.
MergeGeoLayers Merge multiple GeoLayers into one GeoLayer.
ReadGeoLayerFromDelimitedFile Read a GeoLayer from a file in delimited file format.
ReadGeoLayerFromGeoJSON Read a GeoLayer from a file in GeoJSON format.
ReadGeoLayerFromShapefile Read a GeoLayer from a file in Shapefile format.
ReadGeoLayersFromFGDB Read one or more GeoLayers from a file geodatabase.
ReadGeoLayersFromFolder Read GeoLayers from a folder.
ReadGeoLayersFromGeoPackage Read GeoLayers from a GeoPackage file.
RemoveGeoLayerAttributes Remove one or more attributes from a GeoLayer.
RenameGeoLayerAttribute Rename a GeoLayer's attribute.
RunOgrProgram Run an OGR command line program.
SetGeoLayerCRS Sets a GeoLayer's coordinate reference system.
SetGeoLayerProperty Set a GeoGeoLayer property.
SimplifyGeoLayerGeometry Decreases the verticies in a polygon or line GeoLayer.
SplitGeoLayerByAttribute Split a vector GeoLayer into separate layers using an attribute.
WriteGeoLayerToDelimitedFile Write GeoLayer to a file in delimited file format.
WriteGeoLayerToGeoJSON Write GeoLayer to a file in GeoJSON format.
WriteGeoLayerToKML Write GeoLayer to a file in KML format.
WriteGeoLayerToShapefile Write GeoLayer to a file in Shapefile format.

Commands for Processing Raster Spatial Data Layers

Command Name                                                   Description
CreateRasterGeoLayer Create a raster spatial data layer.
ReadRasterGeoLayerFromFile Read a raster spatial data layer file.
ReadRasterGeoLayerFromTileMapService Read a raster spatial data layer from a tile map service.
ReadRasterGeoLayerFromWebMapService Read a raster spatial data layer from a web map service.
RunGdalProgram Run a GDAL command line program.
RasterizeGeoLayer Create a raster GeoLayer from a vector GeoLayer.
WriteRasterGeoLayerToFile Write a raster spatial data layer file.

Commands for Processing Tables

Command Name                                                   Description
ReadTableFromDataStore Read a table from a DataStore.
ReadTableFromDelimitedFile Read a Table from a delimited file.
ReadTableFromExcel Read a Table from an Excel file.
WriteTableToDataStore Write a Table to a DataStore.
WriteTableToDelimitedFile Write a Table to a delimited file.
WriteTableToExcel Write a Table to an Excel file.

Commands for Processing DataStores

Command Name                                                   Description
CloseDataStore Close a DataStore connection.
OpenDataStore Create a DataStore connection.
ReadTableFromDataStore Read a table from a DataStore.
RunSql Execute a SQL statement on a DataStore.
WriteTableToDataStore Write a Table to a DataStore.

Commands to Control Running

Command Name                                                   Description
# comment Single line comment.
/* comment block start Start of multi-line comment block.
*/ comment block end End of multi-line comment block.
EndIf Indicate the end of an If block.
EndFor Indicate the end of a For block.
For Indicate the start of a For block.
If Indicate the start of an If block.
RunCommands Run a command file, useful to automate running all tests or a multi-step workflow.
RunGdalProgram Run a GDAL command line program.
RunOgrProgram Run an OGR command line program.
RunProgram Run a program.
QgisAlgorithmHelp Print QGIS algorithm list and help.
SetProperty Set a GeoProcessor property.
SetPropertyFromGeoLayer Set a GeoProcessor property from a GeoLayer property.

Commands for Handling Files

Command Name                                                   Description
CopyFile Copy a file.
CreateFolder Create a folder.
ListFiles List the files and folder within a folder or a URL.
RemoveFile Remove a file.
UnzipFile Unzip a file.
WebGet Download a file from URL.

Commands for Messages and Logging

Command Name                                                   Description
Message Print a message to the log file.
StartLog Start a new log file.

Commands for Testing

Command Name                                                   Description
CompareFiles Compare files and optionally warn/fail if different/same.
CreateRegressionTestCommandFile Create a master command file to automate running all tests.
RunCommands Used when running a test suite.
StartRegressionTestResultsReport Start (open) a file to receive regression test results.
WriteCommandSummaryToFile Write a summary of command log messages to a file.
WriteGeoLayerPropertiesToFile Write GeoLayer properties to file.
WritePropertiesToFile Write properties to file.

Utility Commands

Command Name                                                   Description
# Comment Single line comments.
Blank Used for blank lines.
UnknownCommand Used when the command is not recognized.

QGIS Cross-Reference

QGIS provides algorithms and plugins to process spatial data. Below is a table relating the existing QGIS algorithms to the equivalent GeoProcessor command.

QGIS Algorithm/Plugin Algorithm or Plugin Description Equivalent GeoProcessor Command(s) Comment/Status
Add field to attributes table A Add an attribute/attribute field to a layer. AddGeoLayerAttribute Completed
Clip A Extract features from a layer that fall within, or partially within, the boundaries of features in another layer. ClipGeoLayer Completed
Define current projection (qgis:definecurrentprojection) A Assign a projection to a layer that has an unassigned coordinate reference system. SetGeoLayerCRS Completed
Delete Column A Remove an attribute/attribute field from a layer. CopyGeoLayer and RemoveGeoLayerAttributes Completed
DissolveGeoLayer A Dissolve adjacent polygon features into a single polygon feature. MergeGeoLayerFeatures In Queue
Extract by attribute A Extracts features from a layer that match the input attribute query. CopyGeoLayer Completed
Intersection A Output features that intersect two layers. IntersectGeoLayer Completed
Merge vector layers A Combine multiple vector layers of the same geometry type into a single vector layer. MergeGeoLayers Under construction
QChainage P Create points along a line layer at a set distance. CreatePointsAlongALine In Queue
Reproject Layer A Reproject a layer that already has an assigned coordinate reference system. SetGeoLayerCRS Completed
Simplify Geometries A Simplify the geometries of a line or polygon layer by removing unnecessary vertices. SimplifyGeoLayerGeometry Completed
Web Service Geocode P Convert addresses in csv file to a layer. Geocode In Queue