0

I'm in a big trouble. I've downloaded a GeoTIFFF Dataset from http://earthexplorer.usgs.gov/ ; my problem is that I need the dataset in HDFv4 format, because I've to open it in IDL (please don't tell me "IDL can open GeoTIFF", I NEED HDFv4 format) . May you please suggest me a tool that does this conversion?

Thanks a lot.

mgalloy
  • 2,356
  • 1
  • 12
  • 10
Leo91
  • 1,741
  • 3
  • 13
  • 20
  • I don't know of a tool, but it wouldn't be too bad to write something in IDL, especially if there were only specific GeoTIFF tags that you were interested in. – mgalloy Apr 20 '16 at 22:45
  • So you suggest to open GeoTIFF in IDL and then write back to HDF4? – Leo91 Apr 20 '16 at 23:39
  • Yes, I don't think that would be too bad. Is there a standard for the HDF4 output that you will use? – mgalloy Apr 21 '16 at 03:42
  • My problem is that I can't read GeoTIFF with IDL. I don't know how to access data. :\ HDF is so simple. I use HDF4v3 – Leo91 Apr 21 '16 at 09:04

1 Answers1

1

Just to get you started, you could read in the image and its GEOTIFF tags using the following command:

file = FILEPATH('boulder.tif', SUBDIR=['examples','data'])
data_variable=READ_TIFF(file, GEOTIFF=GeoKeys)
HELP, GeoKeys, /STRUCTURE

You would then need to pull apart the geotiff structure and write the data back to an HDF4 file. I don't quite understand why you need HDF4, and I'm also not sure how you're going to write the GEOTIFF data into the HDF4 file, since HDF4 doesn't have anything "specific" about map projections.

See the docs for more details: http://www.harrisgeospatial.com/docs/read_tiff.html

Here's a really bad way to do the conversion: https://www.hdfgroup.org/HDF5-FAQ.html#gtifftohdf Basically, in that case you are only saving the image data, not the geotiff-specific data.

Good luck!

Chris Torrence
  • 452
  • 3
  • 11