有人可以解释ST_DumpValues
的exclude_nodata_value
参数是什么吗?
例如,给出以下内容:
WITH
-- Create a raster 4x4 raster, with each value set to 8 and NODATA set to -99.
tbl_1 AS (
SELECT
ST_AddBand(
ST_MakeEmptyRaster(4, 4, 0, 0, 1, -1, 0, 0, 4326),
1, '32BF', 8, -99
) AS rast
),
-- Set the values in rows 1 and 2 to -99.
tbl_2 AS (
SELECT
ST_SetValues(
rast, 1, 1, 1, 4, 2, -99, FALSE
) AS rast FROM tbl_1)
为什么以下select语句在前两行中返回NULL
:
SELECT ST_DumpValues(rast, 1, TRUE) AS cell_values FROM tbl_2;
像这样:
{{NULL,NULL,NULL,NULL},{NULL,NULL,NULL,NULL},{8,8,8,8},{8,8,8,8}}
但是以下select语句返回-99
s?
SELECT ST_DumpValues(rast, 1, FALSE) AS cell_values FROM tbl_2;
像这样:
{{-99,-99,-99,-99},{-99,-99,-99,-99},{8,8,8,8},{8,8,8,8}}
显然,对于这两个语句,前两行确实包含-99
个。但是,在第一种情况下(exclude_nodata_value=TRUE
),这些值已被NULLS
屏蔽(但未被替换)。
感谢您的帮助。 PostGIS中NULL
和NODATA
之间的微妙差异让我疯狂了好几天。