|
@@ -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)))
|