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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Figure 4.39: Vector to raster conversion.<br />

when working with analysis functions like ST_Intersection(). For instance, the intersection<br />

operation can per<strong>for</strong>m on vector and vector and results in a vector layer, or on vector and raster<br />

with result as a vector/raster layer or on raster and raster with result as a raster layer.<br />

Figure 4.40: <strong>Raster</strong> to vector conversion.<br />

However, as each spatial object has a spatial reference identifier (SRID) and only spatial objects<br />

with the same SRID can be used when per<strong>for</strong>ming spatial operations. So users have to ensure<br />

that vectors or rasters should have the same SRID be<strong>for</strong>e executing some spatial operations on<br />

them.<br />

4.14 Data Formats<br />

<strong>PostGIS</strong> <strong>Raster</strong> allows different <strong>for</strong>ms to express raster data:<br />

• Well Known TexT Well Known TexT (WKT) refers to the human readable text <strong>for</strong>mat. In the<br />

context <strong>of</strong> <strong>PostGIS</strong> <strong>Raster</strong>, it is used when inserting and retrieving a raster from text <strong>for</strong>mat.<br />

Example, the following request creates a raster from a line string with three bands (see Figure<br />

4.41):<br />

SELECT ST_As<strong>Raster</strong>( ST_Buffer( ST_GeomFromText(’LINESTRING(50 50,150 150,150 50)’),<br />

10), 200,200,ARRAY[’8BUI’, ’8BUI’, ’8BUI’], ARRAY[118,154,118], ARRAY[0,0,0])<br />

Where ST_Buffer(geometry, radius) returns a new geometry that represents all points whose<br />

distance from the geometry is less than or equal to radius.<br />

Figure 4.41: Image <strong>for</strong>med by the raster [17].<br />

48

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

Saved successfully!

Ooh no, something went wrong!