Warping and resampling rasters
In the previous recipe, we processed a MODIS raster to extract only those subdatasets that are of interest, in a more suitable order. Once done with the extraction, we imported the MODIS raster into its own table.
Here, we make use of the warping capabilities provided in PostGIS. This ranges from simply transforming the MODIS raster to a more suitable projection to creating an overview by resampling the pixel size.
Getting ready
We will use several PostGIS warping functions, specifically ST_Transform()
and ST_Rescale()
. The
ST_Transform()
function reprojects a raster to a new spatial reference system (for example, from WGS84 to NAD83). The ST_Rescale()
function shrinks or grows the pixel size of a raster.
How to do it...
The first thing we will do is transform our raster since the MODIS rasters have their own unique spatial-reference system. We will convert the raster from MODIS Sinusoidal projection to US National Atlas Equal Area (SRID 2163).
Before we transform...