Name

ST_BandIsNoData — 밴드가 NODATA 값만으로 채워져 있을 경우 참을 반환합니다.

Synopsis

boolean ST_BandIsNoData(raster rast, integer band, boolean forceChecking=false);

boolean ST_BandIsNoData(raster rast, boolean forceChecking=false);

설명

밴드가 NODATA 값만으로 채워져 있을 경우 참을 반환합니다. 밴드를 지정하지 않으면 밴드 1로 가정합니다. 마지막 인수가 TRUE일 경우, 밴드의 픽셀 전체를 하나하나 확인합니다. 그렇지 않을 경우, 이 함수는 밴드에 대한 isnodata 플래그의 값을 반환할 뿐입니다. 따로 설정하지 않을 경우, 해당 파라미터의 기본값은 FALSE입니다.

2.0.0 버전부터 사용할 수 있습니다.

[Note]

If the flag is dirty (this is, the result is different using TRUE as last parameter and not using it) you should update the raster to set this flag to true, by using ST_SetBandIsNoData(), or ST_SetBandNoDataValue() with TRUE as last argument. See ST_SetBandIsNoData.

예시

This example creates a dummy table with one raster column.

create table dummy_rast (rid integer, rast raster);

-- Add raster with two bands, one pixel/band. In the first band, nodatavalue = pixel value = 3.
-- In the second band, nodatavalue = 13, pixel value = 4
insert into dummy_rast values(
1,
(
'01' -- little endian (uint8 ndr)
||
'0000' -- version (uint16 0)
||
'0200' -- nBands (uint16 0)
||
'17263529ED684A3F' -- scaleX (float64 0.000805965234044584)
||
'F9253529ED684ABF' -- scaleY (float64 -0.00080596523404458)
||
'1C9F33CE69E352C0' -- ipX (float64 -75.5533328537098)
||
'718F0E9A27A44840' -- ipY (float64 49.2824585505576)
||
'ED50EB853EC32B3F' -- skewX (float64 0.000211812383858707)
||
'7550EB853EC32B3F' -- skewY (float64 0.000211812383858704)
||
'E6100000' -- SRID (int32 4326)
||
'0100' -- width (uint16 1)
||
'0100' -- height (uint16 1)
||
'6' -- hasnodatavalue and isnodata value set to true.
||
'2' -- first band type (4BUI)
||
'03' -- novalue==3
||
'03' -- pixel(0,0)==3 (same that nodata)
||
'0' -- hasnodatavalue set to false
||
'5' -- second band type (16BSI)
||
'0D00' -- novalue==13
||
'0400' -- pixel(0,0)==4
)::raster
);

select ST_BandIsNoData(rast, 1) from dummy_rast where rid = 1; -- Expected true
select ST_BandIsNoData(rast, 2) from dummy_rast where rid = 1; -- Expected false