[GRASS-SVN] r29565 - grass/trunk/lib/proj
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jan 4 19:31:22 EST 2008
Author: martinl
Date: 2008-01-04 19:31:22 -0500 (Fri, 04 Jan 2008)
New Revision: 29565
Modified:
grass/trunk/lib/proj/convert.c
grass/trunk/lib/proj/datum.c
grass/trunk/lib/proj/do_proj.c
grass/trunk/lib/proj/ellipse.c
grass/trunk/lib/proj/get_proj.c
grass/trunk/lib/proj/local_proto.h
grass/trunk/lib/proj/projlib.dox
Log:
GProj library doxygen cleaning, message standardization
Modified: grass/trunk/lib/proj/convert.c
===================================================================
--- grass/trunk/lib/proj/convert.c 2008-01-04 21:53:03 UTC (rev 29564)
+++ grass/trunk/lib/proj/convert.c 2008-01-05 00:31:22 UTC (rev 29565)
@@ -1,20 +1,17 @@
-/*
- * $Id$
- *
- ****************************************************************************
- *
- * MODULE: gproj library
- * AUTHOR(S): Paul Kelly
- * Frank Warmerdam
- * PURPOSE: Functions for manipulating co-ordinate system representations
- * COPYRIGHT: (C) 2003 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.
- *
- *****************************************************************************/
+/**
+ \file convert.c
+ \brief GProj library - Functions for manipulating co-ordinate system representations
+
+ \author Paul Kelly, Frank Warmerdam
+
+ (C) 2003-2008 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 <grass/config.h>
#ifdef HAVE_OGR
@@ -107,12 +104,12 @@
hSRS = OSRNewSpatialReference(NULL);
if (pj_get_kv(&pjinfo, proj_info, proj_units) < 0) {
- G_warning(_("Can't parse GRASS PROJ_INFO file"));
+ G_warning(_("Unable parse GRASS PROJ_INFO file"));
return NULL;
}
if ((proj4 = pj_get_def(pjinfo.pj, 0)) == NULL) {
- G_warning(_("Can't get PROJ.4-style parameter string"));
+ G_warning(_("Unable get PROJ.4-style parameter string"));
return NULL;
}
@@ -124,13 +121,13 @@
proj4mod = proj4;
if ((errcode = OSRImportFromProj4(hSRS, proj4mod)) != OGRERR_NONE) {
- G_warning(_("OGR can't parse PROJ.4-style parameter string:\n"
- "%s\n(OGR Error code was %d)"), proj4mod, errcode);
+ G_warning(_("OGR can't parse PROJ.4-style parameter string: "
+ "%s (OGR Error code was %d)"), proj4mod, errcode);
return NULL;
}
if ((errcode = OSRExportToWkt(hSRS, &wkt)) != OGRERR_NONE) {
- G_warning(_("OGR can't get WKT-style parameter string\n"
+ G_warning(_("OGR can't get WKT-style parameter string "
"(OGR Error code was %d)"), errcode);
return NULL;
}
@@ -428,7 +425,7 @@
{
if( paramspresent < 2)
/* Only give warning if no parameters present */
- G_warning(_("Datum <%s> not recognised by GRASS and no parameters found."),
+ G_warning(_("Datum <%s> not recognised by GRASS and no parameters found"),
pszDatumName);
}
else
Modified: grass/trunk/lib/proj/datum.c
===================================================================
--- grass/trunk/lib/proj/datum.c 2008-01-04 21:53:03 UTC (rev 29564)
+++ grass/trunk/lib/proj/datum.c 2008-01-05 00:31:22 UTC (rev 29565)
@@ -1,21 +1,17 @@
-/*
- * $Id$
- *
- ****************************************************************************
- *
- * MODULE: gproj library
- * AUTHOR(S): Andreas Lange - andreas.lange at rhein-main.de
- * Paul Kelly - paul-grass at stjohnspoint.co.uk
- * PURPOSE: provide functions for reading datum parameters from the
- * location database.
- * COPYRIGHT: (C) 2000, 2003 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.
- *
- *****************************************************************************/
+/**
+ \file datum.c
+ \brief GProj library - Functions for reading datum parameters from the location database
+
+ \author Andreas Lange <andreas.lange rhein-main.de>, Paul Kelly <paul-grass stjohnspoint.co.uk>
+
+ (C) 2003-2008 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 <string.h>
#include <ctype.h>
@@ -253,7 +249,7 @@
{
Tmp_file = G_tempfile ();
if (NULL == (Tmp_fd = fopen (Tmp_file, "w"))) {
- G_warning(_("Cannot open temp file") );
+ G_warning(_("Unable to open temporary file"));
}
fprintf(Tmp_fd,"Number\tDetails\t\n---\n");
@@ -409,7 +405,7 @@
fd = fopen(file, "r");
if (!fd) {
- G_warning(_("unable to open datum table file: %s"), file);
+ G_warning(_("Unable to open datum table file <%s>"), file);
return outputlist;
}
@@ -422,7 +418,7 @@
if (sscanf(buf, "%99s \"%1023[^\"]\" \"%1023[^\"]\" \"%1023[^\"]\"",
name, params, where_used, comment) != 4) {
- G_warning(_("error in datum table file, line %d"), line);
+ G_warning(_("Error in datum table file <%s>, line %d"), file, line);
continue;
}
@@ -472,7 +468,7 @@
fd = fopen(file, "r");
if (!fd) {
- G_warning(_("unable to open datum table file: %s"), file);
+ G_warning(_("Unable to open datum table file <%s>"), file);
return NULL;
}
@@ -486,7 +482,7 @@
if (sscanf(buf, "%s \"%1023[^\"]\" %s dx=%lf dy=%lf dz=%lf",
name, descr, ellps, &dx, &dy, &dz) != 6) {
- G_warning(_("error in datum table file, line %d"), line);
+ G_warning(_("Error in datum table file <%s>, line %d"), file, line);
continue;
}
Modified: grass/trunk/lib/proj/do_proj.c
===================================================================
--- grass/trunk/lib/proj/do_proj.c 2008-01-04 21:53:03 UTC (rev 29564)
+++ grass/trunk/lib/proj/do_proj.c 2008-01-05 00:31:22 UTC (rev 29565)
@@ -1,27 +1,25 @@
-/*
- * $Id$
- *
- ****************************************************************************
- *
- * MODULE: gproj library
- * AUTHOR(S): Original Author unknown, probably Soil Conservation Service
- * Eric Miller
- * Paul Kelly
- * PURPOSE: Functions for re-projecting point data
- * COPYRIGHT: (C) 2003 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.
- *
- *****************************************************************************/
+/**
+ \file do_proj.c
+ \brief GProj library - Functions for re-projecting point data
+
+ \author Original Author unknown, probably Soil Conservation Service
+ Eric Miller, Paul Kelly
+
+ (C) 2003-2008 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 <stdio.h>
#include <string.h>
#include <ctype.h>
#include <grass/gis.h>
#include <grass/gprojects.h>
+#include <grass/glocale.h>
/* a couple defines to simplify reading the function */
#define MULTIPLY_LOOP(x,y,c,m) \
@@ -104,8 +102,7 @@
}
}
if (ok < 0) {
- fprintf(stderr, "pj_transform() failed\ncause: ");
- fprintf(stderr, "%s\n", pj_strerrno(ok));
+ G_warning (_("pj_transform() failed: %s"), pj_strerrno(ok));
}
return ok;
}
@@ -178,8 +175,7 @@
G_free(h);
if (ok < 0) {
- fprintf(stderr, "pj_transform() failed\ncause: ");
- fprintf(stderr, "%s\n", pj_strerrno(ok));
+ G_warning(_("pj_transform() failed: %s"), pj_strerrno(ok));
}
return ok;
}
Modified: grass/trunk/lib/proj/ellipse.c
===================================================================
--- grass/trunk/lib/proj/ellipse.c 2008-01-04 21:53:03 UTC (rev 29564)
+++ grass/trunk/lib/proj/ellipse.c 2008-01-05 00:31:22 UTC (rev 29565)
@@ -1,21 +1,17 @@
-/*
- * $Id$
- *
- ****************************************************************************
- *
- * MODULE: gproj library
- * AUTHOR(S): Original Author unknown, probably CERL
- * Paul Kelly - paul-grass at stjohnspoint.co.uk
- * PURPOSE: provide functions for reading ellipsoid parameters from the
- * location database.
- * COPYRIGHT: (C) 2000, 2003 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.
- *
- *****************************************************************************/
+/**
+ \file ellipse.c
+ \brief GProj library - Functions for reading datum parameters from the location database
+
+ \author Paul Kelly <paul-grass stjohnspoint.co.uk>
+
+ (C) 2003-2008 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 <ctype.h>
#include <string.h>
@@ -56,7 +52,7 @@
{
struct gpj_ellps estruct;
struct gpj_datum dstruct;
- char *err, *str, *str1, *str3;
+ char *str, *str1, *str3;
str = G_find_key_value("datum", proj_keys);
@@ -74,9 +70,7 @@
if (str != NULL) {
if (GPJ_get_ellipsoid_by_name(str, &estruct) < 0) {
- G_asprintf(&err, _("invalid ellipsoid %s in file")
- , str);
- G_fatal_error(err);
+ G_fatal_error(_("Invalid ellipsoid <%s> in file"), str);
}
else {
*a = estruct.a;
@@ -99,12 +93,12 @@
else if ((str3 = G_find_key_value("b", proj_keys)) != NULL)
G_asprintf(&str1, "b=%s", str3);
else
- G_fatal_error
- ("No secondary ellipsoid descriptor (rf, es or b) in file");
+ G_fatal_error(_("No secondary ellipsoid descriptor "
+ "(rf, es or b) in file"));
if (get_a_e2_f(str, str1, a, e2, rf) == 0)
- G_fatal_error
- ("Invalid ellipsoid descriptors (a, rf, es or b) in file");
+ G_fatal_error(_("Invalid ellipsoid descriptors "
+ "(a, rf, es or b) in file"));
*rf = 1.0 / *rf;
return 1;
}
@@ -117,9 +111,7 @@
return 0;
}
else {
- G_asprintf(&err, _("No ellipsoid info given in file")
- );
- G_fatal_error(err);
+ G_fatal_error(_("No ellipsoid info given in file"));
}
}
}
@@ -217,7 +209,7 @@
if (fd == NULL) {
perror(file);
- G_asprintf(&errbuf, _("unable to open ellipsoid table file: %s"), file);
+ G_asprintf(&errbuf, _("Unable to open ellipsoid table file <%s>"), file);
fatal ? G_fatal_error(errbuf) : G_warning(errbuf);
G_free(errbuf);
return 0;
Modified: grass/trunk/lib/proj/get_proj.c
===================================================================
--- grass/trunk/lib/proj/get_proj.c 2008-01-04 21:53:03 UTC (rev 29564)
+++ grass/trunk/lib/proj/get_proj.c 2008-01-05 00:31:22 UTC (rev 29565)
@@ -1,19 +1,17 @@
/**
\file get_proj.c
- \brief GPROJ library
+ \brief GProj library - Functions for re-projecting point data
- Functions for re-projecting point data
-
\author Original Author unknown, probably Soil Conservation Service,
Eric Miller, Paul Kelly
- (C) 2003 by the GRASS Development Team
+ (C) 2003-2008 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 <stdio.h>
#include <stdlib.h>
Modified: grass/trunk/lib/proj/local_proto.h
===================================================================
--- grass/trunk/lib/proj/local_proto.h 2008-01-04 21:53:03 UTC (rev 29564)
+++ grass/trunk/lib/proj/local_proto.h 2008-01-05 00:31:22 UTC (rev 29565)
@@ -1,3 +1,17 @@
+/**
+ \file local_proto.h
+
+ \brief GProj library
+
+ \author Paul Kelly <paul-grass stjohnspoint.co.uk>
+
+ (C) 2003-2008 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.
+**/
+
struct ellps_list
{
char *name, *longname;
Modified: grass/trunk/lib/proj/projlib.dox
===================================================================
--- grass/trunk/lib/proj/projlib.dox 2008-01-04 21:53:03 UTC (rev 29564)
+++ grass/trunk/lib/proj/projlib.dox 2008-01-05 00:31:22 UTC (rev 29565)
@@ -2,15 +2,15 @@
<!-- doxygenized from "GRASS 5 Programmer's Manual"
by M. Neteler 11/2005
-->
-<title>GRASS and the PROJ.4 Projection Library</title>
\section projintro GRASS and the PROJ4 projection library
-GRASS utilizes the PROJ4 library originally developed by Gerald Evenden/USGS
-(Cartographic Projection Procedures for the UNIX Environment -- A User's
-Manual, (Evenden, 1990, Open-file report 90-284).). The PROJ4
-(htp://proj.maptools.org) functions are used through wrapper functions
-in a GRASS environment.
+GRASS utilizes the PROJ4 library originally developed by Gerald
+Evenden/USGS (Cartographic Projection Procedures for the UNIX
+Environment -- A User's Manual, Evenden, 1990, Open-file report
+90-284). The PROJ4 (<a
+href="http://proj.maptools.org">http://proj.maptools.org</a>)
+functions are used through wrapper functions in a GRASS environment.
Internally to the PROJ.4 library, projection may involve transformation to
and from geodetic co-ordinates (latitude and longitude), and numerical
@@ -32,7 +32,7 @@
descriptions to and from the formats used by other GIS. Heavy use is
made of the OGR library, part of GDAL (http://www.gdal.org/ogr/).
-\section datum_transformation Datum transformation
+\subsection datum_transformation Datum transformation
GRASS generally supports datum transformation (3 parameters, 7 parameters
and grid).
@@ -42,14 +42,13 @@
no parameters found, the datum transformation parameters have to be
added to $GISBASE/etc/datum.table (and also $GISBASE/etc/datumtransform.table
if you have 7-parameter transformation parameters). No need to re-compile
-though. When adding to CVS, currently these files are still in lib/gis/.
+though. When adding to SVN, currently these files are still in lib/gis/.
-\section Makefile_Example Makefile Example
+\subsection Makefile_Example Makefile Example
<P>
-The following code demonstrates the Makefile
-(see also \ref Compiling_and_Installing_GRASS_Modules).
+The following code demonstrates the Makefile.
\verbatim
MODULE_TOPDIR = ../..
More information about the grass-commit
mailing list