rasterio / rasterio-wheels

MIT License
11 stars 16 forks source link

Add HDF4 support in wheels? #36

Closed snowman2 closed 4 years ago

snowman2 commented 4 years ago

Using the 1.1.2 wheel:

>>> import rasterio
>>> rds = rasterio.open("MOD14.A2019354.1155.006.2019354142314.hdf")
Traceback (most recent call last):
  File "rasterio/_base.pyx", line 216, in rasterio._base.DatasetBase.__init__
  File "rasterio/_shim.pyx", line 67, in rasterio._shim.open_dataset
  File "rasterio/_err.pyx", line 205, in rasterio._err.exc_wrap_pointer
rasterio._err.CPLE_OpenFailedError: 'MOD14.A2019354.1155.006.2019354142314.hdf' not recognized as a supported file format.

Using conda-forge:

>>> import rasterio
>>> rds = rasterio.open("MOD14.A2019354.1155.006.2019354142314.hdf")
/home/snowal/miniconda/envs/rioxarray/lib/python3.7/site-packages/rasterio/__init__.py:219: NotGeoreferencedWarning: Dataset has no geotransform set. The identity matrix may be returned.
  s = DatasetReader(path, driver=driver, sharing=sharing, **kwargs)
>>> rds.subdatasets
['HDF4_SDS:UNKNOWN:MOD14.A2019354.1155.006.2019354142314.hdf:0', 'HDF4_SDS:UNKNOWN:MOD14.A2019354.1155.006.2019354142314.hdf:1', 'HDF4_SDS:UNKNOWN:MOD14.A2019354.1155.006.2019354142314.hdf:29']

This is useful for loading in MODIS data.

snowman2 commented 4 years ago

If there is interest, I would be willing to work on this as well.

sgillies commented 4 years ago

@snowman2 I want to keep these wheels as minimal as possible, and since MODIS GeoTIFFs are available on both AWS and Azure, I think we could do without HDF4.

snowman2 commented 4 years ago

I respect the desire to keep the wheels small.

For reference, the MODIS support on AWS is lacking (https://registry.opendata.aws/modis/)

Update Frequency Not currently updating

And the datasets are temporary (https://docs.opendata.aws/modis-pds/readme.html)

Please note that these products are only stored on Amazon S3 for a period of 30 days after which they will be removed.

I am not familiar with Azure hosting of the data though. Do you have more info on that?

snowman2 commented 4 years ago

Nevermind - found the Azure stuff. It doesn't meet our needs, but we already build our own GDAL and use --no-binary rasterio to install and so we'll just keep doing that.