13.07.2013 Views

PostGIS Raster : Extending PostgreSQL for The Support of ... - CoDE

PostGIS Raster : Extending PostgreSQL for The Support of ... - CoDE

PostGIS Raster : Extending PostgreSQL for The Support of ... - CoDE

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>The</strong>re<strong>for</strong>e, when the -k option is applied <strong>for</strong> a raster image, it implies that:<br />

• <strong>The</strong> multidimensional matrix <strong>of</strong> cells representing raster image is partitioned into small blocks<br />

(or tiles) <strong>for</strong> large-scale storage and optimal retrieval and processing.<br />

• All imported blocks have the same width and height.<br />

• All blocks do not overlap and their upper left corners follow a regular block grid.<br />

• <strong>The</strong> global extent <strong>of</strong> the raster layer is rectangular and not rotated.<br />

<strong>The</strong>re is, however, no mechanism to en<strong>for</strong>ce these criteria and adding, modifying or deleting a row<br />

from the table might break this regular blocking. So some blocks can be missing in a regular blocked<br />

table. Missing blocks are assumed to be filled with the proper nodata value <strong>of</strong> each band when they<br />

are displayed in a map.<br />

4.11 Pyramids or Overviews<br />

4.11.1 Concept<br />

<strong>The</strong> Pyramids concept is used to reduce resolution representations <strong>of</strong> a raster image to improve<br />

per<strong>for</strong>mance in a way that Pyramids can speed up the display <strong>of</strong> raster data by retrieving only the<br />

data at a specified resolution that is required <strong>for</strong> the display. For instance, the level resolution <strong>of</strong> image<br />

is related to the amount <strong>of</strong> time that an application needs to retrieve and display it, particularly over<br />

the Web. <strong>The</strong> lower the image resolution, the faster it can be displayed. For example, in the case<br />

where the image details are not important as user has "zoomed out" considerably, loading a lower<br />

resolution image is more adequate than loading entire image with a very high resolution.<br />

Figure 4.29: Pyramids (or Overviews) in <strong>PostGIS</strong> <strong>Raster</strong> [24].<br />

When users zoom in, levels with lower resolutions are required to draw successively smaller areas.<br />

However, by using pyramids, per<strong>for</strong>mance is maintained because the database server can choose the<br />

most appropriate pyramid level (or the most appropriate resolution) <strong>of</strong> the raster data to quickly<br />

display it on the screen. In <strong>PostGIS</strong> <strong>Raster</strong>, at each level resolution, a copy <strong>of</strong> image is created and<br />

maintained as a separate raster. So without pyramids, the entire raster must be read from disk and<br />

resampled to a smaller size each time. This is called display resampling process.<br />

Pyramid levels represent reduced resolution images that require less memory space. A pyramid<br />

level <strong>of</strong> 1 indicates the original raster data, there is no reduction in the image resolution and no<br />

change in the storage space required. Values greater than 1 indicates increasingly reduced levels <strong>of</strong><br />

image resolution and reduced storage space requirements. Each successive level <strong>of</strong> the pyramid is<br />

downsampled at a scale <strong>of</strong> 4:1 as in Figure 4.30. Pyramids only need to be built once per raster. After<br />

that, they are accessed each time the raster data is viewed. <strong>The</strong> larger the raster data, the longer it<br />

takes to create the set <strong>of</strong> pyramids. This also means that more time is saved in the long run.<br />

4.11.2 Creating Pyramids<br />

In <strong>PostGIS</strong> <strong>Raster</strong>, a pyramid can be created at the same time as loading a raster image:<br />

python raster2pgsql.py -r *.jpg -t raster_table -s 26986 -l 4 -k 100x100 -I<br />

-o raster_overview_4.sql<br />

43

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!