Commit 9872b496 authored by Regina Obe's avatar Regina Obe

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

Reference #4291 for PostGIS 2.5.2

git-svn-id: http://svn.osgeo.org/postgis/branches/2.5@17313 b70326c6-7e19-0410-871a-916f4a2858ee
parent 4e0df766
Pipeline #51019974 passed with stage
in 23 minutes and 19 seconds
......@@ -29,6 +29,7 @@ XXXX/XX/XX
- #4283, Avoid final point duplicates for circle stroking (Paul Ramsey)
- #4314, ST_ClipByBox2D: Do not throw when the geometry is invalid (Raúl Marín)
- #4313, #4307, PostgreSQL 12 compatibility (Laurenz Albe, Raúl Marín)
- #4290, Schema qualify geometry casts in raster functions (Regina Obe)
......
......@@ -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;
------------------------------------------------------------------------------
......@@ -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@.&&) @extschema@.ST_Expand(@extschema@.ST_ConvexHull($3), $5) AND $3::@extschema@.geometry OPERATOR(@extschema@.&&) @extschema@.ST_Expand(@extschema@.ST_ConvexHull($1), $5) AND CASE WHEN $2 IS NULL OR $4 IS NULL THEN @extschema@._ST_dwithin(@extschema@.st_convexhull($1), @extschema@.st_convexhull($3), $5) ELSE @extschema@._ST_dwithin($1, $2, $3, $4, $5) END $$
AS $$ SELECT $1::@extschema@.geometry OPERATOR(@extschema@.&&) @extschema@.ST_Expand(@extschema@.ST_ConvexHull($3), $5) AND $3::@extschema@.geometry OPERATOR(@extschema@.&&) @extschema@.ST_Expand(@extschema@.ST_ConvexHull($1), $5) AND CASE WHEN $2 IS NULL OR $4 IS NULL THEN @extschema@._ST_dwithin(@extschema@.st_convexhull($1), @extschema@.st_convexhull($3), $5) ELSE @extschema@._ST_dwithin($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