aboutsummaryrefslogtreecommitdiff
path: root/src/cct.c
diff options
context:
space:
mode:
authorThomas Knudsen <busstoptaktik@users.noreply.github.com>2017-11-08 03:30:20 +0100
committerGitHub <noreply@github.com>2017-11-08 03:30:20 +0100
commit3ff9899dd4407877ace4daf2794cb759ccdbc235 (patch)
tree9f0d4d872b0756d18fc163adc2b1d90275cb802c /src/cct.c
parentbf673102bc86b241976df0d90f8ca1b40880b500 (diff)
downloadPROJ-3ff9899dd4407877ace4daf2794cb759ccdbc235.tar.gz
PROJ-3ff9899dd4407877ace4daf2794cb759ccdbc235.zip
Improved IO predicates (#648)
* enter proj_angular_input and proj_angular_output, exit proj_angular_left and proj_angular_right * remove unused variable 'unit' * In gie: remove unused func 'torad_if_needed', and add static keyword where needed * In gie: add some comments
Diffstat (limited to 'src/cct.c')
-rw-r--r--src/cct.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/cct.c b/src/cct.c
index de97f728..1bd25f1d 100644
--- a/src/cct.c
+++ b/src/cct.c
@@ -151,7 +151,7 @@ int main(int argc, char **argv) {
OPTARGS *o;
FILE *fout = stdout;
char *buf;
- int input_unit, output_unit, nfields = 4, direction = 1, verbose;
+ int nfields = 4, direction = 1, verbose;
double fixed_z = HUGE_VAL, fixed_time = HUGE_VAL;
int columns_xyzt[] = {1, 2, 3, 4};
const char *longflags[] = {"v=verbose", "h=help", "I=inverse", 0};
@@ -218,9 +218,6 @@ int main(int argc, char **argv) {
P->inverted = !(P->inverted);
direction = 1;
- input_unit = proj_angular_left (P)? PJ_IO_UNITS_RADIANS: PJ_IO_UNITS_METERS;
- output_unit = proj_angular_right (P)? PJ_IO_UNITS_RADIANS: PJ_IO_UNITS_METERS;
-
/* Allocate input buffer */
buf = calloc (1, 10000);
if (0==buf) {
@@ -258,12 +255,12 @@ int main(int argc, char **argv) {
continue;
}
- if (PJ_IO_UNITS_RADIANS==input_unit) {
+ if (proj_angular_input (P, direction)) {
point.lpzt.lam = proj_torad (point.lpzt.lam);
point.lpzt.phi = proj_torad (point.lpzt.phi);
}
point = proj_trans (P, direction, point);
- if (PJ_IO_UNITS_RADIANS==output_unit) {
+ if (proj_angular_output (P, direction)) {
point.lpzt.lam = proj_todeg (point.lpzt.lam);
point.lpzt.phi = proj_todeg (point.lpzt.phi);
}