ST_PixelData.getValue
Définition
La fonction ST_PixelData.getValue renvoie la valeur d'un pixel en fonction de son emplacement dans l'objet ST_PixelData. Pour indiquer l'emplacement, vous pouvez utiliser des coordonnées en pixel ou géographiques. La fonction renvoie une erreur lorsque l'emplacement spécifié se trouve au-delà de la dimension du pixel du raster ou de l'étendue géographique. La fonction ST_PixelData.getValue renvoie la valeur NULL si la valeur du pixel à l'emplacement spécifié est NoData.
Syntaxe
Oracle
getValue (band INTEGER,
level INTEGER,
x INTEGER,
y INTEGER)
getValue (band INTEGER,
level INTEGER,
point SE_COORD)
PostgreSQL
getValue (data IN ST_PIXELDATA,
band IN INT,
x IN INT,
y IN INT)
getValue (data IN ST_PIXELDATA,
band IN INT,
point IN SE_COORD)
SQL Server
getValue (band IN INT,
x IN INT,
y IN INT)
getValueByLoc (band IN INT,
x IN double,
y IN double)
Renvoie
Oracle
Nombre
PostgreSQL
Entier
SQL Server
Double
Paramètres
Paramètre | Description |
|---|---|
canal | Numéro de canal (qui commence à 1) du pixel |
level | Niveau de pyramide du pixel |
x | Coordonnée x du pixel |
y | Coordonnée y du pixel |
point | Coordonnée géographique du pixel |
Exemples
Le paramètre suivant renvoie la valeur d'un seul pixel en fonction de son emplacement dans l'objet ST_PixelData.
Oracle
DECLARE
p sde.ST_PixelData;
pixelvalue NUMBER;
BEGIN
SELECT image.getPixelData() INTO p FROM MOAB;
pixelvalue := p.getvalue(1,0,1,1);
pixelvalue := p.getvalue(1,0,SE_COORD(34.057, 117.171));
END;
/
PostgreSQL
CREATE OR REPLACE FUNCTION get_pixel_value()
RETURNS integer AS '
DECLARE
p ST_PIXELDATA;
pixelvalue NUMBER;
BEGIN
SELECT getPixelData(image) INTO p FROM moab;
pixelvalue := getvalue(p,1,1,1);
pixelvalue := getvalue(p,1,SE_COORD(34.057, 117.171));
END;'
LANGUAGE plpgsql;
SELECT get_pixel_data();
DROP FUNCTION IF EXISTS get_pixel_data();
SQL Server
DECLARE @p ST_Pixeldata; @pixelvalue double; SET @p = (SELECT image.getPixelData() FROM moab ); SET @pixelvalue = @p.getValue(1,1,1); SET @pixelvalue = @p.getValueByLoc(1, 34.057, 117.171);