GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
do_proj.c File Reference

GProj library - Functions for re-projecting point data. More...

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <grass/gis.h>
#include <grass/gprojects.h>
#include <grass/glocale.h>
Include dependency graph for do_proj.c:

Go to the source code of this file.

Macros

#define MULTIPLY_LOOP(x, y, c, m)
 
#define DIVIDE_LOOP(x, y, c, m)
 

Functions

int pj_do_proj (double *x, double *y, struct pj_info *info_in, struct pj_info *info_out)
 Re-project a point between two co-ordinate systems. More...
 
int pj_do_transform (int count, double *x, double *y, double *h, struct pj_info *info_in, struct pj_info *info_out)
 Re-project an array of points between two co-ordinate systems with optional ellipsoidal height conversion. More...
 

Detailed Description

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.

Definition in file do_proj.c.

Macro Definition Documentation

#define DIVIDE_LOOP (   x,
  y,
  c,
 
)
Value:
do {\
int i; \
for (i = 0; i < c; ++i) {\
x[i] /= m; \
y[i] /= m; \
}\
} while (0)
int y
Definition: plot.c:34
for(cat=0;;cat++)
Definition: g3dcats.c:140

Definition at line 35 of file do_proj.c.

Referenced by pj_do_transform().

#define MULTIPLY_LOOP (   x,
  y,
  c,
 
)
Value:
do {\
int i; \
for (i = 0; i < c; ++i) {\
x[i] *= m; \
y[i] *= m; \
}\
} while (0)
int y
Definition: plot.c:34
for(cat=0;;cat++)
Definition: g3dcats.c:140

Definition at line 26 of file do_proj.c.

Referenced by pj_do_transform().

Function Documentation

int pj_do_proj ( double *  x,
double *  y,
struct pj_info *  info_in,
struct pj_info *  info_out 
)

Re-project a point between two co-ordinate systems.

This function takes pointers to two pj_info structures as arguments, and projects a point between the co-ordinate systems represented by them. The easting and northing of the point are contained in two pointers passed to the function; these will be overwritten by the co-ordinates of the re-projected point.

Parameters
xPointer to a double containing easting or longitude
yPointer to a double containing northing or latitude
info_inpointer to pj_info struct for input co-ordinate system
info_outpointer to pj_info struct for output co-ordinate system
Returns
Return value from PROJ pj_transform() function

Definition at line 63 of file do_proj.c.

References G_warning(), and dialogs::h.

int pj_do_transform ( int  count,
double *  x,
double *  y,
double *  h,
struct pj_info *  info_in,
struct pj_info *  info_out 
)

Re-project an array of points between two co-ordinate systems with optional ellipsoidal height conversion.

This function takes pointers to two pj_info structures as arguments, and projects an array of points between the co-ordinate systems represented by them. Pointers to the three arrays of easting, northing, and ellipsoidal height of the point (this one may be NULL) are passed to the function; these will be overwritten by the co-ordinates of the re-projected points.

Parameters
countNumber of points in the arrays to be transformed
xPointer to an array of type double containing easting or longitude
yPointer to an array of type double containing northing or latitude
hPointer to an array of type double containing ellipsoidal height. May be null in which case a two-dimensional re-projection will be done
info_inpointer to pj_info struct for input co-ordinate system
info_outpointer to pj_info struct for output co-ordinate system
Returns
Return value from PROJ pj_transform() function

Definition at line 134 of file do_proj.c.

References count, DIVIDE_LOOP, G_free(), G_warning(), MULTIPLY_LOOP, and NULL.