[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0alpha1-82-gd178fcf

git at osgeo.org git at osgeo.org
Mon Apr 27 14:55:11 PDT 2020


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  d178fcfa46d1e1ff7039cdd2231ae63f37b2385f (commit)
      from  7a9a69951336ba87ce1aa216badd2be3fed60818 (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 d178fcfa46d1e1ff7039cdd2231ae63f37b2385f
Author: Regina Obe <lr at pcorp.us>
Date:   Mon Apr 27 15:42:40 2020 -0400

    Correct invalid SQL and make use of aliasing and LATERAL more explicit

diff --git a/doc/reference_constructor.xml b/doc/reference_constructor.xml
index e39761e..0fe9437 100644
--- a/doc/reference_constructor.xml
+++ b/doc/reference_constructor.xml
@@ -859,13 +859,14 @@ SELECT ST_AsText( ST_TileEnvelope(3, 1, 1, ST_MakeEnvelope(-180, -90, 180, 90, 4
 		<para>To do a point summary against a hexagonal tiling, generate a hexagon grid using the
 		extent of the points as the bounds, then spatially join to that grid.</para>
 		 <programlisting>WITH bounds AS (
- 	SELECT ST_SetSRID(ST_EstimatedExtent('pointtable', 'geom'), 3857) AS geom
+ 	SELECT ST_SetSRID(ST_EstimatedExtent('pointtable', 'geom'),3857) AS geom
  )
  SELECT Count(*), hexes.geom
- FROM pointtable pts
- JOIN ST_HexagonGrid(1000, bounds.geom) hexes
- GROUP BY hexes.geom
-</programlisting>
+ FROM bounds CROSS JOIN
+ 	LATERAL ST_HexagonGrid(10000, bounds.geom) AS hexes
+ INNER JOIN  pointtable AS pts
+ 	ON ST_Intersects(pts.geom, hexes.geom)
+ GROUP BY hexes.geom;</programlisting>
 		</refsection>
 
 		<refsection>
@@ -880,13 +881,13 @@ SELECT ST_AsText( ST_TileEnvelope(3, 1, 1, ST_MakeEnvelope(-180, -90, 180, 90, 4
 			hexagons overlapping at the borders between states.</para>
 		 <programlisting>WITH hexes AS (
 	SELECT admin1.gid,
-	       (ST_HexagonGrid(100000, admin1.geom)).* AS hex
-	FROM admin1
+	      hex.geom
+	FROM admin1 CROSS JOIN ST_HexagonGrid(100000, admin1.geom) AS hex
 	WHERE adm0_a3 = 'USA'
 )
 SELECT hexes.*
 FROM hexes
-JOIN admin1 USING (gid)
+INNER JOIN admin1 ON hexes.gid = admin1.gid
 WHERE ST_Intersects(admin1.geom, hexes.geom)
 </programlisting>
 		</refsection>

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

Summary of changes:
 doc/reference_constructor.xml | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list