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

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Jan 14 09:34:55 PST 2017


Author: ychemin
Date: 2017-01-14 09:34:55 -0800 (Sat, 14 Jan 2017)
New Revision: 70372

Added:
   grass/trunk/imagery/i.ortho.photo/i.ortho.target/
   grass/trunk/imagery/i.ortho.photo/i.ortho.target/Makefile
   grass/trunk/imagery/i.ortho.photo/i.ortho.target/i.ortho.target.html
   grass/trunk/imagery/i.ortho.photo/i.ortho.target/main.c
Modified:
   grass/trunk/imagery/i.ortho.photo/Makefile
Log:
Added i.ortho.target

Modified: grass/trunk/imagery/i.ortho.photo/Makefile
===================================================================
--- grass/trunk/imagery/i.ortho.photo/Makefile	2017-01-14 15:23:42 UTC (rev 70371)
+++ grass/trunk/imagery/i.ortho.photo/Makefile	2017-01-14 17:34:55 UTC (rev 70372)
@@ -6,6 +6,7 @@
 	i.ortho.elev \
 	i.ortho.init \
 	i.ortho.rectify \
+	i.ortho.target \
 	i.ortho.transform
 
 SUBDIRS = lib $(SUBDIRS1)

Added: grass/trunk/imagery/i.ortho.photo/i.ortho.target/Makefile
===================================================================
--- grass/trunk/imagery/i.ortho.photo/i.ortho.target/Makefile	                        (rev 0)
+++ grass/trunk/imagery/i.ortho.photo/i.ortho.target/Makefile	2017-01-14 17:34:55 UTC (rev 70372)
@@ -0,0 +1,15 @@
+MODULE_TOPDIR = ../../..
+
+PGM = i.ortho.target
+
+EXTRA_CFLAGS = -I../lib
+
+LIBES     = $(IMAGERYLIB) $(GISLIB) $(IORTHOLIB)
+DEPENDENCIES= $(IMAGERYDEP) $(IORTHODEP) $(GISDEP)
+
+include $(MODULE_TOPDIR)/include/Make/Module.make
+
+default: cmd
+
+htmletc:
+	@echo No docs needed for $(PGM)

Added: grass/trunk/imagery/i.ortho.photo/i.ortho.target/i.ortho.target.html
===================================================================
--- grass/trunk/imagery/i.ortho.photo/i.ortho.target/i.ortho.target.html	                        (rev 0)
+++ grass/trunk/imagery/i.ortho.photo/i.ortho.target/i.ortho.target.html	2017-01-14 17:34:55 UTC (rev 70372)
@@ -0,0 +1,23 @@
+<H2>DESCRIPTION</H2>
+
+<em>i.ortho.target</em> sets the image group target location and mapset
+<p>
+
+<H2>SEE ALSO</H2>
+
+<em>
+<a href="i.ortho.photo.html">i.ortho.photo</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.photo.2target.html">i.photo.2target</a><br>
+<a href="i.ortho.init.html">i.ortho.init</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, 2017<br>
+<p>
+<i>Last changed: $Date: 2017-01-14 $</i>

Added: grass/trunk/imagery/i.ortho.photo/i.ortho.target/main.c
===================================================================
--- grass/trunk/imagery/i.ortho.photo/i.ortho.target/main.c	                        (rev 0)
+++ grass/trunk/imagery/i.ortho.photo/i.ortho.target/main.c	2017-01-14 17:34:55 UTC (rev 70372)
@@ -0,0 +1,85 @@
+
+/****************************************************************************
+ *
+ * MODULE:       i.photo.target
+ * 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>
+ *               Hamish Bowman
+ *
+ * PURPOSE:      Select target location and mapset
+ * 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 <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <grass/gis.h>
+#include <grass/imagery.h>
+#include <grass/glocale.h>
+#include "orthophoto.h"
+
+int main(int argc, char *argv[])
+{
+    struct GModule *module;
+    struct Option *group_opt;
+    struct Option *location_opt;
+    struct Option *mapset_opt;
+
+    /* current location and mapset of that group */
+    char location[GMAPSET_MAX];
+    char mapset[GMAPSET_MAX];
+    char group[GNAME_MAX];
+    /* newly defined location and maspet */
+    char target_location[GMAPSET_MAX];
+    char target_mapset[GMAPSET_MAX];
+
+    G_gisinit(argv[0]);
+
+    module = G_define_module();
+    G_add_keyword(_("imagery"));
+    G_add_keyword(_("orthorectify"));
+    module->description =
+	_("Select or modify the imagery group target.");
+
+    group_opt = G_define_standard_option(G_OPT_I_GROUP);
+    group_opt->description =
+	_("Name of imagery group for ortho-rectification");
+
+    location_opt = G_define_standard_option(G_OPT_M_LOCATION);
+    location_opt->key = "target_location";
+    location_opt->required = YES;
+    location_opt->description =
+	_("Name of target location for ortho-rectification");
+
+    mapset_opt = G_define_standard_option(G_OPT_M_MAPSET);
+    mapset_opt->key = "mapset_location";
+    mapset_opt->required = YES;
+    mapset_opt->description =
+	_("Name of target mapset for ortho-rectification");
+
+    if (G_parser(argc, argv))
+	exit(EXIT_FAILURE);
+
+
+    strcpy(group, group_opt->answer);
+    strcpy(target_location, location_opt->answer);
+    strcpy(target_mapset, mapset_opt->answer);
+
+    I_get_target(group, location, mapset);
+    G_create_alt_env();
+    G_switch_env();
+    I_put_target(group, target_location, target_mapset);
+
+    G_message(_("Group [%s] targeted for location [%s], mapset [%s]"),
+	    group, target_location, target_mapset);
+
+    exit(EXIT_SUCCESS);
+}



More information about the grass-commit mailing list