TransWikia.com

Mismatch between two methods projecting hdf5 using GDAL

Geographic Information Systems Asked by Yuwan on January 9, 2021

I want to convert subdataset from h5 to tiff format and project the data with WGS84.

The product is https://www.geo.vu.nl/~gwerf/GFED/GFED4/ name is GFED4.1s_2010.hdf5 and the subdataset is sd39 without coordinate information stored.

gdalinfo GFED4.1s_2010.hdf5 -sd 39

Driver: HDF5Image/HDF5 Dataset
Files: GFED4.1s_2010.hdf5
Size is 1440, 720
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  720.0)
Upper Right ( 1440.0,    0.0)
Lower Right ( 1440.0,  720.0)
Center      (  720.0,  360.0)
Band 1 Block=180x45 Type=Float32, ColorInterp=Undefined
  Metadata:
    burned_area_01_burned_fraction_long_name=GFED4s burned fraction. Note that this INCLUDES an experimental "small fire" estimate and is thus different from the Giglio et al. (2013) paper
    burned_area_01_burned_fraction_units=Fraction of grid cell

I got some code from other answers listed in the community and tried 2 methods to project the data into WGS84 coordinate system.

Method 1

I look through the study area from https://daac.ornl.gov/VEGETATION/guides/fire_emissions_v4_R1.html and use gcp function.

gdal_translate -of VRT -a_srs EPSG:4326 -gcp 0 0 -180 90 -gcp 1440 0 180 90 -gcp 0 720 -180 -90 -gcp 1440 720 180 -90 HDF5:" GFED4.1s_2010.hdf5"://burned_area/01/burned_fraction neu.vrt
gdalwarp -of GTIFF -tps neu.vrt test2.tif

Method 2

Because I found there are two datasets containing lon and lat information, I create vrt from subdatasets.

  SUBDATASET_704_NAME=HDF5:"GFED4.1s_2010.hdf5"://lat
  SUBDATASET_704_DESC=[720x1440] //lat (32-bit floating-point)
  SUBDATASET_705_NAME=HDF5:"GFED4.1s_2010.hdf5"://lon
  SUBDATASET_705_DESC=[720x1440] //lon (32-bit floating-point)

The code is

gdal_translate -of VRT HDF5:"GFED4.1s_2010.hdf5"://lat lat.vrt
gdal_translate -of VRT HDF5:"GFED4.1s_2010.hdf5"://lon lon.vrt
gdal_translate -of VRT HDF5:"GFED4.1s_2010.hdf5"://burned_area/01/burned_fraction burn.vrt
gdalwarp -geoloc -t_srs EPSG:4326 -overwrite burn.vrt test4.tif

And finally, when I export the two figure into Arcmap, they have a mismatch with each other, like this
enter image description here

Because I am new in dealing with satellite data and I guess maybe the method 2 is more accurate? I wonder why the mismatch occurs and which should be used for my following analysis?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP