Show:

A set of associated raster bands and/or vector layers, usually from one file.

// raster dataset:
dataset = gdal.open('file.tif');
bands = dataset.bands;

// vector dataset:
dataset = gdal.open('file.shp');
layers = dataset.layers;`

Methods

buildOverviews
(
  • resampling
  • overviews
  • bands
)

Builds dataset overviews.

Parameters:

  • resampling String

    "NEAREST", "GAUSS", "CUBIC", "AVERAGE", "MODE", "AVERAGE_MAGPHASE" or "NONE"

  • overviews Integer[]
  • [bands] Integer[] optional

    Note: Generation of overviews in external TIFF currently only supported when operating on all bands.

close ()

Closes the dataset to further operations.

executeSQL
(
  • statement
  • spatial_filter=null
  • dialect=null
)
gdal.Layer

Execute an SQL statement against the data store.

Parameters:

  • statement String

    SQL statement to execute.

  • [spatial_filter=null] gdal.Geometry optional

    Geometry which represents a spatial filter.

  • [dialect=null] String optional

    Allows control of the statement dialect. If set to null, the OGR SQL engine will be used, except for RDBMS drivers that will use their dedicated SQL engine, unless "OGRSQL" is explicitely passed as the dialect. Starting with OGR 1.10, the "SQLITE" dialect can also be used.

Returns:

flush ()

Flushes all changes to disk.

getFileList () String[]

Fetch files forming dataset.

Returns a list of files believed to be part of this dataset. If it returns an empty list of files it means there is believed to be no local file system files associated with the dataset (for instance a virtual dataset).

Returns an empty array for vector datasets if GDAL version is below 2.0

Returns:

String[]
getGCPProjection () String

Get output projection for GCPs.

Returns:

String
getGCPs () Object[]

Fetches GCPs.

Returns:

Object[]
getMetadata
(
  • domain
)
Object

Fetch metadata.

Parameters:

  • [domain] String optional

Returns:

Object
setGCPs
(
  • gcps
  • projection
)

Sets GCPs.

Parameters:

  • gcps Object[]
  • projection String
testCapability
(
  • capability
)
Boolean

Determines if the dataset supports the indicated operation.

Parameters:

Returns:

Boolean

Attributes

bands

gdal.DatasetBands readonly

description

String readonly

driver

gdal.Driver readonly

geoTransform

Array

An affine transform which maps pixel/line coordinates into georeferenced space using the following relationship:

Example:

var GT = dataset.geoTransform;
var Xgeo = GT[0] + Xpixel*GT[1] + Yline*GT[2];
var Ygeo = GT[3] + Xpixel*GT[4] + Yline*GT[5];`

layers

gdal.DatasetLayers readonly

rasterSize

Object readonly

Raster dimensions. An object containing x and y properties.

srs

gdal.SpatialReference

Spatial reference associated with raster dataset