Database Reference
In-Depth Information
HDF4_EOS:EOS_GRID:"MYD09A1.A2012161.h08v05.005.2012170065756.hdf":MOD_Grid_500m_Surface_Reflectance:sur_refl_b03
HDF4_EOS:EOS_GRID:"MYD09A1.A2012161.h08v05.005.2012170065756.hdf":MOD_Grid_500m_Surface_Reflectance:sur_refl_b02
Now, call gdalbuildvrt with modis.txt in the following manner:
> gdalbuildvrt -separate -input_file_list
modis.txt modis.vrt
Feel free to inspect the generated modis.vrt VRT file in your favorite text editor.
Since the contents of the VRT file are just XML tags, it is easy to make additions,
changes, and deletions.
WewilldoonelastthingbeforeimportingourprocessedMODISrasterintoPostGIS.
WewillconverttheVRTfiletoaGeoTIFFfilewiththe gdal_translate utilitybe-
cause not all applications have built-in support for HDF4, HDF5, NetCDF, or VRT
and the superior portability of GeoTIFF.
> gdal_translate -of GTiff modis.vrt modis.tif
Finally, import modis.tif with raster2pgsql .
> raster2pgsql -s 96974 -F -I -C -Y modis.tif
chap5.modis | psql -d postgis_cookbook
How it works...
This recipe was all about processing a MODIS raster into a form suitable for use
inPostGIS.Weusedthe gdalbuildvrt utilitytocreateourVRT.Asabonus,we
used gdal_translate toconvertbetweenrasterformats,inthiscasefromVRTto
GeoTIFF.
Ifyou'refeelingparticularlyadventurous,tryusing gdalbuildvrt tocreateaVRT
of the 12 PRISM rasters with each raster as a separate band.
Search WWH ::




Custom Search