0

I have a large file of n-files. I am interested in using the model builder within GIS to extract subdataset fields within a Modis hdf file. I am particularly interested in extracting Aerosol data from the hdf packed file. I have to do this over several days (to years) worth of data. Once I have extracted these subdatasets within the hdf file, I would need to then project the subdataset into WGS1984.

I am interested in the model building approach, so I can learn its functionality. I know python may provide another solution, however, for the moment, I am interested in sticking with ModelBuilder (for educational purposes...).

I have attempted to create a model, but due to limited experience with this, I am confused as to why it is erroring out. I thought as long as I iterate within all the hdf files within my directory, and pull the subdatasets, then project those subdatasets, I would have usable layers. This is not the case.

Model_Builder_Attempt enter image description here

I am using ArcGIS 10.2 for Desktop.

  • I would imagine the problem is in your submodel, can you edit your question to show us what the submodel is doing, at the moment is just a black box to everyone. – Hornbydd Apr 6 '15 at 20:09
1

I am not certain of the exact problem, but I have a few suggestions of things you can try:

  1. Try setting the output into a folder instead of default gdb.

  2. Double check to make sure the spatial reference files were not lost when copying form the source.

  3. Check which version of HDF file you are trying to use. According to this it may not supported, or may be a type that does not contain a subdataset.

Raster data with subdatasets http://resources.arcgis.com/en/help/main/10.1/index.html#//009t00000014000000

Hope this helps.

  • I figured out that I needed to Define Projection before the extract subset function. When I do this, it will allow me to extract the subset and name the output. Only one problem, once you name the output...and iterate over all the rasters within the workspace, it names ALL the rasters the same name and overwrites them...I will have to find a way to pass through the name string generated in the iterate raster function to the output of the extract subset. Any ideas? – Andrew Desrosiers Apr 7 '15 at 14:43
  • This might help you with that. gis.stackexchange.com/questions/76655/… – Michael B Apr 7 '15 at 15:03
  • I'm not sure I am following the flow. I followed your steps, but the file path and name will not change in the extract subdataset. It still overwrites or errors out. – Andrew Desrosiers Apr 7 '15 at 18:22
  • I need to go back and edit that post, but one thing I found out was that my model worked fine when the raster names were short, and it behaved the same way you are describing when the names were long. (overwrites with the same name) I do not know for sure what or why this happened, all I know is that is what I have observed. So I would suggest shortening the names of your raster files and trying it out. It may also be limitations with the raster format. Sorry I cannot be of more help. Also make sure are using preconditions to insure that the name is parsing before the process executes. – Michael B Apr 7 '15 at 18:29
1

I know this thread is a bit old but here is my solution for anyone trying to do this: I had a similar work task to accomplish with model builder where I had to extract a specific subdataset from over one hundred MODIS C2 .hdf files, store them in a file geodatabase, and run a series of geoprocessing tools afterwards. When I used the iterator tool with the extract subdatset tool I was getting the same error message as above (I'm using ArcGIS 10.5). I finally figured out why I was getting the error: The system is trying to record the name of the .hdf files with the ".hdf" extension within the file geodatabase...which obviously doesn't work !! So, the simple solution is the use the "Parse Path" tool (right click on the Model Builder canvas > Model Only Tools > Parse Path) to only use the name of the HDF file instead of the whole file name, and in the "Extract Subdataset" tool set " Value" as a precondition (Right click on "Extract Subdataset" tool>Properties>Precondition tab: check "Value" only) - Refer to the attached image to understand better. NOTE 1: Make sure to rename all your .HDF files so there is no punctuation in the file name as well otherwise it will not work. NOTE 2: in the Parse path tool make sure you use the option Name only (Not File, Path or extension) Voila ! You should be good to go now ! Have fun and be safe ! Iterator with Extract Subdataset

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.