[GRASS-SVN] r72520 - grass/trunk/raster3d/r3.out.netcdf

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Mar 23 02:26:32 PDT 2018


Author: mmetz
Date: 2018-03-23 02:26:32 -0700 (Fri, 23 Mar 2018)
New Revision: 72520

Modified:
   grass/trunk/raster3d/r3.out.netcdf/main.c
Log:
r3.out.netcdf: remove hack for PROJ 5+

Modified: grass/trunk/raster3d/r3.out.netcdf/main.c
===================================================================
--- grass/trunk/raster3d/r3.out.netcdf/main.c	2018-03-23 09:25:34 UTC (rev 72519)
+++ grass/trunk/raster3d/r3.out.netcdf/main.c	2018-03-23 09:26:32 UTC (rev 72520)
@@ -56,13 +56,6 @@
 
 #define ERR(e) {fatalError(nc_strerror(e));}
 
-/* hack for PROJ 5+ */ 
-#ifdef HAVE_PROJ_H
-char *pj_get_def(PJ *, int );
-void pj_dalloc(void *);
-void pj_free(PJ *);
-#endif
-
 /* structs */
 typedef struct
 {
@@ -165,9 +158,12 @@
 	ukv = G_get_projunits();
 
 	pj_get_kv(&pjinfo, pkv, ukv);
-	proj4 = pj_get_def(pjinfo.pj, 0);
+	proj4 = pjinfo.def;
+#ifdef HAVE_PROJ_H
+	proj_destroy(pjinfo.pj);
+#else
 	pj_free(pjinfo.pj);
-
+#endif
 #ifdef HAVE_OGR
 	/* We support the CF suggestion crs_wkt and the gdal spatil_ref attribute */
 	if ((retval =
@@ -190,8 +186,6 @@
 	else
 	    proj4mod = G_store(proj4);
 
-	pj_dalloc(proj4);
-
 	if ((retval =
 	     nc_put_att_text(ncid, crs_varid, "crs_proj4", strlen(proj4mod),
 			     proj4mod)))



More information about the grass-commit mailing list