@@ -42,22 +42,10 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4242#include " main.h"
4343#include " geotools.h"
4444
45- /*
46- static wxString MyGet(const wxString& url)
47- {
48- wxEasyCurl curl;
49- curl.AddHttpHeader("Content-type: text/plain");
50- curl.AddHttpHeader("Cache-Control: no-cache");
51- curl.Get(url);
52- return curl.GetDataAsString();
53- }
54- */
55-
5645bool GeoTools::coordinates_to_lat_lon (wxString& coord, wxString& lat, wxString& lon) {
5746
5847 wxString err, str;
5948 int n, i, x;
60-
6149 bool is_numeric = true ;
6250 std::locale loc{ " " };
6351 wchar_t decimal_symbol = std::use_facet< std::numpunct<wchar_t > >(loc).decimal_point ();
@@ -68,15 +56,7 @@ bool GeoTools::coordinates_to_lat_lon(wxString& coord, wxString& lat, wxString&
6856 str.Replace (" east" , " e" );
6957 str.Replace (" west" , " w" );
7058
71- /*
72- for (int i = 0; i < str.Length(); i++) {
73- if (str[i] == 'n' || str[i] == 's' ) {
74- x=size_t(i);
75- n++;
76- }
77- }*/
78- i = 0 ;
79- n = 0 ;
59+ i = n = 0 ;
8060 x = -1 ;
8161 for (wxString::const_iterator it = str.begin (); it != str.end (); ++it) {
8262 wxUniChar c = *it;
@@ -91,10 +71,9 @@ bool GeoTools::coordinates_to_lat_lon(wxString& coord, wxString& lat, wxString&
9171 }
9272
9373 err = " " ;
94- if (x == -1 ) { // cpg TO DO how would x ever be -1?
74+ if (x == -1 ) {
9575 if (is_numeric) {
9676 wxStringTokenizer tk (str, ' ,' );
97- // wxArrayString arr = wxSplit(str, ',');
9877 if (tk.CountTokens () == 2 ) {
9978 lat = tk.GetNextToken ();
10079 lon = tk.GetNextToken ();
@@ -127,7 +106,6 @@ bool GeoTools::coordinates_to_lat_lon(wxString& coord, wxString& lat, wxString&
127106bool GeoTools::dms_to_dd (double & d, double & m, double & s, double * dd) {
128107
129108 int sign = 1 ;
130-
131109 wxString err = " " ;
132110
133111 if (m < 0 || s < 0 ) {
@@ -163,7 +141,6 @@ bool GeoTools::dms_to_dd(double& d, double& m, double& s, double* dd) {
163141
164142bool GeoTools::coordinate_to_dms (wxString& coord, double * d, double * m, double * s)
165143{
166-
167144 std::locale loc{ " " };
168145 wchar_t decimal_symbol = std::use_facet< std::numpunct<wchar_t > >(loc).decimal_point ();
169146
0 commit comments