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.

Figure 4.30: Pyramids at different levels and scales [36].<br />

<strong>The</strong> above command generates an sql file that will load all jpegs in current folder into a new<br />

table called raster_table, where each raster record is a 100x100 pixels width/height. <strong>The</strong> -l will<br />

create an overview table <strong>for</strong> raster_table with pyramid level 4. <strong>The</strong> overview table will be called<br />

o_4_raster_table and contains less raster records than the table raster_table has. Each raster<br />

record in o_4_raster_table is a 100x100 pixels width/height but at a lower resolution.<br />

<strong>The</strong> following script will execute the sql file to load the data into postgisdb:<br />

psql -d postgisdb -f aerials_overview4.sql<br />

4.12 Masks<br />

A mask is a special single band raster where each pixel having either the value <strong>of</strong> 0 or 1. It is<br />

used to define an irregularly shaped region inside another image. <strong>The</strong> 1-bits define the interior <strong>of</strong> the<br />

region and the 0-bits define the exterior <strong>of</strong> the region.<br />

A mask can be <strong>for</strong>med from a non blank raster. Each band <strong>of</strong> a non blank raster can also have a<br />

separate bitmap mask associated with it. Thus, there can be at most n+1 bitmap masks associated<br />

with a non blank raster, where n is the total number <strong>of</strong> bands <strong>of</strong> the raster. A bitmap mask can also<br />

be edited or updated independently.<br />

A mask attached to a raster must have the same number <strong>of</strong> rows and columns as any raster bands<br />

and must precisely cover the same area. It uses the same SRS (the spatial reference system) as that<br />

<strong>of</strong> the raster itself. Logically, a bitmap mask is not an integral part <strong>of</strong> the raster image but rather an<br />

additional piece <strong>of</strong> in<strong>for</strong>mation. Like pyramid, It is stored as a separate raster and independent the<br />

original raster.<br />

Masks are generally used by applications in the following ways [4]:<br />

• A mask can be used to determine which part <strong>of</strong> the image is displayed because sometimes users<br />

might want to mask out a part <strong>of</strong> a raster. An example might be one where a raster layer<br />

describes elevations ranging from below sea level to mountain top. If only certain elevations<br />

above sea level are interested, a mask can be applied to the raster layer to visually simulate<br />

a rise in sea level. A such mask will be computed from the source raster. For example, <strong>for</strong><br />

every cell greater than or equal to 100, its value is set to 1, otherwise its value is set to 0. <strong>The</strong><br />

output is a new raster containing cells with either a 0 (black) or 1 (while) value. <strong>The</strong> black areas<br />

(respectively the white areas) represent everything below (above) the elevation <strong>of</strong> 100 meters.<br />

Combining this mask with a suitable background, the effect <strong>of</strong> raising sea level is effectively<br />

illustrated as show in Figure 4.31.<br />

• When a mask is used as a noData mask in GIS application, the pixel value corresponding to the<br />

exterior (0-bits) <strong>of</strong> the mask will be treated as noData value. For this purpose, this value can<br />

be registered as a noData value in the raster band in<strong>for</strong>mation.<br />

44

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

Saved successfully!

Ooh no, something went wrong!