Selaa lähdekoodia

r3.out.netcdf: remove hack for PROJ 5+

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@72520 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 7 vuotta sitten
vanhempi
commit
c4c0d9c128
1 muutettua tiedostoa jossa 5 lisäystä ja 11 poistoa
  1. 5 11
      raster3d/r3.out.netcdf/main.c

+ 5 - 11
raster3d/r3.out.netcdf/main.c

@@ -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 @@ static void write_netcdf_header(int ncid, RASTER3D_Region * region,
 	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 @@ static void write_netcdf_header(int ncid, RASTER3D_Region * region,
 	else
 	    proj4mod = G_store(proj4);
 
-	pj_dalloc(proj4);
-
 	if ((retval =
 	     nc_put_att_text(ncid, crs_varid, "crs_proj4", strlen(proj4mod),
 			     proj4mod)))