I have downloaded a file from ftp://n5eil01u.ecs.nsidc.org/SAN/MOSA/MYD10A1.006/2002.07.04/MYD10A1.A2002185.h24v05.006.2016152140234.hdf but this file contains multiple layers, so I want to split this file into multiple files with each output file containing each layer.

How can I do that in ArcGIS?

  • 3
    Please edit your question so that "shape file" is not used as a generic term for data source (a shapefile is only one specific format) – Vince Jul 21 '16 at 11:28

One can either use the Extract Subdataset tool in ArcGIS or I did the same for a bunch of rasters that I downloaded using the python script below: (Note, I renamed the rasters based on what I needed, which could be avoided)

import arcpy,os,re
arcpy.env.workspace = "F:\\MODIS Data\\"
out_dir = "F:\\MODIS Data\\EVIData\\"

 rasters = arcpy.ListRasters("*")
 count = 1
 for raster in rasters:
    output = str(raster)
    s1 = raster.split('.')[2]
    s1 =s1[1:]
    name = out_dir + raster.split('.')[1] + s1
    print name

###Extract the subdataset that you accordingly need to use, here I chose EVI and hence the number is 1

arcpy.ExtractSubDataset_management(raster, name, "1")
  • Please click on the green tick mark so that this question is marked as answered. – Vijay Ramesh Jul 22 '16 at 13:18

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.