| 490 | == '''Objective FV.20 - Being able to determine topological characteristics of a coverage''' == |
| 491 | |
| 492 | '''ST_HasOverlaps(rasttable text, rastcolumn text)'''[[BR]] |
| 493 | '''ST_HasGaps(rasttable text, rastcolumn text)'''[[BR]] |
| 494 | '''ST_HasTileSameSize(rasttable text, rastcolumn text)'''[[BR]] |
| 495 | '''ST_HasTileAligned(rasttable text, rastcolumn text)'''[[BR]] |
| 496 | '''ST_IsRegularlyTiled(rasttable text, rastcolumn text)''' if the four conditions above are fulfilled. The ST_HasTileSameSize() condition could be optional.[[BR]] |
| 497 | |
| 498 | ---- |
| 499 | == '''Objective FV.21 - Being able to create overviews in SQL''' == |
| 500 | |
| 501 | '''ST_CreateOverviews(rasttable text, rastcolumn text, overviewnumber int)'''[[BR]] |
| 502 | |
| 503 | Creates the tiles corresponding to the lower resolution (or overviews) of a raster table. So that an overview table can be created like this: SELECT ST_CreateOverviews(rasttable, rast, 2); |
| 504 | |
| 505 | Pseudo code: |
| 506 | |
| 507 | IF ST_IsRegularlyTiled(rasttable text, rastcolumn text) THEN[[BR]] |
| 508 | -- Check if the tiles can be divided into 2x2, 4x4, 8x8 [[BR]] |
| 509 | IF 'SELECT ST_Width(rast) modulo 2 = (overviewnumber + 1) AND ST_Width(rast) modulo (overviewnumber + 1) = 0 FROM rasttable LIMIT 1'[[BR]] |
| 510 | ST_Resample(all the tiles)[[BR]] |
| 511 | Add a column with the number of the set of tile to union together[[BR]] |
| 512 | ST_Union(using this number)[[BR]] |
| 513 | ELSE[[BR]] |
| 514 | Add a column with the number of the set of tile to union together[[BR]] |
| 515 | ST_Union(using this number)[[BR]] |
| 516 | ST_Resample(all the tiles)[[BR]] |
| 517 | ELSE[[BR]] |
| 518 | Resample(all the tiles) -- Without unioning them afterward[[BR]] |
| 519 | END IF |
| 520 | |
| 521 | |
| 522 | ---- |