[postgis-tickets] [SCM] PostGIS branch main updated. 3.1.0rc1-396-gb4f0bee

git at osgeo.org git at osgeo.org
Wed Aug 11 08:32:57 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, main has been updated
       via  b4f0beefdc3bcd2ed555ce9da6f096655e875ec3 (commit)
      from  ab07f273d3f65fab1ff7f0c885b99d94b50d671e (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 b4f0beefdc3bcd2ed555ce9da6f096655e875ec3
Author: Sandro Santilli <strk at kbt.io>
Date:   Wed Aug 11 16:39:01 2021 +0200

    Drop redundant getPoint2d_p_ro function
    
    Closes #4965

diff --git a/liblwgeom/gserialized.c b/liblwgeom/gserialized.c
index bed0386..1a66023 100644
--- a/liblwgeom/gserialized.c
+++ b/liblwgeom/gserialized.c
@@ -234,7 +234,7 @@ size_t gserialized_from_lwgeom_size(const LWGEOM *geom)
 
 /**
 * Allocate a new #LWGEOM from a #GSERIALIZED. The resulting #LWGEOM will have coordinates
-* that are double aligned and suitable for direct reading using getPoint2d_p_ro
+* that are double aligned and suitable for direct reading using getPoint2d_cp
 */
 LWGEOM* lwgeom_from_gserialized(const GSERIALIZED *g)
 {
diff --git a/liblwgeom/gserialized.h b/liblwgeom/gserialized.h
index 5ec53f7..6ca6e4f 100644
--- a/liblwgeom/gserialized.h
+++ b/liblwgeom/gserialized.h
@@ -149,7 +149,7 @@ size_t gserialized_from_lwgeom_size(const LWGEOM *geom);
 
 /**
 * Allocate a new #LWGEOM from a #GSERIALIZED. The resulting #LWGEOM will have coordinates
-* that are double aligned and suitable for direct reading using getPoint2d_p_ro
+* that are double aligned and suitable for direct reading using getPoint2d_cp
 */
 LWGEOM *lwgeom_from_gserialized(const GSERIALIZED *g);
 
diff --git a/liblwgeom/gserialized1.h b/liblwgeom/gserialized1.h
index 9506c57..e84b975 100644
--- a/liblwgeom/gserialized1.h
+++ b/liblwgeom/gserialized1.h
@@ -149,7 +149,7 @@ size_t gserialized1_from_lwgeom_size(const LWGEOM *geom);
 
 /**
 * Allocate a new #LWGEOM from a #GSERIALIZED. The resulting #LWGEOM will have coordinates
-* that are double aligned and suitable for direct reading using getPoint2d_p_ro
+* that are double aligned and suitable for direct reading using getPoint2d_cp
 */
 LWGEOM* lwgeom_from_gserialized1(const GSERIALIZED *g);
 
@@ -160,4 +160,4 @@ const float * gserialized1_get_float_box_p(const GSERIALIZED *g, size_t *ndims);
 
 int gserialized1_peek_gbox_p(const GSERIALIZED *g, GBOX *gbox);
 
-int gserialized1_peek_first_point(const GSERIALIZED *g, POINT4D *out_point);
\ No newline at end of file
+int gserialized1_peek_first_point(const GSERIALIZED *g, POINT4D *out_point);
diff --git a/liblwgeom/gserialized2.h b/liblwgeom/gserialized2.h
index c80a739..c703722 100644
--- a/liblwgeom/gserialized2.h
+++ b/liblwgeom/gserialized2.h
@@ -161,7 +161,7 @@ size_t gserialized2_from_lwgeom_size(const LWGEOM *geom);
 
 /**
 * Allocate a new #LWGEOM from a #GSERIALIZED. The resulting #LWGEOM will have coordinates
-* that are double aligned and suitable for direct reading using getPoint2d_p_ro
+* that are double aligned and suitable for direct reading using getPoint2d_cp
 */
 LWGEOM* lwgeom_from_gserialized2(const GSERIALIZED *g);
 
diff --git a/liblwgeom/liblwgeom.h.in b/liblwgeom/liblwgeom.h.in
index c074d8b..bbff3a3 100644
--- a/liblwgeom/liblwgeom.h.in
+++ b/liblwgeom/liblwgeom.h.in
@@ -830,7 +830,7 @@ extern GSERIALIZED* gserialized_from_lwgeom(LWGEOM *geom, size_t *size);
 
 /**
 * Allocate a new #LWGEOM from a #GSERIALIZED. The resulting #LWGEOM will have coordinates
-* that are double aligned and suitable for direct reading using getPoint2d_p_ro
+* that are double aligned and suitable for direct reading using getPoint2d_cp
 */
 extern LWGEOM* lwgeom_from_gserialized(const GSERIALIZED *g);
 
@@ -1930,12 +1930,6 @@ extern int lwgeom_calculate_gbox_cartesian(const LWGEOM *lwgeom, GBOX *gbox);
 extern int lwgeom_calculate_gbox(const LWGEOM *lwgeom, GBOX *gbox);
 
 /**
-* New function to read doubles directly from the double* coordinate array
-* of an aligned lwgeom #POINTARRAY (built by de-serializing a #GSERIALIZED).
-*/
-extern int getPoint2d_p_ro(const POINTARRAY *pa, uint32_t n, POINT2D **point);
-
-/**
 * Calculate geodetic (x/y/z) box and add values to gbox. Return #LW_SUCCESS on success.
 */
 extern int ptarray_calculate_gbox_geodetic(const POINTARRAY *pa, GBOX *gbox);
diff --git a/liblwgeom/lwgeodetic.c b/liblwgeom/lwgeodetic.c
index 82e6c15..ea204fb 100644
--- a/liblwgeom/lwgeodetic.c
+++ b/liblwgeom/lwgeodetic.c
@@ -2873,24 +2873,6 @@ int lwline_covers_lwline(const LWLINE* lwline1, const LWLINE* lwline2)
 	return LW_TRUE;
 }
 
-/**
-* This function can only be used on LWGEOM that is built on top of
-* GSERIALIZED, otherwise alignment errors will ensue.
-*/
-int getPoint2d_p_ro(const POINTARRAY *pa, uint32_t n, POINT2D **point)
-{
-	uint8_t *pa_ptr = NULL;
-	assert(pa);
-	assert(n < pa->npoints);
-
-	pa_ptr = getPoint_internal(pa, n);
-	/* printf( "pa_ptr[0]: %g\n", *((double*)pa_ptr)); */
-	*point = (POINT2D*)pa_ptr;
-
-	return LW_SUCCESS;
-}
-
-
 int ptarray_calculate_gbox_geodetic(const POINTARRAY *pa, GBOX *gbox)
 {
 	uint32_t i;
diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c
index b58c8b2..7994d60 100644
--- a/liblwgeom/ptarray.c
+++ b/liblwgeom/ptarray.c
@@ -1332,14 +1332,14 @@ int
 ptarray_closest_vertex_2d(const POINTARRAY *pa, const POINT2D *qp, double *dist)
 {
 	uint32_t t, pn=0;
-	POINT2D *p;
+	const POINT2D *p;
 	double mindist = DBL_MAX;
 
 	/* Loop through pointarray looking for nearest segment */
 	for (t=0; t<pa->npoints; t++)
 	{
 		double dist_sqr;
-		getPoint2d_p_ro(pa, t, &p);
+		p = getPoint2d_cp(pa, t);
 		dist_sqr = distance2d_sqr_pt_pt(p, qp);
 
 		if (dist_sqr < mindist)

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

Summary of changes:
 liblwgeom/gserialized.c  |  2 +-
 liblwgeom/gserialized.h  |  2 +-
 liblwgeom/gserialized1.h |  4 ++--
 liblwgeom/gserialized2.h |  2 +-
 liblwgeom/liblwgeom.h.in |  8 +-------
 liblwgeom/lwgeodetic.c   | 18 ------------------
 liblwgeom/ptarray.c      |  4 ++--
 7 files changed, 8 insertions(+), 32 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list