Explorar o código

g.proj: use new GRASS API for coordinate transformation

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@72510 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz %!s(int64=7) %!d(string=hai) anos
pai
achega
ed6d835d34
Modificáronse 1 ficheiros con 6 adicións e 10 borrados
  1. 6 10
      general/g.proj/output.c

+ 6 - 10
general/g.proj/output.c

@@ -121,13 +121,6 @@ void print_datuminfo(void)
     return;
 }
 
-/* TODO: remove hack for PROJ 5+ */
-#ifdef HAVE_PROJ_H
-char *pj_get_def(PJ *, int);
-void pj_dalloc(void *);
-void pj_free(PJ *);
-#endif
-
 void print_proj4(int dontprettify)
 {
     struct pj_info pjinfo;
@@ -138,9 +131,13 @@ void print_proj4(int dontprettify)
 	return;
 
     if (pj_get_kv(&pjinfo, projinfo, projunits) == -1)
-        G_fatal_error(_("Unable to convert projection information to PROJ.4 format"));
-    proj4 = pj_get_def(pjinfo.pj, 0);
+        G_fatal_error(_("Unable to convert projection information to PROJ format"));
+    proj4 = pjinfo.def;
+#ifdef HAVE_PROJ_H
+    proj_destroy(pjinfo.pj);
+#else
     pj_free(pjinfo.pj);
+#endif
     /* GRASS-style PROJ.4 strings don't include a unit factor as this is
      * handled separately in GRASS - must include it here though */
     unfact = G_find_key_value("meters", projunits);
@@ -148,7 +145,6 @@ void print_proj4(int dontprettify)
 	G_asprintf(&proj4mod, "%s +to_meter=%s", proj4, unfact);
     else
 	proj4mod = G_store(proj4);
-    pj_dalloc(proj4);
 
     for (i = proj4mod; *i; i++) {
 	/* Don't print the first space */