[postgis-tickets] [SCM] PostGIS branch master updated. 3.2.0-508-g2fb152052

git at osgeo.org git at osgeo.org
Tue Feb 8 11:00:55 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  2fb15205263248249b1f1dd09abc117e8f67807c (commit)
      from  1052dfb9f689a8cca8ba038a00bf9377846df1cb (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 2fb15205263248249b1f1dd09abc117e8f67807c
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Feb 8 11:00:51 2022 -0800

    Make lwproj_is_latlong available in lwgeom_transform.h, references GH-659

diff --git a/libpgcommon/lwgeom_transform.c b/libpgcommon/lwgeom_transform.c
index fd2401272..3972b914c 100644
--- a/libpgcommon/lwgeom_transform.c
+++ b/libpgcommon/lwgeom_transform.c
@@ -534,7 +534,7 @@ DeleteFromPROJSRSCache(PROJSRSCache *PROJCache, uint32_t position)
 
 
 int
-GetLWPROJ(int32_t srid_from, int32_t srid_to, LWPROJ **pj)
+lwproj_lookup(int32_t srid_from, int32_t srid_to, LWPROJ **pj)
 {
 	/* get or initialize the cache for this round */
 	PROJSRSCache* proj_cache = GetPROJSRSCache();
@@ -552,8 +552,8 @@ GetLWPROJ(int32_t srid_from, int32_t srid_to, LWPROJ **pj)
 	return pj != NULL;
 }
 
-static int
-proj_pj_is_latlong(const LWPROJ *pj)
+int
+lwproj_is_latlong(const LWPROJ *pj)
 {
 #if POSTGIS_PROJ_VERSION < 61
 	return pj_is_latlong(pj->pj_from);
@@ -566,9 +566,9 @@ static int
 srid_is_latlong(int32_t srid)
 {
 	LWPROJ *pj;
-	if ( GetLWPROJ(srid, srid, &pj) == LW_FAILURE)
+	if ( lwproj_lookup(srid, srid, &pj) == LW_FAILURE)
 		return LW_FALSE;
-	return proj_pj_is_latlong(pj);
+	return lwproj_is_latlong(pj);
 }
 
 void
@@ -613,7 +613,7 @@ spheroid_init_from_srid(int32_t srid, SPHEROID *s)
 	double major_axis, minor_axis, eccentricity_squared;
 #endif
 
-	if ( GetLWPROJ(srid, srid, &pj) == LW_FAILURE)
+	if ( lwproj_lookup(srid, srid, &pj) == LW_FAILURE)
 		return LW_FAILURE;
 
 #if POSTGIS_PROJ_VERSION >= 61
diff --git a/libpgcommon/lwgeom_transform.h b/libpgcommon/lwgeom_transform.h
index db58c6431..51e71de8a 100644
--- a/libpgcommon/lwgeom_transform.h
+++ b/libpgcommon/lwgeom_transform.h
@@ -64,7 +64,8 @@ char *GetProj4String(int32_t srid);
 
 /* Prototypes */
 PROJSRSCache* GetPROJSRSCache();
-int GetLWPROJ(int32_t srid_from, int32_t srid_to, LWPROJ **pj);
+int lwproj_lookup(int32_t srid_from, int32_t srid_to, LWPROJ **pj);
+int lwproj_is_latlong(const LWPROJ *pj);
 int spheroid_init_from_srid(int32_t srid, SPHEROID *s);
 void srid_check_latlong(int32_t srid);
 srs_precision srid_axis_precision(int32_t srid, int precision);
diff --git a/postgis/lwgeom_transform.c b/postgis/lwgeom_transform.c
index 80f7b258f..758e7996c 100644
--- a/postgis/lwgeom_transform.c
+++ b/postgis/lwgeom_transform.c
@@ -74,7 +74,7 @@ Datum transform(PG_FUNCTION_ARGS)
 		PG_RETURN_POINTER(geom);
 
 	postgis_initialize_cache();
-	if ( GetLWPROJ(srid_from, srid_to, &pj) == LW_FAILURE )
+	if ( lwproj_lookup(srid_from, srid_to, &pj) == LW_FAILURE )
 	{
 		PG_FREE_IF_COPY(geom, 0);
 		elog(ERROR, "ST_Transform: Failure reading projections from spatial_ref_sys.");
@@ -211,7 +211,7 @@ Datum LWGEOM_asKML(PG_FUNCTION_ARGS)
 	if (srid_from != srid_to)
 	{
 		LWPROJ *pj;
-		if (GetLWPROJ(srid_from, srid_to, &pj) == LW_FAILURE)
+		if (lwproj_lookup(srid_from, srid_to, &pj) == LW_FAILURE)
 		{
 			PG_FREE_IF_COPY(geom, 0);
 			elog(ERROR, "ST_AsKML: Failure reading projections from spatial_ref_sys.");

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

Summary of changes:
 libpgcommon/lwgeom_transform.c | 12 ++++++------
 libpgcommon/lwgeom_transform.h |  3 ++-
 postgis/lwgeom_transform.c     |  4 ++--
 3 files changed, 10 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list