|
@@ -26,7 +26,7 @@
|
|
|
#include "local_proto.h"
|
|
|
#include <grass/glocale.h>
|
|
|
|
|
|
-struct pj_info iproj, oproj;
|
|
|
+struct pj_info iproj, oproj, tproj;
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
{
|
|
@@ -112,18 +112,7 @@ int main(int argc, char **argv)
|
|
|
if (pj_get_kv(&iproj, in_proj_info, in_unit_info) < 0)
|
|
|
G_fatal_error(_("Can't get projection key values of current location"));
|
|
|
|
|
|
-#ifdef HAVE_PROJ_H
|
|
|
if (wgs84->answer) {
|
|
|
-#else
|
|
|
- if (!wgs84->answer) {
|
|
|
- /* Set output to same ellipsoid as input if we're not looking
|
|
|
- * for the WGS84 values */
|
|
|
- if (GPJ_get_equivalent_latlong(&oproj, &iproj) < 0)
|
|
|
- G_fatal_error(_("Unable to set up lat/long projection parameters"));
|
|
|
-
|
|
|
- }
|
|
|
- else {
|
|
|
-#endif
|
|
|
struct Key_Value *out_proj_info, *out_unit_info;
|
|
|
|
|
|
out_proj_info = G_create_key_value();
|
|
@@ -151,10 +140,13 @@ int main(int argc, char **argv)
|
|
|
G_free_key_value(out_proj_info);
|
|
|
G_free_key_value(out_unit_info);
|
|
|
}
|
|
|
+ /* else the latlong equivalent is generated by GPJ_init_transform() */
|
|
|
|
|
|
G_free_key_value(in_proj_info);
|
|
|
G_free_key_value(in_unit_info);
|
|
|
|
|
|
+ if (GPJ_init_transform(&iproj, &oproj, &tproj) < 0)
|
|
|
+ G_fatal_error(_("Unable to initialize coordinate transformation"));
|
|
|
}
|
|
|
|
|
|
if (file->answer) {
|
|
@@ -174,7 +166,7 @@ int main(int argc, char **argv)
|
|
|
D_setup(0);
|
|
|
|
|
|
where_am_i(coords->answers, fp, have_spheroid, decimal->answer,
|
|
|
- dcoord->answer, wgs84->answer);
|
|
|
+ dcoord->answer);
|
|
|
|
|
|
D_close_driver();
|
|
|
|