この関数は、ジオメトリーオブジェクトと交差するラスターオブジェクトのすべてのセルの地理座標と値を返します。

構文

set of record ST_Values(raster raster_obj,
                     geometry geom,
                     integer pyramidLevel default 0,
                     cstring bands default '', /* All bands */
                     cstring clipOption default '',
                     out point coords,
                     out integer band,
                     out float8 value)

パラメーター

パラメーター 説明
raster_obj ラスターオブジェクトです。
pyramidLevel ピラミッドレベルです。
geometry クリッピングに使用されるジオメトリーオブジェクトです。
bands クリップするバンドのシーケンス番号です。「0-2」または「1,2,3」の形式です。 シーケンス番号は 0 から始まります。 デフォルト値 は null 文字列 ('') です。 これは、すべてのバンドがクリップされることを示します。
clipOption クリッピングオプションです。 値は JSON 形式の文字列です。
coords ピクセル値の地理座標を示す出力フィールドです。
band ピクセル値のバンドシーケンス番号を示す出力フィールドです。
value ピクセル値を示す出力フィールドです。

次の表は clipOption のパラメーターを示します。

パラメーター データ型 デフォルト値 説明
window_clip Boolean false ジオメトリーオブジェクトのバウンディングボックスを使用してラスターオブジェクトをクリップするかどうかを指定します。 有効な値は以下のとおりです。
  • true : ジオメトリーオブジェクトの最小外接長方形 (MBR) を使用します。
  • false : ジオメトリーオブジェクトを使用します。

説明

  • ジオメトリーオブジェクトとラスターオブジェクトの両方に、有効な空間参照系識別子 (SRID) が必要です。 それらの SRID は一貫している必要があります。
  • デフォルトのクリッピングキャッシュは 100 MB です。これは、100 MB のデータのみが返されることを示します。 出力サイズの制限を調整するには、ganos.raster.clip_max_buffer_size パラメーターを使用してキャッシュのサイズを設定します。

-- Use a geometry object of the point type to clip the raster object.
SELECT ( ST_Values(rast, ST_geomfromtext('POINT(128.135 29.774)', 4326)::geometry, 0,'{"window_clip":"true"}')).*
from rat_clip WHERE id=1;
    coord     | band | value 
--------------+------+-------
 (127.8,29.7) |    0 |    11
 (127.8,29.7) |    1 |    10
 (127.8,29.7) |    2 |    50
(3 rows)

-- Use a geometry object of the linestring type to clip the raster object.
SELECT ( ST_Values(rast, ST_geomfromtext('LINESTRING(0 0, 45 45, 90 0, 135 45)', 4326)::geometry, 0)).*
from rat_clip WHERE id=1 limit 10;
    coord    | band | value 
-------------+------+-------
 (44.1,45)   |    0 |   115
 (44.1,45)   |    1 |   112
 (44.1,45)   |    2 |    69
 (45,45)     |    0 |   122
 (45,45)     |    1 |   117
 (45,45)     |    2 |    75
 (134.1,45)  |    0 |    37
 (134.1,45)  |    1 |    64
 (134.1,45)  |    2 |    13
 (43.2,44.1) |    0 |    66
(10 rows)