Command Reference / Overview
This reference section of the documentation provides information about GeoProcessor commands.
- Command Overview
- Commands for Processing Vector Spatial Data Layers
- Commands for Processing Raster Spatial Data Layers
- Commands for Processing Tables
- Commands for Processing DataStores
- Commands to Control Running
- Commands for Handling Files
- Commands for Messages and Logging
- Commands for Testing
- Utility Commands
- QGIS Cross-Reference
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:
- Commands always follow the convention of command name at start with a list of named parameters in parentheses.
The only exceptions are:
- Comments starting with
#
. - Block comments
/*
and*/
that surround one or more command lines. - Command such as
Exit
, which will always have empty list of parameters in the parentheses.
- Comments starting with
- Commands are (currently) case-specific. This may be relaxed in the future.
- Command and parameter names use mixed case where the first letter of each word is capitalized.
- Parameter values must generally be surrounded by double quotes, regardless of type. This convention may be relaxed in the future.
- Each command must exist on a single line.
#
comment blocks can be edited as multiple lines. - Spaces at the front of a command for indentation are allowed to improve logic presentation,
such as code levels for
For
andIf
blocks. Tabs used for indentation are discouraged and may be prohibited in the future because tab width is ambiguous between different users and tools. - Blank lines are allowed and will be handled as
Blank
commands. - 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 delimited format file. |
ReadGeoLayerFromGeoJSON |
Read a GeoLayer from a GeoJSON format file. |
ReadGeoLayerFromKML |
Read a GeoLayer from a KML format file. |
ReadGeoLayerFromShapefile |
Read a GeoLayer from a Shapefile format file. |
ReadGeoLayerFromWebFeatureService |
Read a GeoLayer from an OGC Web Feature Service. |
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. |
RemoveGeoLayerFeatures |
Remove one or more features from a GeoLayer. |
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 |
---|---|
ChangeRasterGeoLayerCRS |
Change a raster layer CRS. |
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. |
FTPGet |
Retrieve 1+ files from an FTP site. |
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. The following table cross-references QGIS algorithms to the equivalent GeoProcessor command for cases where a GeoProcessor command uses an algorithm or plugin. Other GeoProcessor commands directly manipulate layer data without using algorithms or plugins. Additional GeoProcessor commands will be added over time to provide the functionality of useful algorithms and plugins.
Layer Type and QGIS Algorithm/Plugin | Description | Equivalent GeoProcessor Command(s) |
---|---|---|
Raster: Change projection (gdal:warpreproject ) |
Change raster layer coordinate reference system. | ChangeRasterGeoLayerCRS |
Raster: Rasterize (gdal:rasterize ) |
Create a raster layer from vector layer. | RasterizeGeoLayer |
Raster: Rearrange bands (gdal:rearrange_bands ) |
Rearrange a raster layer's bands. | RearrangeRasterGeoLayerBands |
Raster: Write file (gdal:translate ) |
Write a raster layer to a file. | WriteRasterGeoLayerToFile |
Vector: Change geometry (qgis:linestopolygons ) |
Create a new layer with different geometry. | ChangeGeoLayerGeometry |
Vector: Clip (qgis:clip ) |
Extract features from a layer that fall within, or partially within, the boundaries of features in another layer. | ClipGeoLayer |
Vector: Define current projection (qgis:definecurrentprojection ) |
Assign a projection to a layer that has an unassigned coordinate reference system. | SetGeoLayerCRS |
Vector: Intersection qgis:intersection |
Output features that intersect two layers. | IntersectGeoLayer |
Vector: Merge vector layers (qgis:mergevectorlayers ) |
Combine multiple vector layers of the same geometry type into a single vector layer. | MergeGeoLayers |
Vector: Reproject Layer (qgis:reprojectlayer and qgis:definecurrentprojection ) |
Reproject a layer that already has an assigned coordinate reference system. | SetGeoLayerCRS |
Vector: Simplify Geometries (qgis:simplifygeometries ) |
Simplify the geometries of a line or polygon layer by removing unnecessary vertices. | SimplifyGeoLayerGeometry |
Vector: Split layer by attribute (qgis:splitvectorlayer ) |
Split a vector layer into multiple layers based on attribute values. | SplitGeoLayerByAttribute |