geodesic_wgs84 1.32.5 → 1.32.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/ext/geodesic_wgs84/geodesic_wgs84.c +4 -7
- data/lib/geodesic_wgs84/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae5e103f4963574c9c9d14020f30da27f8223b11
|
4
|
+
data.tar.gz: 8de4ef5f7f44b1ecec778aec3bbaf72470c1a3dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8333f8fad8608d24a7dfe53c96d5d95755ca56b5478c2602dd28f25f43000f0b02dc6f9a09cd2ac2a4c6402209cfd47fd9e32694c2daf32fbd406ce0919f52cf
|
7
|
+
data.tar.gz: 5f0c0a3bf995c8b2112291813abd59e5304bfc680583631b568651434dc6f8047bcb22e07be5dd0e6e750234c27d2fe35e8c9d617fb749c04a0e0aa24b819669
|
data/README.md
CHANGED
@@ -36,6 +36,9 @@ Or install it yourself as:
|
|
36
36
|
The representation of a DMS (degree minute second) format is 'dd.mm.ss,f'
|
37
37
|
where f means tenth of seconds (fraction).
|
38
38
|
|
39
|
+
Also, we are working with 6 decimal places, which will render an accuracy
|
40
|
+
of roughly 10cm. See ( http://en.wikipedia.org/wiki/Decimal_degrees#Accuracy )
|
41
|
+
|
39
42
|
require 'geodesic_wgs84'
|
40
43
|
|
41
44
|
wgs84 = Wgs84.new
|
@@ -48,22 +48,19 @@ wgs84_get_value(VALUE arg)
|
|
48
48
|
dbl += (double) mm / 60.0;
|
49
49
|
dbl += (double) ss / 3600.0;
|
50
50
|
dbl += (double) ff / 36000.0;
|
51
|
-
|
51
|
+
sprintf(buf, "%.6f", dbl);
|
52
|
+
} else if (sscanf(buf, "%d,%d", &dd, &ff) == 2) {
|
53
|
+
*strchr(buf, ',') = '.';
|
52
54
|
}
|
53
55
|
|
54
56
|
if (sscanf(buf, "%d.%d", &dd, &ff) == 2) {
|
55
57
|
sscanf(buf, "%lf", &dbl);
|
56
58
|
return dbl;
|
57
59
|
}
|
58
|
-
|
59
|
-
if (sscanf(buf, "%d,%d", &dd, &ff) == 2) {
|
60
|
-
*strchr(buf, ',') = '.';
|
61
|
-
sscanf(buf, "%lf", &dbl);
|
62
|
-
return dbl;
|
63
|
-
}
|
64
60
|
}
|
65
61
|
|
66
62
|
rb_raise(rb_eArgError, "invalid (lat/lon) argument");
|
63
|
+
return 0.0;
|
67
64
|
}
|
68
65
|
|
69
66
|
|