Database Reference
In-Depth Information
Processing
and
loading
rasters
with
GDAL VRT
ThoughPostGIShasplentyoffunctionsforworkingwithrasters,itissometimesmore
convenient and more efficient to work on the source rasters before importing them
intothedatabase.Oneofthetimeswhenworkingwithrastersoutsidethedatabase
is more efficient is when the raster contains subdatasets, typically found in HDF4,
HDF5, and NetCDF files.
Getting ready
Inthisrecipe,wewillpreprocessaMODISrasterwiththe
GDAL VRT
formattofilter
andrearrangethesubdatasets.Internally,aVRTfileiscomprisedofXMLtags.This
means we can create a VRT file with any text editor. But, since creating a VRT file
manually can be tedious, we will use the
gdalbuildvrt
utility.
The MODIS raster we use is provided by NASA and available at
You will need GDAL built with HDF4 support to continue with this recipe as MODIS
rasters are usually in the HDF4-EOS format.
The following screenshot shows the MODIS raster used in this recipe and the next
tworecipes.Inthefollowingimage,weseepartsofCalifornia,Nevada,Arizona,and
Baja California: