Cheatsheet: From GDAL/OGR#
This page helps users familiar with GDAL/OGR migrate their operations to the GeoUtils API.
Regarding function names, GeoUtils exposes an API almost entirely consistent with the recently overhauled GDAL CLI.
Note that GeoUtils is object-oriented (methods run on Raster, Vector, PointCloud, or on DataArray and GeoDataFrame through rst, vct and pc accessors), while GDAL/OGR utilities are typically file-oriented (read from disk, write to disk).
We also provide a conversion table for operations specific to DEMs (e.g. slope, aspect, roughness indexes) that are supported through our sister-package xDEM.
GDAL/OGR utilities#
Legend
The ⟶ symbol denotes methods interfacing from one specific object type to another.
Operation |
Old GDAL/OGR |
New GDAL CLI |
GeoUtils |
|---|---|---|---|
Metadata |
|||
Footprint |
|
|
|
Bounding box |
|
|
|
Info summary |
|
|
|
Raster ⟶ Raster |
|||
Reproject/warp |
|
|
|
Crop to extent |
|
|
|
Clip to geometry |
|
|
|
Edit referencing |
|
|
|
Convert file format |
|
|
|
Filter |
— |
|
|
Proximity distance |
|
|
|
Raster calculator |
|
|
NumPy array interface on |
Mosaic / merge rasters |
|
|
|
Stack rasters into multiband raster |
|
|
|
Fill nodata gaps |
|
|
|
Remove small raster regions |
|
|
|
Generate contours |
|
|
Not implemented |
Raster ⟶ Point |
|||
Interpolate at coordinates |
|
|
|
Raster ⟶ Vector |
|||
Polygonize |
|
|
|
Vector ⟶ Vector |
|||
Reproject |
|
|
|
Crop to extent |
|
|
|
Clip to geometry |
|
|
|
Translate |
|
— |
|
Copy |
|
|
|
Geometric operations |
|
|
|
Vector ⟶ Raster |
|||
Rasterize |
|
|
|
Point ⟶ Raster |
|||
Grid points |
|
|
GDAL DEM utilities#
The table below maps common GDAL DEM analysis utilities (historically provided by gdaldem) to their equivalents in xDEM.
Note that only attributes with equivalences are listed, as xDEM supports more terrain attributes.
Operation |
Old GDAL |
New GDAL CLI |
xDEM |
|---|---|---|---|
Terrain attributes |
|||
Slope |
|
|
|
Aspect |
|
|
|
Hillshade |
|
|
|
Terrain Ruggedness Index |
|
|
|
Topographic Position Index |
|
|
|
Roughness |
|
|
|