API · C++ CLASSES · SubdatasetInfo
SubdatasetInfo
Parses a subdataset path for container formats that hold multiple datasets (NetCDF, HDF5,
…), where a path looks like NETCDF:"file.nc":variable. Obtain one from
Gdal.getSubdatasetInfo(path) (or
new SubdatasetInfo(path)).
Usage
const si = await Gdal.getSubdatasetInfo('NETCDF:"/opfs/climate.nc":tas');
console.log(await si.getPathComponent()); // /opfs/climate.nc
console.log(await si.getSubdatasetComponent()); // tas
Methods
| METHOD | DESCRIPTION |
|---|---|
getPathComponent() → string |
The file-path part of the subdataset path. |
getSubdatasetComponent() → string |
The subdataset (variable) part. |
modifyPathComponent(newPath) → string |
Swap the file path, keeping the subdataset selector, useful to repoint a subdataset reference at a moved file. |