ST_PixelAsPoints — Retorna um ponto geométrico para cada pixel de uma banda raster junto com o valor, as coordenas raster X e Y de cada pixel. As coordenadas do ponto são do ponto esquerdo superior do pixel.
setof record ST_PixelAsPoints(
raster rast, integer band=1, boolean exclude_nodata_value=TRUE)
;
Retorna um ponto geométrico para cada pixel de uma banda raster junto com o valor, as coordenas raster X e Y de cada pixel. As coordenadas do ponto são do ponto esquerdo superior do pixel.
Return record format: geom
geometry, val
double precision, x
integer, y
integers.
When |
Disponibilidade: 2.1.0
Alterações: 2.1.1 Mudança no comportamento do exclude_nodata_value.
SELECT x, y, val, ST_AsText(geom) FROM (SELECT (ST_PixelAsPoints(rast, 1)).* FROM dummy_rast WHERE rid = 2) foo; x | y | val | st_astext ---+---+-----+------------------------------ 1 | 1 | 253 | POINT(3427927.75 5793244) 2 | 1 | 254 | POINT(3427927.8 5793244) 3 | 1 | 253 | POINT(3427927.85 5793244) 4 | 1 | 254 | POINT(3427927.9 5793244) 5 | 1 | 254 | POINT(3427927.95 5793244) 1 | 2 | 253 | POINT(3427927.75 5793243.95) 2 | 2 | 254 | POINT(3427927.8 5793243.95) 3 | 2 | 254 | POINT(3427927.85 5793243.95) 4 | 2 | 253 | POINT(3427927.9 5793243.95) 5 | 2 | 249 | POINT(3427927.95 5793243.95) 1 | 3 | 250 | POINT(3427927.75 5793243.9) 2 | 3 | 254 | POINT(3427927.8 5793243.9) 3 | 3 | 254 | POINT(3427927.85 5793243.9) 4 | 3 | 252 | POINT(3427927.9 5793243.9) 5 | 3 | 249 | POINT(3427927.95 5793243.9) 1 | 4 | 251 | POINT(3427927.75 5793243.85) 2 | 4 | 253 | POINT(3427927.8 5793243.85) 3 | 4 | 254 | POINT(3427927.85 5793243.85) 4 | 4 | 254 | POINT(3427927.9 5793243.85) 5 | 4 | 253 | POINT(3427927.95 5793243.85) 1 | 5 | 252 | POINT(3427927.75 5793243.8) 2 | 5 | 250 | POINT(3427927.8 5793243.8) 3 | 5 | 254 | POINT(3427927.85 5793243.8) 4 | 5 | 254 | POINT(3427927.9 5793243.8) 5 | 5 | 254 | POINT(3427927.95 5793243.8)