[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0rc1-427-g1045eed

git at osgeo.org git at osgeo.org
Tue Aug 24 15:18:44 PDT 2021


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  1045eede8bf6c781707e5aa25bff3b16b789a086 (commit)
       via  69e306df5465800413add86fea468616756465cf (commit)
       via  a8d1c64361be56418ad943281887624a764165ae (commit)
       via  17689f96bb6cf582483c4c6993a995a394217fb8 (commit)
       via  496b4c71447d921f0fe51a8aa699dba1362a642e (commit)
       via  5548ad23a9167afe69b1357471ff514e23a0094b (commit)
      from  9e6156d123aac9ce7327408bc2f9fd91f79ea82c (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 1045eede8bf6c781707e5aa25bff3b16b789a086
Merge: 69e306d a8d1c64
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Aug 24 15:18:38 2021 -0700

    Merge branch 'master-4859'


commit 69e306df5465800413add86fea468616756465cf
Merge: 17689f9 9e6156d
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Aug 24 15:18:29 2021 -0700

    Merge branch 'master' of https://git.osgeo.org/gitea/postgis/postgis


commit a8d1c64361be56418ad943281887624a764165ae
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Aug 24 14:46:47 2021 -0700

    ST_Point, ST_PointZ, ST_PointM, ST_PointZM, constructors with SRID parameter, references #4859

diff --git a/NEWS b/NEWS
index e9eafe3..13dbfc9 100644
--- a/NEWS
+++ b/NEWS
@@ -65,6 +65,8 @@ PostGIS 3.2.0
   - New postgis.gdal_vsi_options GUC allows out-db rasters on VSI network
     services to be accessed with authentication keys, etc. (Paul Ramsey)
   - ST_DumpSegments returns a set of segments of input geometry (Aliaksandr Kalenik)
+  - #4859, ST_Point, ST_PointZ, ST_PointM, ST_PointZM, constructors 
+    with SRID parameter (Paul Ramsey)
 
 
 PostGIS 3.1.0
diff --git a/doc/reference_constructor.xml b/doc/reference_constructor.xml
index 8d80ee0..8827d4e 100644
--- a/doc/reference_constructor.xml
+++ b/doc/reference_constructor.xml
@@ -655,6 +655,14 @@ FROM provinces p;
 			<paramdef><type>float</type> <parameter>y</parameter></paramdef>
 		  </funcprototype>
 		</funcsynopsis>
+        <funcsynopsis>
+          <funcprototype>
+            <funcdef>geometry <function>ST_Point</function></funcdef>
+            <paramdef><type>float</type> <parameter>x</parameter></paramdef>
+            <paramdef><type>float</type> <parameter>y</parameter></paramdef>
+            <paramdef><type>integer</type> <parameter>srid=unknown</parameter></paramdef>
+          </funcprototype>
+        </funcsynopsis>
 	  </refsynopsisdiv>
 
 	  <refsection>
@@ -696,14 +704,124 @@ SELECT ST_Transform(ST_SetSRID( ST_Point( 3637510, 3014852 ), 2273), 4326)::geog
 	  <refsection>
 		<title>See Also</title>
 
-		<para><xref linkend="Geography_Basics" />, <xref linkend="ST_MakePoint" />, <xref linkend="ST_SetSRID" />, <xref linkend="ST_Transform" /></para>
+		<para><xref linkend="Geography_Basics" />, <xref linkend="ST_MakePoint" />, <xref linkend="ST_SetSRID" />, <xref linkend="ST_Transform" />, <xref linkend="ST_PointZ" />, <xref linkend="ST_PointM" />, <xref linkend="ST_PointZM" /></para>
 	  </refsection>
 	</refentry>
 
+
+    <refentry id="ST_PointZ">
+      <refnamediv>
+        <refname>ST_PointZ</refname>
+        <refpurpose>Creates a Point with the given coordinate and SRID values.</refpurpose>
+      </refnamediv>
+
+      <refsynopsisdiv>
+        <funcsynopsis>
+          <funcprototype>
+            <funcdef>geometry <function>ST_PointZ</function></funcdef>
+            <paramdef><type>float</type> <parameter>x</parameter></paramdef>
+            <paramdef><type>float</type> <parameter>y</parameter></paramdef>
+            <paramdef><type>float</type> <parameter>z</parameter></paramdef>
+            <paramdef choice="opt"><type>integer</type> <parameter>srid=unknown</parameter></paramdef>
+          </funcprototype>
+        </funcsynopsis>
+      </refsynopsisdiv>
+
+      <refsection>
+        <title>Description</title>
+        <para>Returns an Point with the given X, Y and Z coordinate values, and optionally an SRID number.</para>
+      </refsection>
+
+      <refsection>
+        <title>Examples</title>
+        <programlisting>SELECT ST_PointZ(-71.104, 42.315, 3.4, 4326)</programlisting>
+        <programlisting>SELECT ST_PointZ(-71.104, 42.315, 3.4, srid => 4326)</programlisting>
+        <programlisting>SELECT ST_PointZ(-71.104, 42.315, 3.4)</programlisting>
+      </refsection>
+
+      <refsection>
+        <title>See Also</title>
+        <para><xref linkend="ST_MakePoint" />, <xref linkend="ST_Point" />, <xref linkend="ST_PointM" />, <xref linkend="ST_PointZM" /></para>
+      </refsection>
+    </refentry>
+
+    <refentry id="ST_PointM">
+      <refnamediv>
+        <refname>ST_PointM</refname>
+        <refpurpose>Creates a Point with the given coordinate and SRID values.</refpurpose>
+      </refnamediv>
+
+      <refsynopsisdiv>
+        <funcsynopsis>
+          <funcprototype>
+            <funcdef>geometry <function>ST_PointZ</function></funcdef>
+            <paramdef><type>float</type> <parameter>x</parameter></paramdef>
+            <paramdef><type>float</type> <parameter>y</parameter></paramdef>
+            <paramdef><type>float</type> <parameter>m</parameter></paramdef>
+            <paramdef choice="opt"><type>integer</type> <parameter>srid=unknown</parameter></paramdef>
+          </funcprototype>
+        </funcsynopsis>
+      </refsynopsisdiv>
+
+      <refsection>
+        <title>Description</title>
+        <para>Returns an Point with the given X, Y and M coordinate values, and optionally an SRID number.</para>
+      </refsection>
+
+      <refsection>
+        <title>Examples</title>
+        <programlisting>SELECT ST_PointM(-71.104, 42.315, 3.4, 4326)</programlisting>
+        <programlisting>SELECT ST_PointM(-71.104, 42.315, 3.4, srid => 4326)</programlisting>
+        <programlisting>SELECT ST_PointM(-71.104, 42.315, 3.4)</programlisting>
+      </refsection>
+
+      <refsection>
+        <title>See Also</title>
+        <para><xref linkend="ST_MakePoint" />, <xref linkend="ST_Point" />, <xref linkend="ST_PointZ" />, <xref linkend="ST_PointZM" /></para>
+      </refsection>
+    </refentry>
+
+
+    <refentry id="ST_PointZM">
+      <refnamediv>
+        <refname>ST_PointZM</refname>
+        <refpurpose>Creates a Point with the given coordinate and SRID values.</refpurpose>
+      </refnamediv>
+
+      <refsynopsisdiv>
+        <funcsynopsis>
+          <funcprototype>
+            <funcdef>geometry <function>ST_PointZM</function></funcdef>
+            <paramdef><type>float</type> <parameter>x</parameter></paramdef>
+            <paramdef><type>float</type> <parameter>y</parameter></paramdef>
+            <paramdef><type>float</type> <parameter>z</parameter></paramdef>
+            <paramdef><type>float</type> <parameter>m</parameter></paramdef>
+            <paramdef choice="opt"><type>integer</type> <parameter>srid=unknown</parameter></paramdef>
+          </funcprototype>
+        </funcsynopsis>
+      </refsynopsisdiv>
+
+      <refsection>
+        <title>Description</title>
+        <para>Returns an Point with the given X, Y, Z and M coordinate values, and optionally an SRID number.</para>
+      </refsection>
+
+      <refsection>
+        <title>Examples</title>
+        <programlisting>SELECT ST_PointZM(-71.104, 42.315, 3.4, 4.5, 4326)</programlisting>
+        <programlisting>SELECT ST_PointZM(-71.104, 42.315, 3.4, 4.5, srid => 4326)</programlisting>
+        <programlisting>SELECT ST_PointZM(-71.104, 42.315, 3.4, 4.5)</programlisting>
+      </refsection>
+
+      <refsection>
+        <title>See Also</title>
+        <para><xref linkend="ST_MakePoint" />, <xref linkend="ST_Point" />, <xref linkend="ST_PointM" />, <xref linkend="ST_PointZ" /></para>
+      </refsection>
+    </refentry>
+
 	<refentry id="ST_Polygon">
 	  <refnamediv>
 		<refname>ST_Polygon</refname>
-
 		<refpurpose>Creates a Polygon from a LineString with a specified SRID.</refpurpose>
 	  </refnamediv>
 
diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c
index 186d1a1..f6ef9ad 100644
--- a/postgis/lwgeom_functions_basic.c
+++ b/postgis/lwgeom_functions_basic.c
@@ -119,6 +119,10 @@ Datum ST_QuantizeCoordinates(PG_FUNCTION_ARGS);
 Datum ST_WrapX(PG_FUNCTION_ARGS);
 Datum ST_Scroll(PG_FUNCTION_ARGS);
 Datum LWGEOM_FilterByM(PG_FUNCTION_ARGS);
+Datum ST_Point(PG_FUNCTION_ARGS);
+Datum ST_PointZ(PG_FUNCTION_ARGS);
+Datum ST_PointM(PG_FUNCTION_ARGS);
+Datum ST_PointZM(PG_FUNCTION_ARGS);
 
 /*------------------------------------------------------------------*/
 
@@ -2223,6 +2227,55 @@ Datum LWGEOM_makepoint(PG_FUNCTION_ARGS)
 	PG_RETURN_POINTER(result);
 }
 
+PG_FUNCTION_INFO_V1(ST_Point);
+Datum ST_Point(PG_FUNCTION_ARGS)
+{
+	double x = PG_GETARG_FLOAT8(0);
+	double y = PG_GETARG_FLOAT8(1);
+	int srid = PG_GETARG_INT32(2);
+	LWPOINT *point = lwpoint_make2d(srid, x, y);
+	GSERIALIZED *result = geometry_serialize((LWGEOM *)point);
+	PG_RETURN_POINTER(result);
+}
+
+PG_FUNCTION_INFO_V1(ST_PointZ);
+Datum ST_PointZ(PG_FUNCTION_ARGS)
+{
+	double x = PG_GETARG_FLOAT8(0);
+	double y = PG_GETARG_FLOAT8(1);
+	double z = PG_GETARG_FLOAT8(2);
+	int srid = PG_GETARG_INT32(3);
+	LWPOINT *point = lwpoint_make3dz(srid, x, y, z);
+	GSERIALIZED *result = geometry_serialize((LWGEOM *)point);
+	PG_RETURN_POINTER(result);
+}
+
+PG_FUNCTION_INFO_V1(ST_PointM);
+Datum ST_PointM(PG_FUNCTION_ARGS)
+{
+	double x = PG_GETARG_FLOAT8(0);
+	double y = PG_GETARG_FLOAT8(1);
+	double m = PG_GETARG_FLOAT8(2);
+	int srid = PG_GETARG_INT32(3);
+	LWPOINT *point = lwpoint_make3dm(srid, x, y, m);
+	GSERIALIZED *result = geometry_serialize((LWGEOM *)point);
+	PG_RETURN_POINTER(result);
+}
+
+PG_FUNCTION_INFO_V1(ST_PointZM);
+Datum ST_PointZM(PG_FUNCTION_ARGS)
+{
+	double x = PG_GETARG_FLOAT8(0);
+	double y = PG_GETARG_FLOAT8(1);
+	double z = PG_GETARG_FLOAT8(2);
+	double m = PG_GETARG_FLOAT8(3);
+	int srid = PG_GETARG_INT32(4);
+	LWPOINT *point = lwpoint_make4d(srid, x, y, z, m);
+	GSERIALIZED *result = geometry_serialize((LWGEOM *)point);
+	PG_RETURN_POINTER(result);
+}
+
+
 PG_FUNCTION_INFO_V1(LWGEOM_makepoint3dm);
 Datum LWGEOM_makepoint3dm(PG_FUNCTION_ARGS)
 {
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index 5fb2874..7e88dd7 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -6154,6 +6154,34 @@ CREATE OR REPLACE FUNCTION ST_Point(float8, float8)
 	LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE
 	_COST_LOW;
 
+-- Availability: 3.2.0
+CREATE OR REPLACE FUNCTION ST_Point(float8, float8, srid integer)
+	RETURNS geometry
+	AS 'MODULE_PATHNAME', 'ST_Point'
+	LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE
+	_COST_LOW;
+
+-- Availability: 3.2.0
+CREATE OR REPLACE FUNCTION ST_PointZ(XCoordinate float8, YCoordinate float8, ZCoordinate float8, srid integer DEFAULT 0)
+	RETURNS geometry
+	AS 'MODULE_PATHNAME', 'ST_PointZ'
+	LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE
+	_COST_LOW;
+
+-- Availability: 3.2.0
+CREATE OR REPLACE FUNCTION ST_PointM(XCoordinate float8, YCoordinate float8, MCoordinate float8, srid integer DEFAULT 0)
+	RETURNS geometry
+	AS 'MODULE_PATHNAME', 'ST_PointM'
+	LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE
+	_COST_LOW;
+
+-- Availability: 3.2.0
+CREATE OR REPLACE FUNCTION ST_PointZM(XCoordinate float8, YCoordinate float8, ZCoordinate float8, MCoordinate float8, srid integer DEFAULT 0)
+	RETURNS geometry
+	AS 'MODULE_PATHNAME', 'ST_PointZM'
+	LANGUAGE 'c' IMMUTABLE STRICT PARALLEL SAFE
+	_COST_LOW;
+
 -- PostGIS equivalent function: ST_MakePolygon(Geometry geometry)
 CREATE OR REPLACE FUNCTION ST_Polygon(geometry, int)
 	RETURNS geometry
diff --git a/regress/core/sql-mm-general.sql b/regress/core/sql-mm-general.sql
index 1f898ea..b648e37 100644
--- a/regress/core/sql-mm-general.sql
+++ b/regress/core/sql-mm-general.sql
@@ -86,3 +86,12 @@ SELECT ST_AsEWKT(ST_LineToCurve('LINESTRING(
 		-13151496.921063 3913666.61175287,
 		-13151521.3839744 3913666.61175287,
 		-13151591.4368571 3913665.36595828)'));
+
+SELECT 'pt1', ST_AsEWKT(ST_Point(1.0, 2.0));
+SELECT 'pt2', ST_AsEWKT(ST_Point(1.0, 2.0, 3));
+SELECT 'pt3', ST_AsEWKT(ST_PointZ(1.0, 2.0, 3.0));
+SELECT 'pt4', ST_AsEWKT(ST_PointZ(1.0, 2.0, 3.0, 4));
+SELECT 'pt5', ST_AsEWKT(ST_PointM(1.0, 2.0, 3.0));
+SELECT 'pt6', ST_AsEWKT(ST_PointM(1.0, 2.0, 3.0, 4));
+SELECT 'pt7', ST_AsEWKT(ST_PointZM(1.0, 2.0, 3.0, 4.0));
+SELECT 'pt8', ST_AsEWKT(ST_PointZM(1.0, 2.0, 3.0, 4.0, 5));
diff --git a/regress/core/sql-mm-general_expected b/regress/core/sql-mm-general_expected
index 58044c3..0b1a281 100644
--- a/regress/core/sql-mm-general_expected
+++ b/regress/core/sql-mm-general_expected
@@ -14,3 +14,11 @@ arc11|f
 arc12|f
 arc13|t
 LINESTRING(-13151357.927248 3913656.64539871,-13151419.0845266 3913664.12016378,-13151441.323537 3913666.61175286,-13151456.8908442 3913666.61175286,-13151476.9059536 3913666.61175286,-13151496.921063 3913666.61175287,-13151521.3839744 3913666.61175287,-13151591.4368571 3913665.36595828)
+pt1|POINT(1 2)
+pt2|SRID=3;POINT(1 2)
+pt3|POINT(1 2 3)
+pt4|SRID=4;POINT(1 2 3)
+pt5|POINTM(1 2 3)
+pt6|SRID=4;POINTM(1 2 3)
+pt7|POINT(1 2 3 4)
+pt8|SRID=5;POINT(1 2 3 4)

commit 17689f96bb6cf582483c4c6993a995a394217fb8
Merge: 496b4c7 7a4f76d
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Mon Aug 23 09:35:30 2021 -0700

    Merge branch 'master' of https://git.osgeo.org/gitea/postgis/postgis


commit 496b4c71447d921f0fe51a8aa699dba1362a642e
Merge: 178a530 5548ad2
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Aug 20 14:50:13 2021 -0700

    Merge branch 'main-aggcrash'


commit 5548ad23a9167afe69b1357471ff514e23a0094b
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Aug 20 14:02:03 2021 -0700

    Repair crashes in raster aggregates, references #4916, #4770, #4724, #4916

diff --git a/postgis/lwgeom_out_geobuf.c b/postgis/lwgeom_out_geobuf.c
index 3948f4a..609430b 100644
--- a/postgis/lwgeom_out_geobuf.c
+++ b/postgis/lwgeom_out_geobuf.c
@@ -49,7 +49,7 @@ Datum pgis_asgeobuf_transfn(PG_FUNCTION_ARGS)
 	elog(ERROR, "ST_AsGeobuf: Compiled without protobuf-c support");
 	PG_RETURN_NULL();
 #else
-	MemoryContext aggcontext;
+	MemoryContext aggcontext, oldcontext;
 	struct geobuf_agg_context *ctx;
 
 	/* We need to initialize the internal cache to access it later via postgis_oid() */
@@ -57,7 +57,7 @@ Datum pgis_asgeobuf_transfn(PG_FUNCTION_ARGS)
 
 	if (!AggCheckCallContext(fcinfo, &aggcontext))
 		elog(ERROR, "pgis_asgeobuf_transfn: called in non-aggregate context");
-	MemoryContextSwitchTo(aggcontext);
+	oldcontext = MemoryContextSwitchTo(aggcontext);
 
 	if (PG_ARGISNULL(0)) {
 		ctx = palloc(sizeof(*ctx));
@@ -72,9 +72,16 @@ Datum pgis_asgeobuf_transfn(PG_FUNCTION_ARGS)
 
 	if (!type_is_rowtype(get_fn_expr_argtype(fcinfo->flinfo, 1)))
 		elog(ERROR, "pgis_asgeobuf_transfn: parameter row cannot be other than a rowtype");
+
+	/* Null input tuple => null result */
+	if (PG_ARGISNULL(1)) {
+		PG_RETURN_NULL();
+	}
+
 	ctx->row = PG_GETARG_HEAPTUPLEHEADER(1);
 
 	geobuf_agg_transfn(ctx);
+	MemoryContextSwitchTo(oldcontext);
 	PG_RETURN_POINTER(ctx);
 #endif
 }
diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c
index be183b8..8a4f162 100644
--- a/raster/rt_pg/rtpg_mapalgebra.c
+++ b/raster/rt_pg/rtpg_mapalgebra.c
@@ -2163,7 +2163,7 @@ Datum RASTER_union_transfn(PG_FUNCTION_ARGS)
 	if (PG_ARGISNULL(0)) {
 		POSTGIS_RT_DEBUG(3, "Creating state variable");
 		/* allocate container in aggcontext */
-		iwr = palloc(sizeof(struct rtpg_union_arg_t));
+		iwr = MemoryContextAlloc(aggcontext, sizeof(struct rtpg_union_arg_t));
 		if (iwr == NULL) {
 			MemoryContextSwitchTo(oldcontext);
 			elog(ERROR, "RASTER_union_transfn: Could not allocate memory for state variable");
@@ -2932,8 +2932,12 @@ Datum RASTER_union_finalfn(PG_FUNCTION_ARGS)
 	}
 
 	/* cleanup */
-	pfree(itrset);
-	rtpg_union_arg_destroy(iwr);
+	/* For Windowing functions, it is important to leave */
+	/* the state intact, knowing that the aggcontext will be */
+	/* freed by PgSQL when the statement is complete. */
+	/* https://trac.osgeo.org/postgis/ticket/4770 */
+	// pfree(itrset);
+	// rtpg_union_arg_destroy(iwr);
 
 	if (!_rtn) PG_RETURN_NULL();
 
diff --git a/raster/rt_pg/rtpg_statistics.c b/raster/rt_pg/rtpg_statistics.c
index 649d7f7..4db8f72 100644
--- a/raster/rt_pg/rtpg_statistics.c
+++ b/raster/rt_pg/rtpg_statistics.c
@@ -900,7 +900,11 @@ Datum RASTER_summaryStats_finalfn(PG_FUNCTION_ARGS)
 	result = HeapTupleGetDatum(tuple);
 
 	/* clean up */
-	rtpg_summarystats_arg_destroy(state);
+	/* For Windowing functions, it is important to leave */
+	/* the state intact, knowing that the aggcontext will be */
+	/* freed by PgSQL when the statement is complete. */
+	/* https://trac.osgeo.org/postgis/ticket/4770 */
+	// rtpg_summarystats_arg_destroy(state);
 
 	PG_RETURN_DATUM(result);
 }
diff --git a/raster/test/regress/tickets.sql b/raster/test/regress/tickets.sql
index 711a7ad..a227171 100644
--- a/raster/test/regress/tickets.sql
+++ b/raster/test/regress/tickets.sql
@@ -144,4 +144,19 @@ SELECT '#4547.2', AddRasterConstraints('ticket_4547', 'r');
 DROP TABLE ticket_4547;
 
 -- #4769
-SELECT '#4769', st_addband(NULL, NULL::_raster, 1, 1);
\ No newline at end of file
+SELECT '#4769', st_addband(NULL, NULL::_raster, 1, 1);
+
+SELECT '#4770.a',
+ ST_Union(NULL::raster) OVER (ORDER BY b)
+FROM (VALUES ('A0006', 300), ('A0006', 302)) t(a,b);
+
+SELECT '#4770.b',
+ ST_Union(NULL::raster) OVER (PARTITION BY a ORDER BY b)
+FROM (VALUES ('A0006', 300),
+	         ('A0006', 302)) t(a, b);
+
+SELECT '#4724.a', ST_SummaryStatsAgg(NULL::raster, NULL::int4, NULL::bool)
+ OVER (ORDER BY q) FROM generate_series(1,2) AS e(q);
+
+SELECT '#4724.b', ST_SummaryStatsAgg(NULL::raster, NULL::int4, NULL::bool)
+ FROM generate_series(1,2) AS e(q);
diff --git a/raster/test/regress/tickets_expected b/raster/test/regress/tickets_expected
index ae1f56b..46e1297 100644
--- a/raster/test/regress/tickets_expected
+++ b/raster/test/regress/tickets_expected
@@ -70,3 +70,10 @@ NOTICE:  Adding out-of-database constraint
 NOTICE:  Adding maximum extent constraint
 #4547.2|t
 #4769|
+#4770.a|
+#4770.a|
+#4770.b|
+#4770.b|
+#4724.a|(0,,,,,)
+#4724.a|(0,,,,,)
+#4724.b|(0,,,,,)
diff --git a/regress/core/tickets.sql b/regress/core/tickets.sql
index ff61797..cc897fd 100644
--- a/regress/core/tickets.sql
+++ b/regress/core/tickets.sql
@@ -1390,3 +1390,42 @@ SELECT '#4949', 'Arctic Stereographic forward', ST_AsEWKT(ST_SnapToGrid(ST_Trans
 SELECT '#4949', 'Antarctic Stereographic forward', ST_AsEWKT(ST_SnapToGrid(ST_Transform(
   'SRID=4326;POINT(-36.75 -54.25)'::geometry, 3031),0.1));
 
+
+-- #4916, #4770, #4724, #4916, #4940
+
+
+SELECT '#4770.a',
+ ST_Union(NULL::geometry) OVER (ORDER BY b)
+FROM (VALUES ('A0006', 300),
+	         ('A0006', 302)) t(a, b);
+
+WITH w AS (
+  SELECT
+    ST_Union(g) OVER (PARTITION BY b ORDER BY a) AS g,
+    Sum(b) OVER (PARTITION BY b ORDER BY a) AS s
+  FROM (VALUES ('POINT(0 0)'::geometry, 'A0006', 300),
+  	           ('POINT(1 1)'::geometry, 'A0006', 302)) t(g, a, b)
+)
+SELECT '#4770.b', ST_AsText(g), s FROM w;
+
+WITH w AS (
+  SELECT
+    ST_Union(g) OVER (PARTITION BY a ORDER BY b) AS g,
+    Sum(b) OVER (PARTITION BY a ORDER BY b) AS s
+  FROM (VALUES ('POINT(0 0)'::geometry, 'A0006', 300),
+  	           ('POINT(1 1)'::geometry, 'A0006', 302)) t(g, a, b)
+)
+SELECT '#4770.c', ST_AsText(g), s FROM w;
+
+SELECT '#4916.a', ST_AsGeobuf(NULL::pg_class, 'g') over (order by b)
+FROM (VALUES ('POINT(0 0)'::geometry, 'A0006', 300),
+	         ('POINT(1 1)'::geometry, 'A0006', 302)) t(g, a, b);
+
+SELECT '#4916.b', ST_AsGeobuf(NULL::pg_class) over (order by b)
+FROM (VALUES ('POINT(0 0)'::geometry, 'A0006', 300),
+	         ('POINT(1 1)'::geometry, 'A0006', 302)) t(g, a, b);
+
+------
+
+
+
diff --git a/regress/core/tickets_expected b/regress/core/tickets_expected
index b48ecff..454d49a 100644
--- a/regress/core/tickets_expected
+++ b/regress/core/tickets_expected
@@ -452,3 +452,13 @@ ERROR:  LWGEOM_addpoint: Invalid offset
 #4949|North Pole LAEA inverse|SRID=4326;POINT(19.4921659 69.7902258)
 #4949|Arctic Stereographic forward|SRID=3413;POINT(2218082.1 -1409150)
 #4949|Antarctic Stereographic forward|SRID=3031;POINT(-2399498.7 3213318.5)
+#4770.a|
+#4770.a|
+#4770.b|POINT(0 0)|300
+#4770.b|POINT(1 1)|302
+#4770.c|POINT(0 0)|300
+#4770.c|MULTIPOINT(0 0,1 1)|602
+#4916.a|
+#4916.a|
+#4916.b|
+#4916.b|

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

Summary of changes:
 NEWS                                 |   2 +
 doc/reference_constructor.xml        | 122 ++++++++++++++++++++++++++++++++++-
 postgis/lwgeom_functions_basic.c     |  53 +++++++++++++++
 postgis/lwgeom_out_geobuf.c          |  11 +++-
 postgis/postgis.sql.in               |  28 ++++++++
 raster/rt_pg/rtpg_mapalgebra.c       |  10 ++-
 raster/rt_pg/rtpg_statistics.c       |   6 +-
 raster/test/regress/tickets.sql      |  17 ++++-
 raster/test/regress/tickets_expected |   7 ++
 regress/core/sql-mm-general.sql      |   9 +++
 regress/core/sql-mm-general_expected |   8 +++
 regress/core/tickets.sql             |  39 +++++++++++
 regress/core/tickets_expected        |  10 +++
 13 files changed, 313 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list