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

Function: st_worldtorastercoordx

 

 

Schema

public

 

Owner

albenard

 

Descriptions

args: rast, pt - Returns the column 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_worldtorastercoordx (
 rast public.raster,
 pt public.geometry
)
RETURNS integer AS
$span$
DECLARE

xr integer;
BEGIN
IF
( public.ST_geometrytype(pt) != 'ST_Point' ) THEN
RAISE EXCEPTION
'Attempting to compute raster coordinate with a non-point geometry';
END IF;
IF public.ST_SRID(rast) != public.ST_SRID(pt) THEN
RAISE EXCEPTION
'Raster and geometry do not have the same SRID';
END IF;
SELECT columnx INTO xr FROM public._ST_worldtorastercoord($1, public.ST_x(pt), public.ST_y(pt));
RETURN xr;
END;
$span$
LANGUAGE
'plpgsql'
IMMUTABLE
RETURNS NULL ON NULL INPUT
SECURITY INVOKER
COST
100;

COMMENT ON FUNCTION public.st_worldtorastercoordx(rast public.raster, pt public.geometry)
IS 'args: rast, pt - Returns the column 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 26/02/2014 11:51
Previous topic Chapter index Next topic