[GRASS-SVN] r72599 - grass/trunk/vector/v.proj

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Apr 8 06:48:12 PDT 2018


Author: mmetz
Date: 2018-04-08 06:48:12 -0700 (Sun, 08 Apr 2018)
New Revision: 72599

Modified:
   grass/trunk/vector/v.proj/main.c
Log:
v.proj: +option for user-defined PROJ pipeline

Modified: grass/trunk/vector/v.proj/main.c
===================================================================
--- grass/trunk/vector/v.proj/main.c	2018-04-08 13:47:32 UTC (rev 72598)
+++ grass/trunk/vector/v.proj/main.c	2018-04-08 13:48:12 UTC (rev 72599)
@@ -47,6 +47,9 @@
     char date[40], mon[4];
     struct GModule *module;
     struct Option *omapopt, *mapopt, *isetopt, *ilocopt, *ibaseopt, *smax;
+#ifdef HAVE_PROJ_H
+    struct Option *pipeline;	/* name of custom PROJ pipeline */
+#endif
     struct Key_Value *in_proj_keys, *in_unit_keys;
     struct Key_Value *out_proj_keys, *out_unit_keys;
     struct line_pnts *Points, *Points2;
@@ -108,6 +111,14 @@
     omapopt->description = _("Name for output vector map (default: input)");
     omapopt->guisection = _("Target");
 
+#ifdef HAVE_PROJ_H
+    pipeline = G_define_option();
+    pipeline->key = "pipeline";
+    pipeline->type = TYPE_STRING;
+    pipeline->required = NO;
+    pipeline->description = _("PROJ pipeline for coordinate transformation");
+#endif
+
     flag.list = G_define_flag();
     flag.list->key = 'l';
     flag.list->description = _("List vector maps in input mapset and exit");
@@ -271,6 +282,12 @@
 	pj_print_proj_params(&info_in, &info_out);
     }
 
+    info_trans.def = NULL;
+#ifdef HAVE_PROJ_H
+    if (pipeline->answer) {
+	info_trans.def = G_store(pipeline->answer);
+    }
+#endif
     if (GPJ_init_transform(&info_in, &info_out, &info_trans) < 0)
 	G_fatal_error(_("Unable to initialize coordinate transformation"));
 



More information about the grass-commit mailing list