GDAL-RASTER-CREATE(1)
๐ GDAL-RASTER-CREATE(1) ๐
okay so bestie, this is the GDAL-RASTER-CREATE(1) page from the GDAL manual, and it's giving "I'm going to manifest a whole raster file out of thin air" ๐ because that's literally the plot: gdal-raster-create makes a brand new raster dataset. Added in version 3.11. periodt. ๐
๐ธ NAME ๐ธ
gdal-raster-create โ Create a new raster dataset
Added in version 3.11.
๐ SYNOPSIS ๐
Usage: gdal raster create [OPTIONS] <OUTPUT>
Create a new raster dataset.
Positional arguments:
-o, --output <OUTPUT> Output raster dataset [required] [not available in pipelines]
Common Options:
-h, --help Display help message and exit
--json-usage Display usage as JSON document and exit
--config <KEY>=<VALUE> Configuration option [may be repeated]
-q, --quiet Quiet mode (no progress bar or warning message) [not available in pipelines]
Options:
-i, --like, --input <TEMPLATE-DATASET> Template raster dataset [not available in pipelines]
-f, --of, --format, --output-format <OUTPUT-FORMAT> Output format ("GDALG" allowed) [not available in pipelines]
--co, --creation-option <KEY>=<VALUE> Creation option [may be repeated] [not available in pipelines]
--overwrite Whether overwriting existing output dataset is allowed [not available in pipelines]
Mutually exclusive with --append
--append Append as a subdataset to existing output [not available in pipelines]
Mutually exclusive with --overwrite
--size <width>,<height> Output size in pixels
--band-count <BAND-COUNT> Number of bands (default: 1)
--ot, --datatype, --output-data-type <OUTPUT-DATA-TYPE> Output data type. OUTPUT-DATA-TYPE=UInt8|Int8|UInt16|Int16|UInt32|Int32|UInt64|Int64|CInt16|CInt32|Float16|Float32|Float64|CFloat32|CFloat64 (default: Byte)
--nodata <NODATA> Assign a specified nodata value to output bands ('none', numeric value, 'nan', 'inf', '-inf')
--burn <BURN> Burn value [may be repeated]
--crs <CRS> Set CRS
--bbox <BBOX> Bounding box as xmin,ymin,xmax,ymax
--metadata <KEY>=<VALUE> Add metadata item [may be repeated]
--copy-metadata Copy metadata from input dataset
Depends on --input
--copy-overviews Create same overview levels as input dataset
Depends on --input
Advanced Options:
--if, --input-format <INPUT-FORMAT> Input formats [may be repeated] [not available in pipelines]
--oo, --open-option <KEY>=<VALUE> Open options [may be repeated] [not available in pipelines]
so yeah, <OUTPUT> is the whole point and she's required ๐
๐ DESCRIPTION ๐
okay so gdal raster create is your girl for initializing a brand new raster file โ you give her dimensions, band count, CRS, geotransform, nodata value and metadata, and she hands you a whole file. main character energy fr โจ
you can ALSO spin up the new file from a model input file using the optional --like option โ she copies its properties but not its pixel values, no cap. and listen: by default, metadata and the overview structure are not copied from that model input file, unless you say --copy-metadata and --copy-overviews. ๐ Options --size, --band-count, --datatype, --nodata, --crs, --bbox, --metadata can be used to override the values inherited from the model input file โ yes bestie, you're allowed to talk back to the template. ๐
for GeoTIFF output, setting the SPARSE_OK creation option to YES can be useful to create a file of minimum size.` โ and yes, that trailing backtick is literally in the original, we keep her, no editing the historical record ๐๐
gdal raster create can be used also in special cases, like creating a PDF file from a XML composition file. ๐โจ
Since GDAL 3.13, create can also be used as a step of gdal raster pipeline. ๐
โญ PROGRAM-SPECIFIC OPTIONS โญ
--band-count <count>โ Number of bands. Defaults to1. ๐--bbox <xmin>,<ymin>,<xmax>,ymaxโ Sets the spatial bounding box, in CRS units.<italic>x</italic>is longitude values for geographic CRS and easting for projected CRS.<italic>y</italic>is latitude values for geographic CRS and northing for projected CRS. ๐บ๏ธ--burn <value>โ A fixed value to burn into a band. A list of--burnoptions can be supplied, one per band (the first value will apply to the first band, the second one to the second band, etc.). If a single value is specified, it will apply to all bands. ๐ฅ--copy-metadataโ Copy metadata from input dataset and raster bands. Requires--liketo be specified. ๐--copy-overviewsโ Create same overview levels as input dataset (but with empty content). Requires--liketo be specified. ๐ช--crs <CRS>โ Set CRS.
The coordinate reference systems that can be passed are anything supported by the OGRSpatialReference::SetFromUserInput() call, which includes EPSG Projected, Geographic or Compound CRS (i.e. EPSG:4296), a well known text (WKT) CRS definition, PROJ.4 declarations, or the name of a .prj file containing a WKT CRS definition. ๐
null or none can be specified to unset the existing CRS of the --like dataset if it is set. ๐ซ
Note that the spatial extent is also left unchanged. โ ๏ธ
-i,--like,--input<TEMPLATE-DATASET>โ Name of GDAL input dataset that serves as a template for default values of options--size,--band-count,--datatype,--crs,--bboxand--nodata. Note that the pixel values will not be copied. ๐ โ๏ธ
Since GDAL 3.13, if the input dataset is tiled, and for output formats GTiff, COG and GPKG, its tile dimensions are replicated to the output file, when they are compatible of its capabilities, and if the user hasn't specified any creation option related to tiling. ๐งฉ
--metadata <KEY>=<VALUE>โ Adds a metadata item, at the dataset level. ๐ท๏ธ--nodata <value>โ Sets the nodata value.
null or none can be specified to unset the existing nodata value of the --like dataset if it is set. nan, inf or -inf are also accepted for floating point rasters to respectively mean the special values not-a-number, positive infinity and minus infinity. ๐
--size <xsize>,<ysize>โ Set the size of the output file in pixels. First value is width. Second one is height. ๐
๐ฆ STANDARD OPTIONS ๐ฆ
--appendโ Append input raster as a new subdataset to an existing output file. Only works with drivers that support adding subdatasets such asGTiffโ GeoTIFF File Format andGPKGโ GeoPackage raster. This also creates the output dataset if it does not exist yet. ๐งท--co,--creation-option <NAME>=<VALUE>โ Many formats have one or more optional creation options that can be used to control particulars about the file created. For instance, the GeoTIFF driver supports creation options to control compression, and whether the file should be tiled. ๐๏ธ
May be repeated.
The creation options available vary by format driver, and some simple formats have no creation options at all. A list of options supported for a format can be listed with the --formats command line option but the documentation for the format is the definitive source of information on driver creation options. See Raster drivers format specific documentation for legal creation options for each format. ๐
--if,--input-format <format>โ Format/driver name to be attempted to open the input file(s). It is generally not necessary to specify it, but it can be used to skip automatic driver detection, when it fails to select the appropriate driver. This option can be repeated several times to specify several candidate drivers. Note that it does not force those drivers to open the dataset. In particular, some drivers have requirements on file extensions. ๐
May be repeated.
--oo,--open-option <NAME>=<VALUE>โ Dataset open option (format specific). ๐
May be repeated.
--ot,--datatype,--output-data-type <OUTPUT-DATA-TYPE>โ Output data type amongByte,Int8,UInt16,Int16,UInt32,Int32,UInt64,Int64,CInt16,CInt32,Float32,Float64,CFloat32,CFloat64. ๐งฎ-f,--of,--format,--output-format <OUTPUT-FORMAT>โ Which output raster format to use. Allowed values may be given bygdal --formats | grep raster | grep + | sort. ๐๏ธ--overwriteโ Allow program to overwrite existing target file or dataset. Otherwise, by default,gdalerrors out if the target file or dataset already exists. ๐ฅ
๐ฅ RETURN STATUS CODE ๐ฅ
The program returns status code 0 in case of success, and non-zero in case of error (non-blocking errors emitted as warnings are considered as a successful execution). โ
/ โ
๐ EXAMPLES ๐
Example 1: Initialize a new GeoTIFF file with 3 bands and a uniform value of 10
gdal raster create --size=20,20 --band-count=3 --crs=EPSG:4326 --bbox=2,49,3,50 --burn 10 out.tif
Example 2: Create a PDF file from a XML composition file
gdal raster create --creation-option COMPOSITION_FILE=composition.xml out.pdf
Example 3: Initialize a blank GeoTIFF file from an input one
gdal raster create --like prototype.tif output.tif
๐ AUTHOR ๐
Even Rouault <even.rouault@spatialys.com> โ the icon, the legend, the blueprint ๐
โจ
๐ COPYRIGHT ๐
1998-2026
and that's the whole page bestie ๐ซถ originally stamped Aug 18, 2026, from GDAL-RASTER-CREATE(1) in the GDAL manual. go make some rasters, you absolute icon ๐๐ฆ๐
๐ฆ where this page comes from
- alpine 3.24: gdal-doc 3.13.3-r0 ยท MIT
- arch rolling: gdal 3.13.3-6 ยท MIT
- ubuntu stonking: gdal-bin 3.13.3+dfsg-1ubuntu4 ยท MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms