|
| 1 | +--- |
| 2 | +sidebar_position: 4 |
| 3 | +description: 'Command Line Interface for DroneDB' |
| 4 | +--- |
| 5 | + |
| 6 | +import CLIAutogen from './_cli_autogen.mdx'; |
| 7 | +import TOCInline from '@theme/TOCInline'; |
| 8 | +import Tabs from '@theme/Tabs'; |
| 9 | +import TabItem from '@theme/TabItem'; |
| 10 | + |
| 11 | +# Reference |
| 12 | + |
| 13 | +`ddb` is a command line interface (CLI) to access DroneDB's functions. This makes it ideal for power users and for creating automated workflows. |
| 14 | + |
| 15 | +See the [CLI Overview](/docs/cli) page for a quick command summary and links to tutorials. |
| 16 | + |
| 17 | +## Quick Examples |
| 18 | + |
| 19 | +Below are concise examples for commands not covered in the [Examples](/docs/cli/examples) page. |
| 20 | + |
| 21 | +### Projecting images |
| 22 | + |
| 23 | +Project images onto a georeferenced map: |
| 24 | + |
| 25 | +```bash |
| 26 | +ddb geoproj images/DJI_0018.JPG -o projected/ |
| 27 | +``` |
| 28 | + |
| 29 | +### Creating static tiles (XYZ/TMS) |
| 30 | + |
| 31 | +Generate tiles for GeoTIFFs, drone images and [COPC](https://github.com/OpenDroneMap/cloud-optimized-point-cloud) point clouds. Similar to [gdal2tiles.py](https://gdal.org/programs/gdal2tiles.html) but faster and with more format support: |
| 32 | + |
| 33 | +```bash |
| 34 | +ddb tile DJI_0018.JPG output_tiles/ |
| 35 | +ddb tile orthophoto.tif output_tiles/ |
| 36 | +``` |
| 37 | + |
| 38 | +### Building COPC point clouds |
| 39 | + |
| 40 | +Build COPC (Cloud Optimized Point Cloud) files for efficient streaming: |
| 41 | + |
| 42 | +```bash |
| 43 | +ddb copc output/ point_cloud.laz |
| 44 | +``` |
| 45 | + |
| 46 | +Supported input formats: LAS, LAZ, E57, PTS, XYZ, PLY. |
| 47 | + |
| 48 | +### Generating Cloud Optimized GeoTIFFs (COG) |
| 49 | + |
| 50 | +Convert standard GeoTIFFs to COGs for efficient streaming with range requests: |
| 51 | + |
| 52 | +```bash |
| 53 | +ddb cog output.tif input.tif |
| 54 | +``` |
| 55 | + |
| 56 | +### Extracting GPS locations/footprints to GeoJSON |
| 57 | + |
| 58 | +```bash |
| 59 | +# GPS points |
| 60 | +ddb info *.JPG -f geojson -o gps.geojson |
| 61 | + |
| 62 | +# Image footprints (polygons) |
| 63 | +ddb info *.JPG -f geojson --geometry polygon -o footprint.geojson |
| 64 | +``` |
| 65 | + |
| 66 | +### Generating STAC Catalogs |
| 67 | + |
| 68 | +Generate STAC-compliant JSON for interoperability: |
| 69 | + |
| 70 | +```bash |
| 71 | +cd my-dataset/ |
| 72 | +ddb stac |
| 73 | + |
| 74 | +# For a specific file |
| 75 | +ddb stac -p orthophoto.tif |
| 76 | +``` |
| 77 | + |
| 78 | +### Building 3D Model Tiles (Nexus) |
| 79 | + |
| 80 | +Generate Nexus files for efficient web streaming of 3D meshes: |
| 81 | + |
| 82 | +```bash |
| 83 | +ddb nxs model.obj output.nxz |
| 84 | +``` |
| 85 | + |
| 86 | +Supported input formats: OBJ, GLTF, GLB. |
| 87 | + |
| 88 | +### Generating Thumbnails |
| 89 | + |
| 90 | +```bash |
| 91 | +ddb thumbs *.JPG -o thumbs/ |
| 92 | +ddb thumbs orthophoto.tif -o thumb.jpg -s 1024 |
| 93 | +``` |
| 94 | + |
| 95 | +### Re-processing indexed files after an upgrade |
| 96 | + |
| 97 | +When you upgrade DroneDB to a version that extracts additional metadata or supports new file types, use `rescan` to update all metadata in place: |
| 98 | + |
| 99 | +```bash |
| 100 | +cd my-dataset/ |
| 101 | +ddb rescan |
| 102 | + |
| 103 | +# Only specific types |
| 104 | +ddb rescan --type image,pointcloud |
| 105 | + |
| 106 | +# Continue even if some files fail |
| 107 | +ddb rescan --continue-on-error |
| 108 | +``` |
| 109 | + |
| 110 | +## Environment Variables |
| 111 | + |
| 112 | +:::tip |
| 113 | +For practical workflow examples (multispectral, terrain analytics, clone/push, metadata), see the [Examples](/docs/cli/examples) page. |
| 114 | +::: |
| 115 | + |
| 116 | +DroneDB reads the following environment variables at runtime. Variables marked **GDAL config** can also be set via `CPLSetConfigOption()` in the GDAL C API. |
| 117 | + |
| 118 | +### General |
| 119 | + |
| 120 | +| Variable | Description | |
| 121 | +|----------|-------------| |
| 122 | +| `DDB_LOG` | If set (any value), enables logging to file (`ddb-log.csv`) in the current directory. | |
| 123 | +| `DDB_DEBUG` | If set (any value), enables verbose debug output on the console. Equivalent to passing `--debug`. | |
| 124 | +| `DDB_HOME` | Override the DDB home directory (default: `~/.ddb`). Stores credentials and user profile. | |
| 125 | +| `DDB_DATA` | Override the DDB data directory used for bundled data files (timezone database, etc.). | |
| 126 | + |
| 127 | +### Point Cloud (COPC/EPT) |
| 128 | + |
| 129 | +| Variable | Description | |
| 130 | +|----------|-------------| |
| 131 | +| `DDB_UNTWINE_PATH` | Absolute path to the `untwine` binary. When set, this path is authoritative: if it does not point to a valid executable, Untwine is considered unavailable. Useful for pinning the backend or running tests. | |
| 132 | +| `DDB_USE_PDAL_COPC` | Set to `1` to force the PDAL COPC backend, bypassing Untwine. | |
| 133 | +| `DDB_COPC_BACKEND` | Explicit backend selection: `"untwine"`, `"pdal"`, or `"auto"` (default). Unknown values are silently ignored. `DDB_USE_PDAL_COPC=1` takes precedence. | |
| 134 | + |
| 135 | +### COG Build (GDAL config) |
| 136 | + |
| 137 | +These variables control `ddb build` and `ddb cog` for GeoRaster entries. They are read via `CPLGetConfigOption` and can also be passed as standard environment variables. |
| 138 | + |
| 139 | +| Variable | Default | Description | |
| 140 | +|----------|---------|-------------| |
| 141 | +| `DDB_COG_JPEG_QUALITY` | `75` | JPEG quality (1–100) for COG compression. Applied only to 8-bit RGB or RGBA rasters. LZW is used for all other cases. | |
| 142 | +| `DDB_WARP_MEMORY_MB` | `512` | GDALWarp memory buffer size in MB (`-wm` flag). Larger values reduce chunking overhead when multi-threading is active. | |
| 143 | +| `DDB_COG_CACHE_MB` | `1024` | GDAL block cache size in MB during COG build. Raised temporarily before the warp and restored afterwards. | |
| 144 | + |
| 145 | +## Commands Reference |
| 146 | + |
| 147 | +<CLIAutogen /> |
0 commit comments