diff options
| author | Thomas Knudsen <busstoptaktik@users.noreply.github.com> | 2017-11-06 10:02:05 +0100 |
|---|---|---|
| committer | Kristian Evers <kristianevers@gmail.com> | 2017-11-06 10:02:05 +0100 |
| commit | 8eb82852f5f7d23994839ba5d032edc76eab2250 (patch) | |
| tree | bf821a8723776d36f5c4287ea362bb35e8a26675 /src/cct.c | |
| parent | 1739a927f576ab4dd9e03653bf5e9cf8c0c0ac18 (diff) | |
| download | PROJ-8eb82852f5f7d23994839ba5d032edc76eab2250.tar.gz PROJ-8eb82852f5f7d23994839ba5d032edc76eab2250.zip | |
Eliminate the last traces of PJ_OBS (#643)
PJ_OBS eliminated, API adjusted to reflect that we now have only one 4D data type.
2 new API functions added to determine output types of a PJ.
Diffstat (limited to 'src/cct.c')
| -rw-r--r-- | src/cct.c | 22 |
1 files changed, 10 insertions, 12 deletions
@@ -72,6 +72,7 @@ Thomas Knudsen, thokn@sdfe.dk, 2016-05-25/2017-10-26 ***********************************************************************/ #include "optargpm.h" +#include "proj_internal.h" #include <proj.h> #include "projects.h" #include <stdio.h> @@ -80,6 +81,7 @@ Thomas Knudsen, thokn@sdfe.dk, 2016-05-25/2017-10-26 #include <string.h> #include <math.h> + double proj_strtod(const char *str, char **endptr); double proj_atof(const char *str); @@ -211,17 +213,13 @@ int main(int argc, char **argv) { return 1; } - input_unit = P->left; - output_unit = P->right; - if (PJ_IO_UNITS_CLASSIC==P->left) - input_unit = PJ_IO_UNITS_RADIANS; - if (PJ_IO_UNITS_CLASSIC==P->right) - output_unit = PJ_IO_UNITS_METERS; - if (direction==-1) { - enum pj_io_units swap = input_unit; - input_unit = output_unit; - output_unit = swap; - } + /* We have no API call for inverting an operation, so we brute force it. */ + if (direction==-1) + 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); @@ -264,7 +262,7 @@ int main(int argc, char **argv) { point.lpzt.lam = proj_torad (point.lpzt.lam); point.lpzt.phi = proj_torad (point.lpzt.phi); } - point = proj_trans_coord (P, direction, point); + point = proj_trans (P, direction, point); if (PJ_IO_UNITS_RADIANS==output_unit) { point.lpzt.lam = proj_todeg (point.lpzt.lam); point.lpzt.phi = proj_todeg (point.lpzt.phi); |
