Schema
Owner
postgres
Descriptions
There is no description for function _st_intersects
Options
Option | Value |
---|---|
Returns |
boolean |
Language |
|
Parameters |
geom public.geometry rast public.raster nband integer = NULL::integer |
Definition
CREATE OR REPLACE FUNCTION public._st_intersects (
geom public.geometry,
rast public.raster,
nband integer = NULL::integer
)
RETURNS boolean AS
$span$
DECLARE
hasnodata boolean := TRUE;
_geom geometry;
BEGIN
IF ST_SRID(rast) != ST_SRID(geom) THEN
RAISE EXCEPTION 'Raster and geometry do not have the same SRID';
END IF;
_geom := ST_ConvexHull(rast);
IF nband IS NOT NULL THEN
SELECT CASE WHEN bmd.nodatavalue IS NULL THEN FALSE ELSE NULL END INTO hasnodata FROM ST_BandMetaData(rast, nband) AS bmd;
END IF;
IF ST_Intersects(geom, _geom) IS NOT TRUE THEN
RETURN FALSE;
ELSEIF nband IS NULL OR hasnodata IS FALSE THEN
RETURN TRUE;
END IF;
SELECT ST_Collect(t.geom) INTO _geom FROM ST_PixelAsPolygons(rast, nband) AS t;
RETURN ST_Intersects(geom, _geom);
END;
$span$
LANGUAGE 'plpgsql'
IMMUTABLE
CALLED ON NULL INPUT
SECURITY INVOKER
COST 1000;
This file was generated with SQL Manager for PostgreSQL (www.pgsqlmanager.com) at 13/03/2014 13:23 |