[GRASS-SVN] r70481 - in grass/trunk/imagery/i.ortho.photo: . i.ortho.photo

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 4 07:29:13 PST 2017


Author: ychemin
Date: 2017-02-04 07:29:13 -0800 (Sat, 04 Feb 2017)
New Revision: 70481

Added:
   grass/trunk/imagery/i.ortho.photo/i.ortho.photo/
   grass/trunk/imagery/i.ortho.photo/i.ortho.photo/Makefile
   grass/trunk/imagery/i.ortho.photo/i.ortho.photo/i.ortho.photo.html
   grass/trunk/imagery/i.ortho.photo/i.ortho.photo/menu.c
Log:
Added a menu to i.ortho.photo process

Added: grass/trunk/imagery/i.ortho.photo/i.ortho.photo/Makefile
===================================================================
--- grass/trunk/imagery/i.ortho.photo/i.ortho.photo/Makefile	                        (rev 0)
+++ grass/trunk/imagery/i.ortho.photo/i.ortho.photo/Makefile	2017-02-04 15:29:13 UTC (rev 70481)
@@ -0,0 +1,12 @@
+MODULE_TOPDIR = ../../..
+
+PGM = i.ortho.photo
+
+EXTRA_CFLAGS = -I../lib
+
+LIBES     = $(IMAGERYLIB) $(GISLIB) $(IORTHOLIB)
+DEPENDENCIES= $(IMAGERYDEP) $(IORTHODEP) $(GISDEP)
+
+include $(MODULE_TOPDIR)/include/Make/Module.make
+
+default: cmd

Added: grass/trunk/imagery/i.ortho.photo/i.ortho.photo/i.ortho.photo.html
===================================================================
--- grass/trunk/imagery/i.ortho.photo/i.ortho.photo/i.ortho.photo.html	                        (rev 0)
+++ grass/trunk/imagery/i.ortho.photo/i.ortho.photo/i.ortho.photo.html	2017-02-04 15:29:13 UTC (rev 70481)
@@ -0,0 +1,43 @@
+<H2>DESCRIPTION</H2>
+
+<em>i.ortho.photo</em> is a menu to launch the different parts of the ortho rectification process of aerial imagery
+<p>
+<em>i.ortho.photo -- Imagery Group</em>
+<br>
+<em>Initialization Options</em><br>
+<br>
+1.     Select/Modify imagery group (i.group)<br>
+2.     Select/Modify imagery group target (i.ortho.target)<br>
+3.     Select/Modify target elevation model (i.ortho.elev)<br>
+4.     Select/Modify imagery group camera (i.ortho.camera)<br>
+<br>
+<em>Transformation Parameter Computations</em><br>
+<br>
+5.     Compute image-to-photo transformation (i.photo.2image)<br>
+6.     Initialize exposure station parameters (i.ortho.init)<br>
+7.     Compute ortho-rectification parameters (i.photo.2image)<br>
+<br>
+<em>Ortho-rectification Option</em><br>
+<br>
+8.     Ortho-rectify imagery files (i.ortho.rectify)<br>
+<br>
+
+<H2>SEE ALSO</H2>
+
+<em>
+<a href="i.group.html">i.group</a><br>
+<a href="i.ortho.target.html">i.ortho.target</a><br>
+<a href="i.ortho.elev.html">i.ortho.elev</a><br>
+<a href="i.ortho.camera.html">i.ortho.camera</a><br>
+<a href="i.photo.2image.html">i.photo.2image</a><br>
+<a href="i.ortho.init.html">i.ortho.init</a><br>
+<a href="i.photo.2target.html">i.photo.2target</a><br>
+<a href="i.ortho.rectify.html">i.ortho.rectify</a>
+</em>
+
+
+<H2>AUTHOR</H2>
+Mike Baba,  DBA Systems, Inc.<br>
+GRASS development team, 199?-2017<br>
+<p>
+<i>Last changed: $Date: 2017-01-14 $</i>

Added: grass/trunk/imagery/i.ortho.photo/i.ortho.photo/menu.c
===================================================================
--- grass/trunk/imagery/i.ortho.photo/i.ortho.photo/menu.c	                        (rev 0)
+++ grass/trunk/imagery/i.ortho.photo/i.ortho.photo/menu.c	2017-02-04 15:29:13 UTC (rev 70481)
@@ -0,0 +1,123 @@
+
+/****************************************************************************
+ *
+ * MODULE:       menu
+ * AUTHOR(S):    Mike Baba,  DBA Systems, Inc. (original contributor)
+ *               Markus Neteler <neteler itc.it>,
+ *               Roberto Flor <flor itc.it>,
+ *               Bernhard Reiter <bernhard intevation.de>,
+ *               Glynn Clements <glynn gclements.plus.com>
+ * PURPOSE:      main menu system
+ * COPYRIGHT:    (C) 1999-2017 by the GRASS Development Team
+ *
+ *               This program is free software under the GNU General Public
+ *               License (>=v2). Read the file COPYING that comes with GRASS
+ *               for details.
+ *
+ *****************************************************************************/
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <grass/gis.h>
+#include <grass/imagery.h>
+#include <grass/glocale.h>
+#include <grass/spawn.h>
+#include "orthophoto.h"
+
+int main(int argc, char **argv)
+{
+    char title[80];
+    char buf[80], *p;
+    struct Ortho_Image_Group group;
+    struct GModule *module;
+    struct Option *group_opt, *ortho_opt;
+    char *desc_ortho_opt;
+    char *moduletorun;
+    const char *grname;
+    char tosystem[99];
+    const char *to_system;
+    int err=0;
+
+    /* initialize grass */
+    G_gisinit(argv[0]);
+
+    module = G_define_module();
+    G_add_keyword(_("imagery"));
+    G_add_keyword(_("orthorectify"));
+    module->description = _("Menu driver for the photo imagery programs.");
+
+    group_opt = G_define_standard_option(G_OPT_I_GROUP);
+    group_opt->description =
+	_("Name of imagery group for ortho-rectification");
+
+    ortho_opt = G_define_option();
+    ortho_opt->key = "productname";
+    ortho_opt->type = TYPE_STRING;
+    ortho_opt->required = YES;
+    ortho_opt->description = _("Name of Modules");
+    desc_ortho_opt = NULL;
+    G_asprintf(&desc_ortho_opt,
+               "i.group;%s;"
+               "i.ortho.target;%s;"
+               "i.ortho.elev;%s;"
+               "i.ortho.camera;%s;"
+               "i.photo.2image;%s;"
+               "i.ortho.init;%s;"
+               "i.photo.2target;%s;"
+               "i.ortho.rectify;%s;",
+               _("1 - Select/Modify imagery group"),
+               _("2 - Select/Modify imagery group target"),
+               _("3 - Select/Modify target elevation model"),
+               _("4 - Select/Modify imagery group camera"),
+               _("5 - Compute image-to-photo transformation"),
+               _("6 - Initialize exposure station parameters"),
+               _("7 - Compute ortho-rectification parameters"),
+               _("8 - Ortho-rectify imagery files"));
+    ortho_opt->descriptions = desc_ortho_opt;
+    ortho_opt->options = "i.group,i.ortho.target,i.ortho.elev,i.ortho.camera,i.photo.2image,i.ortho.init,i.photo.2target,i.ortho.rectify";
+
+    if (G_parser(argc, argv))
+	exit(EXIT_FAILURE);
+
+    /* group validity check */
+    /*----------------------*/
+    strncpy(group.name, group_opt->answer, 99);
+    group.name[99] = '\0';
+    /* strip off mapset if it's there: I_() fns only work with current mapset */
+    if ((p = strchr(group.name, '@')))
+	*p = 0;
+
+    /* get and check the group reference files */
+    if (!I_get_group_ref(group.name, &group.group_ref))
+	G_fatal_error(_("Pre-selected group <%s> not found"), group.name);
+    I_get_group_ref(group.name, &group.group_ref);
+
+    if (group.group_ref.nfiles <= 0)
+	G_fatal_error(_("Group [%s] contains no files"), group.name);
+
+    I_put_group(group.name);
+    /*-----------------------------*/
+    /* END of group validity check */
+    grname=group.name;
+    moduletorun=ortho_opt->answer;
+    /* run the program chosen */
+    if (strcmp(moduletorun, "i.group") == 0)
+        strcpy(tosystem,"i.group --ui group=");
+    if (strcmp(moduletorun, "i.ortho.target") == 0)
+        strcpy(tosystem,"i.ortho.target --ui group=");
+    if (strcmp(moduletorun, "i.ortho.elev") == 0)
+        strcpy(tosystem,"i.ortho.elev --ui group=");
+    if (strcmp(moduletorun, "i.ortho.camera") == 0)
+        strcpy(tosystem,"i.ortho.camera --ui group=");
+    if (strcmp(moduletorun, "i.photo.2image") == 0)
+        strcpy(tosystem,"i.photo.2image --ui group=");
+    if (strcmp(moduletorun, "i.ortho.init") == 0)
+        strcpy(tosystem,"i.ortho.init --ui group=");
+    if (strcmp(moduletorun, "i.photo.2target") == 0)
+        strcpy(tosystem,"i.photo.2target --ui group=");
+    if (strcmp(moduletorun, "i.ortho.rectify") == 0)
+        strcpy(tosystem,"i.ortho.rectify --ui group=");
+    strcat(tosystem,grname);
+    err=system((const char *)tosystem);
+}



More information about the grass-commit mailing list