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

Function: st_worldtorastercoordx

 

 

Schema

public

 

Owner

postgres

 

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
( 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 columnx INTO xr FROM _st_worldtorastercoord($1, st_x(pt), 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 13/03/2014 13:23
Previous topic Chapter index Next topic