[postgis-tickets] [SCM] PostGIS branch master updated. d5ab9d4e27d0ccbf87e0986b9cfc780e8c6d772e

git at osgeo.org git at osgeo.org
Fri Jan 17 10:35:35 PST 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  d5ab9d4e27d0ccbf87e0986b9cfc780e8c6d772e (commit)
       via  9524ba04aeb925c8cb53d41136b8086399d60bc8 (commit)
       via  18ac14a6161abcd5377ad6f5520055ceb8299b62 (commit)
      from  4332fa3330ea651317d3c9dc3f5bd2092ba9241d (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 d5ab9d4e27d0ccbf87e0986b9cfc780e8c6d772e
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Jan 17 10:17:13 2020 -0800

    Woops remove useless reference

diff --git a/postgis/lwgeom_generate_grid.c b/postgis/lwgeom_generate_grid.c
index 769fb6a..bf84208 100644
--- a/postgis/lwgeom_generate_grid.c
+++ b/postgis/lwgeom_generate_grid.c
@@ -237,7 +237,6 @@ PG_FUNCTION_INFO_V1(ST_ShapeGrid);
 Datum ST_ShapeGrid(PG_FUNCTION_ARGS)
 {
 	FuncCallContext *funcctx;
-	MemoryContext oldcontext;
 
 	GSERIALIZED *gbounds;
 	GeometryGridState *state;
@@ -250,6 +249,7 @@ Datum ST_ShapeGrid(PG_FUNCTION_ARGS)
 
 	if (SRF_IS_FIRSTCALL())
 	{
+		MemoryContext oldcontext;
 		const char *func_name;
 		double bounds_width, bounds_height;
 		char gbounds_is_empty;
@@ -309,7 +309,6 @@ Datum ST_ShapeGrid(PG_FUNCTION_ARGS)
 
 	/* stuff done on every call of the function */
 	funcctx = SRF_PERCALL_SETUP();
-	newcontext = funcctx->multi_call_memory_ctx;
 
 	/* get state */
 	state = funcctx->user_fctx;

commit 9524ba04aeb925c8cb53d41136b8086399d60bc8
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Jan 17 10:03:02 2020 -0800

    Remove unused var

diff --git a/postgis/lwgeom_generate_grid.c b/postgis/lwgeom_generate_grid.c
index 664a5ff..769fb6a 100644
--- a/postgis/lwgeom_generate_grid.c
+++ b/postgis/lwgeom_generate_grid.c
@@ -237,7 +237,7 @@ PG_FUNCTION_INFO_V1(ST_ShapeGrid);
 Datum ST_ShapeGrid(PG_FUNCTION_ARGS)
 {
 	FuncCallContext *funcctx;
-	MemoryContext oldcontext, newcontext;
+	MemoryContext oldcontext;
 
 	GSERIALIZED *gbounds;
 	GeometryGridState *state;

commit 18ac14a6161abcd5377ad6f5520055ceb8299b62
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Jan 17 09:43:24 2020 -0800

    Apply comments from @Algunenano

diff --git a/NEWS b/NEWS
index a450ccf..3af0b21 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,8 @@ PostGIS 3.1.0
   - #2972, Add quiet mode (-q) to pgsql2shp (Kristian Thy)
   - #4617, Add configure switch `--without-phony-revision` (Raúl Marín)
   - #3057, Optional value params for Force3D*, Force4D functions (Kristian Thy)
+  - ST_HexagonGrid and ST_SquareGrid, set returning funcitons to
+    generate tilings of the plane (Paul Ramsey)
 
 * Enhancements *
   - #4539, Unify libm includes (Raúl Marín)
diff --git a/postgis/lwgeom_generate_grid.c b/postgis/lwgeom_generate_grid.c
index d59c7ec..664a5ff 100644
--- a/postgis/lwgeom_generate_grid.c
+++ b/postgis/lwgeom_generate_grid.c
@@ -18,7 +18,7 @@
  *
  **********************************************************************
  *
- * Copyright 2018 Paul Ramsey <pramsey at cleverelephant.ca>
+ * Copyright 2020 Paul Ramsey <pramsey at cleverelephant.ca>
  *
  **********************************************************************/
 
@@ -71,7 +71,7 @@ static const double hex_x[] = {-1.0, -0.5,  0.5, 1.0, 0.5, -0.5, -1.0};
 static const double hex_y[] = { 0.0, -1*H, -1*H, 0.0,   H,    H,  0.0};
 
 static LWGEOM *
-hexagon(double origin_x, double origin_y, double size, int cell_i, int cell_j, uint32_t srid)
+hexagon(double origin_x, double origin_y, double size, int cell_i, int cell_j, int32_t srid)
 {
 	double height = size * 2 * H;
 	POINT4D pt;
@@ -145,10 +145,10 @@ hexagon_grid_state(double size, const GBOX *gbox, int32_t srid)
 	return state;
 }
 
-static bool
+static void
 hexagon_state_next(HexagonGridState *state)
 {
-	if (!state || state->done) return false;
+	if (!state || state->done) return;
 	/* Move up one row */
 	state->j++;
 	/* Off the end, increment column counter, reset row counter back to (appropriate) minimum */
@@ -162,13 +162,12 @@ hexagon_state_next(HexagonGridState *state)
 	{
 		state->done = true;
 	}
-	return !state->done;
 }
 
 /* ********* ********* ********* ********* ********* ********* ********* ********* */
 
 static LWGEOM *
-square(double origin_x, double origin_y, double size, int cell_i, int cell_j, uint32_t srid)
+square(double origin_x, double origin_y, double size, int cell_i, int cell_j, int32_t srid)
 {
 	double ll_x = origin_x + (size * cell_i);
 	double ll_y = origin_y + (size * cell_j);
@@ -211,10 +210,10 @@ square_grid_state(double size, const GBOX *gbox, int32_t srid)
 	return state;
 }
 
-static bool
+static void
 square_state_next(SquareGridState *state)
 {
-	if (!state || state->done) return false;
+	if (!state || state->done) return;
 	/* Move up one row */
 	state->j++;
 	/* Off the end, increment column counter, reset row counter back to (appropriate) minimum */
@@ -228,7 +227,6 @@ square_state_next(SquareGridState *state)
 	{
 		state->done = true;
 	}
-	return !state->done;
 }
 
 /**
@@ -275,8 +273,7 @@ Datum ST_ShapeGrid(PG_FUNCTION_ARGS)
 			SRF_RETURN_DONE(funcctx);
 		}
 
-		newcontext = funcctx->multi_call_memory_ctx;
-		oldcontext = MemoryContextSwitchTo(newcontext);
+		oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
 
 		/*
 		* Support both hexagon and square grids with one function,

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

Summary of changes:
 NEWS                           |  2 ++
 postgis/lwgeom_generate_grid.c | 22 +++++++++-------------
 2 files changed, 11 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list