[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-367-gf8cb99db9

git at osgeo.org git at osgeo.org
Sat Dec 3 14:45:02 PST 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  f8cb99db94730a532bcd651bfde631b15c8e3ae1 (commit)
       via  895708f86bbc2cb27a84acf817d68ab21328f099 (commit)
      from  fc7e82cd27319a22e33f93ced8f98b1be324ddab (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f8cb99db94730a532bcd651bfde631b15c8e3ae1
Author: Regina Obe <lr at pcorp.us>
Date:   Sat Dec 3 16:24:28 2022 -0500

    1. Fix docbook should use itemizedlist for resample items
    2. Put back overwritten changed item.
    3. Fix regress
    4. Add credits
    
    Closes https://github.com/postgis/postgis/pull/703 for PostGIS 3.4.0

diff --git a/NEWS b/NEWS
index 48d3b44ef..89c794743 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,7 @@ xxxx/xx/xx
   - #5006, GH705, ST_Transform: Support PROJ pipelines (Robert Coup, Koordinates)
   - #5283, RenameTopology (Sandro Santilli)
   - #5286, RenameTopoGeometryColumn (Sandro Santilli)
+  - GH703, Add min/max resampling as options (Christian Schroeder)
 
 * Enhancements *
   - #5194, do not update system catalogs from postgis_extensions_upgrade (Sandro Santilli)
diff --git a/doc/introduction.xml b/doc/introduction.xml
index 61db2a0c4..72b38b4fe 100644
--- a/doc/introduction.xml
+++ b/doc/introduction.xml
@@ -234,6 +234,7 @@
 					<member>Bryce L. Nordgren</member>
 					<member>Carl Anderson</member>
 					<member>Charlie Savage</member>
+                    <member>Christian Schroeder</member>
 					<member>Christoph Berg</member>
 					<member>Christoph Moench-Tegeder</member>
 					<member>Dane Springmeyer</member>
diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml
index c50ead03b..0a0a9657d 100644
--- a/doc/reference_raster.xml
+++ b/doc/reference_raster.xml
@@ -6939,15 +6939,15 @@ FROM (
 
                 <para>Resample a raster by adjusting only its scale (or pixel size). New pixel values are computed using one of the following resampling algorithms:</para>
 
-                <list type="bullet">
-                    <item>NearestNeighbor (english or american spelling)</item>
-                    <item>Bilinear</item>
-                    <item>Cubic</item>
-                    <item>CubicSpline</item>
-                    <item>Lanczos</item>
-                    <item>Max</item>
-                    <item>Min</item>
-                </list>
+                <itemizedlist mark='bullet'>
+                    <listitem>NearestNeighbor (english or american spelling)</listitem>
+                    <listitem>Bilinear</listitem>
+                    <listitem>Cubic</listitem>
+                    <listitem>CubicSpline</listitem>
+                    <listitem>Lanczos</listitem>
+                    <listitem>Max</listitem>
+                    <listitem>Min</listitem>
+                </itemizedlist>
 
                 <para>The default is NearestNeighbor which is the fastest but results in the worst interpolation.</para>
 
@@ -6963,6 +6963,7 @@ FROM (
 
                 <para>Availability: 2.0.0  Requires GDAL 1.6.1+</para>
                 <para>Changed: 3.4.0 max and min resampling options added</para>
+                <para>Changed: 2.1.0 Works on rasters with no SRID</para>
             </refsection>
 
             <refsection>
diff --git a/raster/test/regress/rt_gdalwarp.sql b/raster/test/regress/rt_gdalwarp.sql
index b8b7eeed2..abee24978 100644
--- a/raster/test/regress/rt_gdalwarp.sql
+++ b/raster/test/regress/rt_gdalwarp.sql
@@ -450,7 +450,7 @@ INSERT INTO raster_gdalwarp_dst (rid, rast) VALUES (
 		0, 0,
 		'Min', 0
 	) FROM raster_gdalwarp_src)
-), ;
+) ;
 
 -- ST_Transform
 INSERT INTO raster_gdalwarp_dst (rid, rast) VALUES (
diff --git a/raster/test/regress/rt_gdalwarp_expected b/raster/test/regress/rt_gdalwarp_expected
index a545fe8ba..649f8d98e 100644
--- a/raster/test/regress/rt_gdalwarp_expected
+++ b/raster/test/regress/rt_gdalwarp_expected
@@ -42,6 +42,8 @@ NOTICE:  Values must be provided for both X and Y when specifying the scale.  Re
 1.23|992163|150|150|1|66.667|-66.667|0.000|0.000|-500000.000|600000.000|t|t|t
 1.24|992163|5|5|1|2064.200|-2291.200|0.000|0.000|-500321.000|601456.000|t|t|t
 1.25|||||||||||||
+1.26|992163|20|20|1|500.000|500.000|0.000|0.000|-500000.000|590000.000|t|t|t
+1.27|992163|20|20|1|500.000|500.000|0.000|0.000|-500000.000|590000.000|t|t|t
 1.3|992163|10|10|1|1000.000|-1000.000|0.000|0.000|-500000.000|600000.000|t|t|t
 1.4|992163|10|10|1|1000.000|-1000.000|0.000|0.000|-500000.000|600000.000|t|t|t
 1.5|992163|20|20|1|500.000|500.000|0.000|0.000|-500000.000|590000.000|t|t|t
@@ -57,6 +59,8 @@ NOTICE:  Values must be provided for both X and Y when specifying the scale.  Re
 3.4|992163|10|10|1|1000.000|-1000.000|0.000|0.000|-500000.000|600000.000|t|t|t
 3.5|992163|100|100|1|100.000|100.000|0.000|0.000|-500000.000|590000.000|t|t|t
 3.6|992163|67|80|1|150.000|125.000|0.000|0.000|-500000.000|590000.000|t|t|t
+3.7|992163|67|80|1|150.000|125.000|0.000|0.000|-500000.000|590000.000|t|t|t
+3.8|992163|67|80|1|150.000|125.000|0.000|0.000|-500000.000|590000.000|t|t|t
 4.1|992163|10|10|1|1000.000|-1000.000|0.000|0.000|-500000.000|600000.000|t|t|t
 4.2|992163|10|10|1|1000.000|-1000.000|1.000|1.000|-500010.000|600000.000|t|t|t
 4.3|992163|10|10|1|1000.000|-1000.000|0.500|0.000|-500010.000|600000.000|t|t|t

commit 895708f86bbc2cb27a84acf817d68ab21328f099
Author: Christian Schroeder <43764673+christianaaronschroeder at users.noreply.github.com>
Date:   Tue Aug 9 09:42:43 2022 -0400

    1. add min/max resampling as options
    2. update doc
    3. min/max examples

diff --git a/doc/reference_raster.xml b/doc/reference_raster.xml
index d2f4a3bde..c50ead03b 100644
--- a/doc/reference_raster.xml
+++ b/doc/reference_raster.xml
@@ -6844,10 +6844,19 @@ WHERE rid = 2;
                     Resample a raster using a specified resampling algorithm, new dimensions (width & height), a grid corner (gridx & gridy) and a set of raster georeferencing attributes (scalex, scaley, skewx & skewy) defined or borrowed from another raster. If using a reference raster, the two rasters must have the same SRID.
                 </para>
 
-                <para>
-                    New pixel values are computed using the NearestNeighbor (English or American spelling), Bilinear, Cubic, CubicSpline or Lanczos resampling algorithm. Default is NearestNeighbor which is the fastest but produce the worst interpolation.
-                </para>
+                <para>New pixel values are computed using one of the following resampling algorithms:</para>
+
+                <list type="bullet">
+                    <item>NearestNeighbor (english or american spelling)</item>
+                    <item>Bilinear</item>
+                    <item>Cubic</item>
+                    <item>CubicSpline</item>
+                    <item>Lanczos</item>
+                    <item>Max</item>
+                    <item>Min</item>
+                </list>
 
+                <para>The default is NearestNeighbor which is the fastest but results in the worst interpolation.</para>
                 <para>
                     A maxerror percent of 0.125 is used if no <varname>maxerr</varname> is specified.
                 </para>
@@ -6858,7 +6867,7 @@ WHERE rid = 2;
                     </para>
                 </note>
                 <para>Availability: 2.0.0 Requires GDAL 1.6.1+</para>
-                <para>Changed: 2.1.0 Parameter srid removed. Variants with a reference raster no longer applies the reference raster's SRID. Use ST_Transform() to reproject raster. Works on rasters with no SRID.</para>
+                <para>Changed: 3.4.0 max and min resampling options added</para>
             </refsection>
 
             <refsection>
@@ -6899,7 +6908,7 @@ FROM (
         <refentry id="RT_ST_Rescale">
             <refnamediv>
                 <refname>ST_Rescale</refname>
-                <refpurpose>Resample a raster by adjusting only its scale (or pixel size). New pixel values are computed using the NearestNeighbor (english or american spelling), Bilinear, Cubic, CubicSpline or Lanczos resampling algorithm. Default is NearestNeighbor.
+                <refpurpose>Resample a raster by adjusting only its scale (or pixel size). New pixel values are computed using the NearestNeighbor (english or american spelling), Bilinear, Cubic, CubicSpline, Lanczos, Max or Min resampling algorithm. Default is NearestNeighbor.
                     </refpurpose>
             </refnamediv>
 
@@ -6928,7 +6937,19 @@ FROM (
             <refsection>
                 <title>Description</title>
 
-                <para>Resample a raster by adjusting only its scale (or pixel size). New pixel values are computed using the NearestNeighbor (english or american spelling), Bilinear, Cubic, CubicSpline or Lanczos resampling algorithm. The default is NearestNeighbor which is the fastest but results in the worst interpolation.</para>
+                <para>Resample a raster by adjusting only its scale (or pixel size). New pixel values are computed using one of the following resampling algorithms:</para>
+
+                <list type="bullet">
+                    <item>NearestNeighbor (english or american spelling)</item>
+                    <item>Bilinear</item>
+                    <item>Cubic</item>
+                    <item>CubicSpline</item>
+                    <item>Lanczos</item>
+                    <item>Max</item>
+                    <item>Min</item>
+                </list>
+
+                <para>The default is NearestNeighbor which is the fastest but results in the worst interpolation.</para>
 
                 <para><varname>scalex</varname> and <varname>scaley</varname> define the new pixel size. scaley must often be negative to get well oriented raster.</para>
 
@@ -6941,7 +6962,7 @@ FROM (
                 <note><para>ST_Rescale is different from <xref linkend="RT_ST_SetScale" /> in that ST_SetScale do not resample the raster to match the raster extent. ST_SetScale only changes the metadata (or georeference) of the raster to correct an originally mis-specified scaling. ST_Rescale results in a raster having different width and height computed to fit the geographic extent of the input raster. ST_SetScale do not modify the width, nor the height of the raster.</para></note>
 
                 <para>Availability: 2.0.0  Requires GDAL 1.6.1+</para>
-                <para>Changed: 2.1.0 Works on rasters with no SRID</para>
+                <para>Changed: 3.4.0 max and min resampling options added</para>
             </refsection>
 
             <refsection>
diff --git a/raster/rt_core/rt_util.c b/raster/rt_core/rt_util.c
index 8c3696ef0..7f39c5741 100644
--- a/raster/rt_core/rt_util.c
+++ b/raster/rt_core/rt_util.c
@@ -106,7 +106,10 @@ rt_util_gdal_resample_alg(const char *algname) {
 		return GRA_Cubic;
 	else if (strcmp(algname, "LANCZOS") == 0)
 		return GRA_Lanczos;
-
+	else if (strcmp(algname, "MAX") == 0)
+		return GRA_Max;
+	else if (strcmp(algname, "MIN") == 0)
+		return GRA_Min;
 	return GRA_NearestNeighbour;
 }
 
diff --git a/raster/test/regress/rt_gdalwarp.sql b/raster/test/regress/rt_gdalwarp.sql
index 1950b3ae3..b8b7eeed2 100644
--- a/raster/test/regress/rt_gdalwarp.sql
+++ b/raster/test/regress/rt_gdalwarp.sql
@@ -434,7 +434,23 @@ INSERT INTO raster_gdalwarp_dst (rid, rast) VALUES (
 		NULL::raster,
 		FALSE
 	) FROM raster_gdalwarp_src)
-);
+), (
+	1.26, (SELECT ST_Resample(
+		rast,
+		500., 500.,
+		NULL, NULL,
+		0, 0,
+		'Max', 0
+	) FROM raster_gdalwarp_src)
+), (
+	1.27, (SELECT ST_Resample(
+		rast,
+		500., 500.,
+		NULL, NULL,
+		0, 0,
+		'Min', 0
+	) FROM raster_gdalwarp_src)
+), ;
 
 -- ST_Transform
 INSERT INTO raster_gdalwarp_dst (rid, rast) VALUES (
@@ -547,6 +563,18 @@ INSERT INTO raster_gdalwarp_dst (rid, rast) VALUES (
 		150, 125,
 		'Cubic'
 	) FROM raster_gdalwarp_src)
+), (
+	3.7, (SELECT ST_Rescale(
+		rast,
+		150, 125,
+		'Max', 0
+	) FROM raster_gdalwarp_src)
+), (
+	3.8, (SELECT ST_Rescale(
+		rast,
+		150, 125,
+		'Min', 0
+	) FROM raster_gdalwarp_src)
 );
 
 -- ST_Reskew

-----------------------------------------------------------------------

Summary of changes:
 NEWS                                     |  1 +
 doc/introduction.xml                     |  1 +
 doc/reference_raster.xml                 | 34 ++++++++++++++++++++++++++------
 raster/rt_core/rt_util.c                 |  5 ++++-
 raster/test/regress/rt_gdalwarp.sql      | 30 +++++++++++++++++++++++++++-
 raster/test/regress/rt_gdalwarp_expected |  4 ++++
 6 files changed, 67 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list