Commit bb76535e authored by Regina Obe's avatar Regina Obe

Schema qualify all geometry casts in raster code, otherwise materialized views do not resture

References #4291 for PostGIS 3.0.0

git-svn-id: http://svn.osgeo.org/postgis/trunk@17314 b70326c6-7e19-0410-871a-916f4a2858ee
parent 89987419
Pipeline #51061713 passed with stage
in 22 minutes and 16 seconds
......@@ -5968,52 +5968,52 @@ CREATE OR REPLACE FUNCTION raster_overright(raster, raster)
CREATE OR REPLACE FUNCTION raster_left(raster, raster)
RETURNS bool
AS 'select $1::geometry << $2::geometry'
AS 'select $1::@extschema@.geometry << $2::@extschema@.geometry'
LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
CREATE OR REPLACE FUNCTION raster_right(raster, raster)
RETURNS bool
AS 'select $1::geometry >> $2::geometry'
AS 'select $1::@extschema@.geometry >> $2::@extschema@.geometry'
LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
CREATE OR REPLACE FUNCTION raster_overabove(raster, raster)
RETURNS bool
AS 'select $1::geometry |&> $2::geometry'
AS 'select $1::@extschema@.geometry |&> $2::@extschema@.geometry'
LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
CREATE OR REPLACE FUNCTION raster_overbelow(raster, raster)
RETURNS bool
AS 'select $1::geometry &<| $2::geometry'
AS 'select $1::@extschema@.geometry &<| $2::@extschema@.geometry'
LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
CREATE OR REPLACE FUNCTION raster_above(raster, raster)
RETURNS bool
AS 'select $1::geometry |>> $2::geometry'
AS 'select $1::@extschema@.geometry |>> $2::@extschema@.geometry'
LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
CREATE OR REPLACE FUNCTION raster_below(raster, raster)
RETURNS bool
AS 'select $1::geometry <<| $2::geometry'
AS 'select $1::@extschema@.geometry <<| $2::@extschema@.geometry'
LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
CREATE OR REPLACE FUNCTION raster_same(raster, raster)
RETURNS bool
AS 'select $1::geometry ~= $2::geometry'
AS 'select $1::@extschema@.geometry ~= $2::@extschema@.geometry'
LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
CREATE OR REPLACE FUNCTION raster_contained(raster, raster)
RETURNS bool
AS 'select $1::geometry OPERATOR(@extschema@.@) $2::geometry'
AS 'select $1::@extschema@.geometry OPERATOR(@extschema@.@) $2::@extschema@.geometry'
LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
CREATE OR REPLACE FUNCTION raster_contain(raster, raster)
RETURNS bool
AS 'select $1::geometry ~ $2::geometry'
AS 'select $1::@extschema@.geometry ~ $2::@extschema@.geometry'
LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
CREATE OR REPLACE FUNCTION raster_overlap(raster, raster)
RETURNS bool
AS 'select $1::geometry OPERATOR(@extschema@.&&) $2::geometry'
AS 'select $1::@extschema@.geometry OPERATOR(@extschema@.&&) $2::@extschema@.geometry'
LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
-- raster/geometry functions
......@@ -6021,19 +6021,19 @@ CREATE OR REPLACE FUNCTION raster_overlap(raster, raster)
-- Availability: 2.0.0
CREATE OR REPLACE FUNCTION raster_geometry_contain(raster, geometry)
RETURNS bool
AS 'select $1::geometry ~ $2'
AS 'select $1::@extschema@.geometry ~ $2'
LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
-- Availability: 2.0.5
CREATE OR REPLACE FUNCTION raster_contained_by_geometry(raster, geometry)
RETURNS bool
AS 'select $1::geometry OPERATOR(@extschema@.@) $2'
AS 'select $1::@extschema@.geometry OPERATOR(@extschema@.@) $2'
LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
-- Availability: 2.0.0
CREATE OR REPLACE FUNCTION raster_geometry_overlap(raster, geometry)
RETURNS bool
AS 'select $1::geometry OPERATOR(@extschema@.&&) $2'
AS 'select $1::@extschema@.geometry OPERATOR(@extschema@.&&) $2'
LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
-- geometry/raster functions
......@@ -6041,19 +6041,19 @@ CREATE OR REPLACE FUNCTION raster_geometry_overlap(raster, geometry)
-- Availability: 2.0.0
CREATE OR REPLACE FUNCTION geometry_raster_contain(geometry, raster)
RETURNS bool
AS 'select $1 OPERATOR(@extschema@.~) $2::geometry'
AS 'select $1 OPERATOR(@extschema@.~) $2::@extschema@.geometry'
LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
-- Availability: 2.0.5
CREATE OR REPLACE FUNCTION geometry_contained_by_raster(geometry, raster)
RETURNS bool
AS 'select $1 OPERATOR(@extschema@.@) $2::geometry'
AS 'select $1 OPERATOR(@extschema@.@) $2::@extschema@.geometry'
LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
-- Availability: 2.0.0
CREATE OR REPLACE FUNCTION geometry_raster_overlap(geometry, raster)
RETURNS bool
AS 'select $1 OPERATOR(@extschema@.&&) $2::geometry'
AS 'select $1 OPERATOR(@extschema@.&&) $2::@extschema@.geometry'
LANGUAGE 'sql' IMMUTABLE STRICT _PARALLEL;
------------------------------------------------------------------------------
......@@ -6443,7 +6443,7 @@ CREATE OR REPLACE FUNCTION _st_intersects(geom geometry, rast raster, nband inte
-- This function can not be STRICT
CREATE OR REPLACE FUNCTION st_intersects(geom geometry, rast raster, nband integer DEFAULT NULL)
RETURNS boolean AS
$$ SELECT $1 OPERATOR(@extschema@.&&) $2::geometry AND @extschema@._st_intersects($1, $2, $3); $$
$$ SELECT $1 OPERATOR(@extschema@.&&) $2::@extschema@.geometry AND @extschema@._st_intersects($1, $2, $3); $$
LANGUAGE 'sql' IMMUTABLE _PARALLEL
COST 1000;
......@@ -6453,13 +6453,13 @@ CREATE OR REPLACE FUNCTION st_intersects(geom geometry, rast raster, nband integ
CREATE OR REPLACE FUNCTION st_intersects(rast raster, geom geometry, nband integer DEFAULT NULL)
RETURNS boolean
AS $$ SELECT $1::geometry OPERATOR(@extschema@.&&) $2 AND @extschema@._st_intersects($2, $1, $3) $$
AS $$ SELECT $1::@extschema@.geometry OPERATOR(@extschema@.&&) $2 AND @extschema@._st_intersects($2, $1, $3) $$
LANGUAGE 'sql' IMMUTABLE _PARALLEL
COST 1000;
CREATE OR REPLACE FUNCTION st_intersects(rast raster, nband integer, geom geometry)
RETURNS boolean
AS $$ SELECT $1::geometry OPERATOR(@extschema@.&&) $3 AND @extschema@._st_intersects($3, $1, $2) $$
AS $$ SELECT $1::@extschema@.geometry OPERATOR(@extschema@.&&) $3 AND @extschema@._st_intersects($3, $1, $2) $$
LANGUAGE 'sql' IMMUTABLE _PARALLEL
COST 1000;
......@@ -6629,7 +6629,7 @@ CREATE OR REPLACE FUNCTION _ST_DWithin(rast1 raster, nband1 integer, rast2 raste
CREATE OR REPLACE FUNCTION ST_DWithin(rast1 raster, nband1 integer, rast2 raster, nband2 integer, distance double precision)
RETURNS boolean
AS $$ SELECT $1::geometry OPERATOR(@extschema@.&&) ST_Expand(ST_ConvexHull($3), $5) AND $3::geometry OPERATOR(@extschema@.&&) ST_Expand(ST_ConvexHull($1), $5) AND CASE WHEN $2 IS NULL OR $4 IS NULL THEN @extschema@._ST_dwithin(st_convexhull($1), st_convexhull($3), $5) ELSE @extschema@._ST_dwithin($1, $2, $3, $4, $5) END $$
AS $$ SELECT $1::@extschema@.geometry OPERATOR(@extschema@.&&) ST_Expand(ST_ConvexHull($3), $5) AND $3::geometry OPERATOR(@extschema@.&&) ST_Expand(ST_ConvexHull($1), $5) AND CASE WHEN $2 IS NULL OR $4 IS NULL THEN @extschema@._ST_dwithin(st_convexhull($1), st_convexhull($3), $5) ELSE @extschema@._ST_dwithin($1, $2, $3, $4, $5) END $$
LANGUAGE 'sql' IMMUTABLE _PARALLEL
COST 1000;
......@@ -6651,7 +6651,7 @@ CREATE OR REPLACE FUNCTION _ST_DFullyWithin(rast1 raster, nband1 integer, rast2
CREATE OR REPLACE FUNCTION ST_DFullyWithin(rast1 raster, nband1 integer, rast2 raster, nband2 integer, distance double precision)
RETURNS boolean
AS $$ SELECT $1::geometry OPERATOR(@extschema@.&&) @extschema@.ST_Expand(@extschema@.ST_ConvexHull($3), $5) AND $3::geometry OPERATOR(@extschema@.&&) @extschema@.ST_Expand(@extschema@.ST_ConvexHull($1), $5) AND CASE WHEN $2 IS NULL OR $4 IS NULL THEN @extschema@._ST_DFullyWithin(@extschema@.ST_ConvexHull($1), @extschema@.ST_Convexhull($3), $5) ELSE @extschema@._ST_DFullyWithin($1, $2, $3, $4, $5) END $$
AS $$ SELECT $1::@extschema@.geometry OPERATOR(@extschema@.&&) @extschema@.ST_Expand(@extschema@.ST_ConvexHull($3), $5) AND $3::geometry OPERATOR(@extschema@.&&) @extschema@.ST_Expand(@extschema@.ST_ConvexHull($1), $5) AND CASE WHEN $2 IS NULL OR $4 IS NULL THEN @extschema@._ST_DFullyWithin(@extschema@.ST_ConvexHull($1), @extschema@.ST_Convexhull($3), $5) ELSE @extschema@._ST_DFullyWithin($1, $2, $3, $4, $5) END $$
LANGUAGE 'sql' IMMUTABLE _PARALLEL
COST 1000;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment