Is there a way to write a GDAL raster to a HDF4 or HDF5 dataset using GDAL? I have found many examples that show how to read HDF datasets, but none on how to write them.
You're right, I get
ERROR 6: GDALDriver::Create() ... no create method implemented for this format in both 32bit and 64bit GDAL for HDF4 but driver HDF4Image will create a HDF4 raster.
To test your installed drivers use
GDALInfo --formats and you should see a full list of the available formats:
Supported Formats: HDF4 -raster- (ros): Hierarchical Data Format Release 4 HDF4Image -raster- (rw+): HDF4 Dataset VRT -raster- (rw+v): Virtual Raster GTiff -raster- (rw+vs): GeoTIFF NITF -raster- (rw+vs): National Imagery Transmission Format RPFTOC -raster- (rovs): Raster Product Format TOC format ... and more to follow
HDF4 driver is ros which means read only, the
HDF4Image is rw+ which means read, write and create.