GDAL vs pktools: command comparison
Comparison of the commands in the GDAL programs index (https://gdal.org/en/stable/programs/index.html) and the pktools available tools (https://pktools.nongnu.org/html/md_apps.html). Raster first, then vector.
What was read
pktools: the full apps page, and the man page for 26 of the 37 tools. These cover the raster tools, the vector tools,
pkann, andpkcomposite(via its pktools page).GDAL: the full programs index, with the description of every command, plus the full sub pages for
gdal raster neighborsandgdal raster zonal-stats.Not opened: the other GDAL sub pages, and the pktools pages for
pkannogr,pksvm,pksvmogr,pkoptsvm,pkfsann,pkfssvm,pkregann,pkascii2img,pkegcs,pkfilterasciiandpkstatascii. For these, the one-line descriptions from the index pages are used. Cells based only on that are marked †.
Notes:
The new
gdal <command>interface (GDAL 3.11+) is provisional. Both the new and the traditional command names are given.gdal raster neighborsandgdal raster zonal-statswere added in GDAL 3.12.pktools support is now limited, and the author recommends the Python library pyjeo instead.
Part 1: Raster
1A. Operations in common
Operation |
GDAL (new CLI / traditional) |
pktools |
How they differ |
|---|---|---|---|
Dataset info |
|
|
pkinfo prints only the items you request, |
Pixel value at a |
|
|
Same result. pkinfo can also print the |
Crop, band selection |
|
|
pkcrop crops by corners, by centre plus |
Stack bands |
|
|
Both do it. GDAL can write a virtual (VRT) |
Mosaic |
|
|
Mosaicking is common. The compositing |
Change resolution / |
|
|
pkcrop lists only nearest-neighbour and |
Data type change |
|
|
Both do it. |
Rescale values |
|
|
Both do it. |
Assign or override |
|
|
pktools can only override the CRS, not |
Output format |
|
|
pktools has no separate conversion |
Compare two rasters |
|
|
pkdiff does a pixel-by-pixel comparison |
Fill nodata holes |
|
|
Same approach: a search distance and |
Raster to polygons |
|
|
Both support a mask band. |
Sieve small clumps |
|
|
Both support 4- or 8-connectivity. pksieve |
Reclassify pixel |
|
|
pkreclass takes from/to lists or a |
Masks |
|
|
GDAL does it through general raster |
Colour tables |
|
|
pkcreatect attaches an ASCII table or a |
Neighbourhood |
|
|
Overlap: window mean, sum, min, max, |
Raster to text |
|
|
pkdumpimg writes a matrix or |
Text to raster |
XYZ driver, |
|
Via drivers in GDAL, a dedicated tool in |
Statistics at |
|
|
GDAL zonal-stats is the richer one, with a |
Raster statistics |
|
|
pkstat computes mean, median, variance, |
Terrain-related |
|
|
Related, not equivalent. pktools filters |
1B. Raster: unique to pktools
Tool |
What it does |
|---|---|
|
Resolves overlapping pixels by rule: overwrite, maxndvi, |
|
Morphological dilate, erode, open and close. Sobel edge |
|
Per-pixel statistics along a temporal or spectral profile |
|
Kalman-filter data assimilation: fills gaps in a |
|
Rasterizes LAS/LAZ point clouds (height, intensity, scan |
|
Progressive morphological filter to derive a terrain model |
|
Binary sun-shadow mask from a surface model and sun zenith and |
|
Validates a classified raster against reference points and |
|
Training-sample extraction with random or grid sampling, |
|
Neural-network and SVM classification, parameter optimisation, |
|
Utility for rasters in the European Grid Coordinate System. |
1C. Raster: unique to GDAL
Family |
Commands |
|---|---|
Reprojection and |
|
Create and edit |
|
Overviews |
|
Tiling |
|
Indexing, virtual datasets |
|
Terrain and visibility |
|
Distance and extent |
|
Image fusion and display |
|
Border cleaning |
|
Raster algebra |
|
Vector and raster crossing |
|
Pipelines |
|
Multidimensional data |
|
File and system management |
|
Part 2: Vector
pktools has only seven vector-oriented tools. GDAL has about 48 gdal vector commands plus the ogr* programs.
2A. Vector: in common
Operation |
GDAL |
pktools |
How they differ |
|---|---|---|---|
Dump vector to text |
|
|
pkdumpogr dumps all or selected |
Text to vector |
|
|
pkascii2ogr makes points or a single |
Recode attribute |
|
|
pktools has a dedicated from/to recode. |
Attribute statistics |
|
|
pkstatogr gives min, max, mean, median, |
Raster values at |
|
|
See 1A. |
Raster to vector |
|
|
See 1A. |
2B. Vector: unique to pktools
Tool |
What it does |
|---|---|
|
Classify features in a vector dataset using a neural network |
|
Accuracy assessment of a raster map against reference points. |
2C. Vector: unique to GDAL
Family |
Commands |
|---|---|
Info, convert, create |
|
Geometry processing |
|
Validity and topology |
|
Overlay and clip |
|
Reproject |
|
Fields and layers |
|
Combine and update |
|
Indexing |
|
Pipelines |
|
Linear referencing and |
|
Summary
Raster: about 23 operations overlap. Most are straightforward equivalents (info, crop, fill, polygonize, sieve, reclassify, compare). The mosaic, filtering, statistics and extraction rows overlap only in part.
pktools-only raster work: compositing rules, spectral and temporal filtering, Kalman assimilation, LAS rasterization, DEM and shadow tools, accuracy assessment, and machine-learning classification.
GDAL-only raster work: reprojection, tiling, overviews, terrain derivatives, pansharpening, pipelines, multidimensional data, and file management.
Vector: pktools covers a small attribute- and sample-oriented subset. Everything about geometry, topology, reprojection, merging and SQL is GDAL-only, and the only pktools-only vector work is classification and accuracy assessment.