.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "GDAL-RASTER-CREATE" "1" "May 06, 2025" "" "GDAL" .SH NAME gdal-raster-create \- Create a new raster dataset .sp Added in version 3.11. .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX Usage: gdal raster create [OPTIONS] Create a new raster dataset. Positional arguments: \-o, \-\-output Output raster dataset (created by algorithm) [required] Common Options: \-h, \-\-help Display help message and exit \-\-json\-usage Display usage as JSON document and exit \-\-config = Configuration option [may be repeated] \-\-progress Display progress bar Options: \-f, \-\-of, \-\-format, \-\-output\-format Output format \-i, \-\-like, \-\-input Input raster dataset \-\-co, \-\-creation\-option = Creation option [may be repeated] \-\-overwrite Whether overwriting existing output is allowed Mutually exclusive with \-\-append \-\-append Append as a subdataset to existing output Mutually exclusive with \-\-overwrite \-\-size , Output size in pixels \-\-band\-count Number of bands (default: 1) \-\-ot, \-\-datatype, \-\-output\-data\-type Output data type. OUTPUT\-DATA\-TYPE=Byte|Int8|UInt16|Int16|UInt32|Int32|UInt64|Int64|CInt16|CInt32|Float16|Float32|Float64|CFloat32|CFloat64 (default: Byte) \-\-nodata Assign a specified nodata value to output bands (\(aqnone\(aq, numeric value, \(aqnan\(aq, \(aqinf\(aq, \(aq\-inf\(aq) \-\-burn Burn value [may be repeated] \-\-crs Set CRS \-\-bbox Bounding box as xmin,ymin,xmax,ymax \-\-metadata = Add metadata item [may be repeated] \-\-copy\-metadata Copy metadata from input dataset \-\-copy\-overviews Create same overview levels as input dataset Advanced Options: \-\-oo, \-\-open\-option = Open options [may be repeated] \-\-if, \-\-input\-format Input formats [may be repeated] .EE .UNINDENT .UNINDENT .SH DESCRIPTION .sp \fBgdal raster create\fP can be used to initialize a new raster file, from its dimensions, band count, CRS, geotransform, nodata value and metadata. .sp The new file can also be initialized from a model input file with the optional \fI\%\-\-like\fP option, copying its properties but not its pixel values. By default, metadata and the overview structure are not copied from the model input file, unless \fI\%\-\-copy\-metadata\fP and \fI\%\-\-copy\-overviews\fP are specified. Options \fI\%\-\-size\fP, \fI\%\-\-band\-count\fP, \fI\%\-\-datatype\fP, \fI\%\-\-nodata\fP, \fI\%\-\-crs\fP, \fI\%\-\-bbox\fP, \fI\%\-\-metadata\fP can be used to override the values inherited from the model input file. .sp For GeoTIFF output, setting the \fBSPARSE_OK\fP creation option to \fBYES\fP can be useful to create a file of minimum size.\(ga .sp \fBgdal raster create\fP can be used also in special cases, like creating a PDF file from a XML composition file. .SS Options .INDENT 0.0 .TP .B \-\-like, \-\-like Name of GDAL input dataset that serves as a template for default values of options \fI\%\-\-size\fP, \fI\%\-\-band\-count\fP, \fI\%\-\-datatype\fP, \fI\%\-\-crs\fP, \fI\%\-\-bbox\fP and \fI\%\-\-nodata\fP\&. Note that the pixel values will \fInot\fP be copied. .UNINDENT .INDENT 0.0 .TP .B \-\-co = 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. .sp May be repeated. .sp 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 \fI\%\-\-formats\fP command line option but the documentation for the format is the definitive source of information on driver creation options. See \fI\%Raster drivers\fP format specific documentation for legal creation options for each format. .UNINDENT .INDENT 0.0 .TP .B \-\-overwrite Allow program to overwrite existing target file or dataset. Otherwise, by default, \fBgdal\fP errors out if the target file or dataset already exists. .UNINDENT .INDENT 0.0 .TP .B \-\-append Append the new raster as a new subdataset to existing output file. Only works with drivers that support adding subdatasets such as \fI\%GTiff \-\- GeoTIFF File Format\fP and \fI\%GPKG \-\- GeoPackage raster\fP .UNINDENT .INDENT 0.0 .TP .B \-\-size , Set the size of the output file in pixels. First value is width. Second one is height. .UNINDENT .INDENT 0.0 .TP .B \-\-band\-count Number of bands. Defaults to 1. .UNINDENT .INDENT 0.0 .TP .B \-\-ot, \-\-datatype, \-\-output\-data\-type Output data type among \fBByte\fP, \fBInt8\fP, \fBUInt16\fP, \fBInt16\fP, \fBUInt32\fP, \fBInt32\fP, \fBUInt64\fP, \fBInt64\fP, \fBCInt16\fP, \fBCInt32\fP, \fBFloat32\fP, \fBFloat64\fP, \fBCFloat32\fP, \fBCFloat64\fP\&. .UNINDENT .INDENT 0.0 .TP .B \-\-nodata Sets the nodata value. .sp \fBnull\fP or \fBnone\fP can be specified to unset the existing nodata value of the \fI\%\-\-like\fP dataset if it is set. \fBnan\fP, \fBinf\fP or \fB\-inf\fP are also accepted for floating point rasters to respectively mean the special values not\-a\-number, positive infinity and minus infinity. .UNINDENT .INDENT 0.0 .TP .B \-\-burn A fixed value to burn into a band. A list of \fI\%\-\-burn\fP 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. .UNINDENT .INDENT 0.0 .TP .B \-\-crs Set CRS. .sp The coordinate reference systems that can be passed are anything supported by the \fI\%OGRSpatialReference::SetFromUserInput()\fP 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. .sp \fBnull\fP or \fBnone\fP can be specified to unset the existing CRS of the \fI\%\-\-like\fP dataset if it is set. .sp Note that the spatial extent is also left unchanged. .UNINDENT .INDENT 0.0 .TP .B \-\-bbox ,,,ymax> Sets the spatial bounding box, in CRS units. \(aqx\(aq is longitude values for geographic CRS and easting for projected CRS. \(aqy\(aq is latitude values for geographic CRS and northing for projected CRS. .UNINDENT .INDENT 0.0 .TP .B \-\-metadata = Adds a metadata item, at the dataset level. .UNINDENT .INDENT 0.0 .TP .B \-\-copy\-metadata Copy metadata from input dataset and raster bands. Requires \fI\%\-\-like\fP to be specified. .UNINDENT .INDENT 0.0 .TP .B \-\-copy\-overviews Create same overview levels as input dataset (but with empty content). Requires \fI\%\-\-like\fP to be specified. .UNINDENT .SH EXAMPLES .SS Example 1: Initialize a new GeoTIFF file with 3 bands and a uniform value of 10 .INDENT 0.0 .INDENT 3.5 .sp .EX gdal raster create \-\-size=20,20 \-\-band\-count=3 \-\-crs=EPSG:4326 \-\-bbox=2,49,3,50 \-\-burn 10 out.tif .EE .UNINDENT .UNINDENT .SS Example 2: Create a PDF file from a XML composition file .INDENT 0.0 .INDENT 3.5 .sp .EX gdal raster create \-\-creation\-option COMPOSITION_FILE=composition.xml out.pdf .EE .UNINDENT .UNINDENT .SS Example 3: Initialize a blank GeoTIFF file from an input one .INDENT 0.0 .INDENT 3.5 .sp .EX gdal raster create \-\-like prototype.tif output.tif .EE .UNINDENT .UNINDENT .SH AUTHOR Even Rouault .SH COPYRIGHT 1998-2025 .\" Generated by docutils manpage writer. .