diff --git a/main.cpp b/main.cpp index 14958bf..58d93fa 100644 --- a/main.cpp +++ b/main.cpp @@ -13,40 +13,19 @@ #include "outils.h" #include - - - - -int Convertion(double &x, - double &y, - double &z, - unsigned long int EPSG_In, - unsigned long int EPSG_Out) +int Convertion(double &x, double &y, double &z, unsigned long int EPSG_In, unsigned long int EPSG_Out) { + std::string input = "+init=epsg:" + outils::ToString(EPSG_In); + std::string output = "+init=epsg:" + outils::ToString(EPSG_Out); + + projPJ source = pj_init_plus(input.c_str()); + projPJ target = pj_init_plus(output.c_str()); - std::string input="+init=epsg:"+outils::ToString(EPSG_In); - std::string output="+init=epsg:"+outils::ToString(EPSG_Out); - projPJ source = pj_init_plus(input.c_str()); - projPJ target = pj_init_plus(output.c_str()); - -if(source==NULL || target==NULL) - return 1; - - - int success = pj_transform(source, target, 1, 1, &x, &y, &z ); - - return success; - + if(source == NULL || target == NULL) return 1; + return pj_transform(source, target, 1, 1, &x, &y, &z ); } - - - - - - - //--------------------------------------------------------------------------------------------- int main(int argc, char **argv) @@ -56,58 +35,42 @@ int main(int argc, char **argv) // RGF 93 CC45 3945 // RGF93 L93 2154 - - std::string message_erreur="erreur attendu nom_exe fichier_las_in fichier_las_out epsg_in epsg_out type_unite_entree (0 radian/metres 1-> degrees decimaux) type_unite_sortie (0 radian metre 1 -> degrees decimaux)"; + std::string message_erreur = "erreur attendu nom_exe fichier_las_in fichier_las_out epsg_in epsg_out type_unite_entree (0 radian/metres 1-> degrees decimaux) type_unite_sortie (0 radian metre 1 -> degrees decimaux)"; affichage_console::afficheLogoSncf(); - - if(argc!=7) + if(argc != 7) { - - std::cerr< mon_bounds(x_min,y_min,z_min,x_max,y_max,z_max); @@ -229,79 +159,54 @@ std::cerr<<"erreur a la definition de la projection"<