[postgis-tickets] r16941 - [raster] Fix envelope Contains shortcut in ST_Clip
Darafei
komzpa at gmail.com
Tue Oct 23 06:00:11 PDT 2018
Author: komzpa
Date: 2018-10-23 06:00:11 -0700 (Tue, 23 Oct 2018)
New Revision: 16941
Modified:
branches/2.5/NEWS
branches/2.5/raster/rt_pg/rtpostgis.sql.in
branches/2.5/raster/test/regress/tickets.sql
branches/2.5/raster/test/regress/tickets_expected
Log:
[raster] Fix envelope Contains shortcut in ST_Clip
Patch by Sai-bot
Closes #3457
Modified: branches/2.5/NEWS
===================================================================
--- branches/2.5/NEWS 2018-10-23 12:58:02 UTC (rev 16940)
+++ branches/2.5/NEWS 2018-10-23 13:00:11 UTC (rev 16941)
@@ -10,6 +10,7 @@
- #4206, Fix support for PostgreSQL 12 dev branch (Laurenz Albe)
- #4211, Fix ST_Subdivide for minimal exterior ring with minimal hole (Darafei
Praliaskouski)
+ - #3457, Fix raster envelope shortcut in ST_Clip (Sai-bot)
PostGIS 2.5.0
2018/09/23
Modified: branches/2.5/raster/rt_pg/rtpostgis.sql.in
===================================================================
--- branches/2.5/raster/rt_pg/rtpostgis.sql.in 2018-10-23 12:58:02 UTC (rev 16940)
+++ branches/2.5/raster/rt_pg/rtpostgis.sql.in 2018-10-23 13:00:11 UTC (rev 16941)
@@ -6971,7 +6971,7 @@
AS $$
BEGIN
-- short-cut if geometry's extent fully contains raster's extent
- IF (nodataval IS NULL OR array_length(nodataval, 1) < 1) AND geom ~ @extschema at .ST_Envelope(rast) THEN
+ IF (nodataval IS NULL OR array_length(nodataval, 1) < 1) AND @extschema at .ST_Contains(geom, @extschema at .ST_Envelope(rast)) THEN
RETURN rast;
END IF;
Modified: branches/2.5/raster/test/regress/tickets.sql
===================================================================
--- branches/2.5/raster/test/regress/tickets.sql 2018-10-23 12:58:02 UTC (rev 16940)
+++ branches/2.5/raster/test/regress/tickets.sql 2018-10-23 13:00:11 UTC (rev 16941)
@@ -121,3 +121,5 @@
-- #4102 negative nodata values don't apply on Raspberry Pi
SELECT '#4102.1', ST_BandNoDataValue(ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1, 0, 0, 0), 1, '16BSI', 0, -10), 1) AS rast;
SELECT '#4102.2', ST_BandNoDataValue(ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1, 0, 0, 0), 1, '32BSI', 0, -10), 1) AS rast;
+
+select '#3457', ST_Area((ST_DumpAsPolygons(ST_Clip(ST_ASRaster(ST_GeomFromText('POLYGON((0 0,100 0,100 100,0 100,0 0))',4326),ST_Addband(ST_MakeEmptyRaster(1,1,0,0,1,-1,0,0,4326),'32BF'::text,0,-1),'32BF'::text,1,-1), ST_GeomFromText('POLYGON((0 0,100 100,100 0,0 0))',4326)))).geom);
Modified: branches/2.5/raster/test/regress/tickets_expected
===================================================================
--- branches/2.5/raster/test/regress/tickets_expected 2018-10-23 12:58:02 UTC (rev 16940)
+++ branches/2.5/raster/test/regress/tickets_expected 2018-10-23 13:00:11 UTC (rev 16941)
@@ -16,3 +16,4 @@
NOTICE: Invalid band index (must use 1-based). Returning NULL
#4102.1|-10
#4102.2|-10
+#3457|4950
More information about the postgis-tickets
mailing list