21 #include <grass/gis.h>
22 #include <grass/gprojects.h>
23 #include <grass/glocale.h>
26 #define MULTIPLY_LOOP(x,y,c,m) \
29 for (i = 0; i < c; ++i) {\
35 #define DIVIDE_LOOP(x,y,c,m) \
38 for (i = 0; i < c; ++i) {\
44 static double METERS_in = 1.0, METERS_out = 1.0;
64 struct pj_info *info_in,
struct pj_info *info_out)
70 METERS_in = info_in->meters;
71 METERS_out = info_out->meters;
73 if (strncmp(info_in->proj,
"ll", 2) == 0) {
74 if (strncmp(info_out->proj,
"ll", 2) == 0) {
75 u = (*x) / RAD_TO_DEG;
76 v = (*y) / RAD_TO_DEG;
77 ok = pj_transform(info_in->pj, info_out->pj, 1, 0, &u, &v, &h);
82 u = (*x) / RAD_TO_DEG;
83 v = (*y) / RAD_TO_DEG;
84 ok = pj_transform(info_in->pj, info_out->pj, 1, 0, &u, &v, &h);
90 if (strncmp(info_out->proj,
"ll", 2) == 0) {
93 ok = pj_transform(info_in->pj, info_out->pj, 1, 0, &u, &v, &h);
100 ok = pj_transform(info_in->pj, info_out->pj, 1, 0, &u, &v, &h);
106 G_warning(_(
"pj_transform() failed: %s"), pj_strerrno(ok));
135 struct pj_info *info_in,
struct pj_info *info_out)
140 METERS_in = info_in->meters;
141 METERS_out = info_out->meters;
146 h = G_malloc(
sizeof *h * count);
148 for (i = 0; i <
count; ++i)
152 if (strncmp(info_in->proj,
"ll", 2) == 0) {
153 if (strncmp(info_out->proj,
"ll", 2) == 0) {
155 ok = pj_transform(info_in->pj, info_out->pj, count, 1, x, y, h);
160 ok = pj_transform(info_in->pj, info_out->pj, count, 1, x, y, h);
165 if (strncmp(info_out->proj,
"ll", 2) == 0) {
167 ok = pj_transform(info_in->pj, info_out->pj, count, 1, x, y, h);
172 ok = pj_transform(info_in->pj, info_out->pj, count, 1, x, y, h);
180 G_warning(_(
"pj_transform() failed: %s"), pj_strerrno(ok));
void G_free(void *buf)
Free allocated memory.
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.
#define DIVIDE_LOOP(x, y, c, m)
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 conver...
G_warning("category support for [%s] in mapset [%s] %s", name, mapset, type)
#define MULTIPLY_LOOP(x, y, c, m)
tuple h
panel.defaultSize = wx.CheckBox(panel, id = wx.ID_ANY, label = _("Use default size")) panel...