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 to 1. ๐ŸŽ€
  • --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 --burn options 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 --like to be specified. ๐Ÿ‘€
  • --copy-overviews โ€” Create same overview levels as input dataset (but with empty content). Requires --like to 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, --bbox and --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 as GTiff โ€” GeoTIFF File Format and GPKG โ€” 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 among Byte, 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 by gdal --formats | grep raster | grep + | sort. ๐Ÿ—‚๏ธ
  • --overwrite โ€” Allow program to overwrite existing target file or dataset. Otherwise, by default, gdal errors 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 ๐Ÿ’…โœจ


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