Back to World Atlas Index
First of all you need to download the TIFF image for Blue Marble NG 2km supplied by NASA
that is a really huge image of about 173 MB.
That's not enough, because the TIFF supplied by NASA lacks any useful georeferencing information, so you need too a companion WorldFile that you can download from here.
Note: both files land_shallow_topo_21600.tif and land_shallow_topo_21600.tfw must be placed on the same directory.
Now you are finally ready for creating and initializing the blue marble Raster Coverage
|
First approach: using the wizards supported by the GUI
Now execute spatialite_gui and create en empty, brand new database.
The side figure shows the menu item you have to select for Creating a Raster Coverage.
|
|
|
Creating a Raster Coverage implies defining several arguments; let's see all them by omogeneous functional groups:
- Defining the identity of the Raster Coverage
- We need to specify a Name, a Title and an Abstract
- Note: using clear and meaningful values is a warmly suggested good practice.
- Warning: the Name is the Primary Key, so you must ensure to use unique values.
- Defining the structure of Pixels and choosing an appropriate Compression method:
- BlueMarble corresponds to a True Color image, and consequently:
- The interpretation of Pixels will then be RGB:
- This automatically implies 3 bands (one for Red, one for Green and one for Blue).
- Each band will occupy 1 byte (UINT8) so to store intensity values ranging from 0 to 255
- In order to save disk space we'll adopt the Jpeg2000 lossy compression:
- This compression algorithm supports configurable quality: we'll set a very aggressive value as low as only 5.
- Thanks to the advanced capabilities of Jpeg2000 this will cause a very strong compression still preserving a fairly good visual appearence.
- Note Jpeg2000 is reasonably fast when decompressing, but is really heavy and slow when compressing.
- BlueMarble doesn't contain any pixel of unspecified value, so NODATA will be set to NONE
- Defining a Reference System and the Spatial Resolution:
- BlueMarble is a worlwide Coverage, so the SRID will be set as 4326 WGS84
- Note: this is a geographic Reference System, and consequently the Coordinates will be expressed as Longitude and Latitude angles. The Unit of Measure will be degrees
- The dimension for each Pixel will be 0.01666667 degrees (on both axes).
|
Why we've set a Pixel Resolution of 0.01666667 ?
- The TIFF image has an overall dimension of 21600 x 10800 Pixels.
- Latitudes range from -180 to +180, so the horizontal Map Extension is 360 degrees.
- Longitudes range form +90 (North Pole) to -90 (South Pole), so the vertical Map Extension is 180 degrees.
- 360.0 / 21600.0 = 0.01666667 (horizontal dimension of a single Pixel).
- 180.0 / 10800.0 = 0.01666667 (vertical dimension of a single Pixel).
|
|
|
All right, we've jus created an empty Raster Coverage; we are now ready for populating it by importing the corresponding TIFF image.
The side figure shows the menu item you have to select for importing one (or more) Raster files(s).
|
|
|
First of all you need to select land_shallow_topo_21600.tif as the file to be imported.
Eventually you might select multiple files at once, but this isn't the case because BlueMarble 2km is just a single TIFF image.
Very important: the TIFF supplied by NASA lacks any internal georeferencing info (it's not a GeoTIFF), so you need to specify that a companion WorldFile is required, and that the SRID value must be unconditionally forced.
Last detail: we'll ask to immediately build the multi-resolution Pyramid, so to get a Raster Coverage immediately ready to be visualized on the Map afer completing the import process.
|
Remember: as we've already seen while creating the Raster Coverage the Jpeg2000 compression is heavy and really slow.
So in order to speed up the import process you must enable parallel processing, that just requires executing a single SQL statement:
SELECT RL2_SetMaxThreads(32);
The more parallel threads you authorize, the greater will be the increase in speed: but be cautious and never exaggerate, because too many threads may imply performance degradation.
|
What is the mysterious WorldFile ?
It's just a plain text file specifying how the imported image has to be anchored to the Map.
0.01666667
0.0
0.0
-0.01666667
-180.000000
90.000000
- first line corresponds the the horizontal dimension of each Pixel.
- second and third lines corresponds to an eventual rotation (that is not required in this case).
- fourth line corresponds the the vertical dimension of each Pixel.
It must be a negative value because Latitude decreases going from top to bottom.
- fifth and sixth lines respectively correspong to the Longitude and Latitude of the upper left corner of the imported image, the so called tie point
|
|
|
The import process is finished; you are now ready for testing the BlueMarble Raster Coverage.
- Open a Map Panel
- Then attach BlueMarble to it
- As you can directly check by yourself anything works nicely as expected.
|
Notice: this is a very infrequent case. It happens just because BlueMarble is based on RGB Pixels that doesn't require any Style to be specified; the default style is already perfectly fit.
Many others Raster Coverages will require instead to specify some appropriate Style in order to be correctly displayed, as we'll see soon in the next step of this tutorial.
|
|
|
Alternative approach: using SQL functions
Both
SpatiaLite and
RasterLite2 always offer full SQL support for all functionalites.
Also in the case of managing Raster Coverages (creating, populating, configuring and so on).
The following SQL functions are supplied by
RasterLite2 and you can learn more about them from
here:
- RL2_CreateRasterCoverage()
- RL2_SetRasterCoverageInfos()
- RL2_SetRasterCoverageCopyright()
- RL2_SetRasterCoverageDefaultBands()
- RL2_EnableRasterCoverageAutoNDVI()
- RL2_IsRasterCoverageAutoNdviEnabled()
- RL2_SetRasterCoverageVisibilityRange()
- RL2_GetRasterCoverageMinScaleDenominator()
- RL2_GetRasterCoverageMaxScaleDenominator()
- RL2_DropCoverage()
- RL2_CopyRasterCoverage()
- RL2_DeleteSection()
Further SQL functions are supplied by
SpatiaLite and you can learn more about them from
here:
- SE_RegisterRasterCoverageSrid()
- SE_UnregisterRasterCoverageSrid()
- SE_UpdateRasterCoverageExtent()
- SE_RegisterRasterCoverageKeyword()
- SE_UnregisterRasterCoverageKeyword()
Where we are
You've just completed the first step of the World Atlas tutorial, and you are now expected to have acquired some basic skills about Raster Coverages
So now return to the index and pass to next topic where we'll examine the ETOPO1 Raster Coverage.
|
Back to
World Atlas Index