pggeodb.nancy.inra.fr/db_cefs - db_cefs on pggeodb.nancy.inra.fr
Previous topic Chapter index Next topic

Function: st_worldtorastercoordy

 

 

Schema

public

 

Owner

postgres

 

Descriptions

args: rast, pt - Returns the row in the raster of the point geometry (pt) or a X and Y world coordinate (xw, yw) represented in world spatial reference system of raster.

 

Options

Option

Value

Returns

integer

Language

plpgsql

Parameters

rast public.raster

pt public.geometry

 

Definition

CREATE OR REPLACE FUNCTION public.st_worldtorastercoordy (
 rast public.raster,
 pt public.geometry
)
RETURNS integer AS
$span$
DECLARE

yr integer;
BEGIN
IF
( st_geometrytype(pt) != 'ST_Point' ) THEN
RAISE EXCEPTION
'Attempting to compute raster coordinate with a non-point geometry';
END IF;
IF ST_SRID(rast) != ST_SRID(pt) THEN
RAISE EXCEPTION
'Raster and geometry do not have the same SRID';
END IF;
SELECT rowy INTO yr FROM _st_worldtorastercoord($1, st_x(pt), st_y(pt));
RETURN yr;
END;
$span$
LANGUAGE
'plpgsql'
IMMUTABLE
RETURNS NULL ON NULL INPUT
SECURITY INVOKER
COST
100;

COMMENT ON FUNCTION public.st_worldtorastercoordy(rast public.raster, pt public.geometry)
IS 'args: rast, pt - Returns the row in the raster of the point geometry (pt) or a X and Y world coordinate (xw, yw) represented in world spatial reference system of raster.';

This file was generated with SQL Manager for PostgreSQL (www.pgsqlmanager.com) at 13/03/2014 13:23
Previous topic Chapter index Next topic