gpx_doctor 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/gpx_doctor/parser.rb +6 -1
- data/lib/gpx_doctor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c13f7a8d06c283b5a8dba624cced9d7244d60f2720918b495f35cf96ce8ae1e3
|
|
4
|
+
data.tar.gz: 4237a5927878077f57a7912e8cd61ec7d2300e31551890e653840aca9197049c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9841a014b0a980fd3c980ad92cb6ad04affb45eb711058bca7575967086bf2edeb311833ed5117233c379a80c5616ee0c15ec1cecf3eef15c8d40ed2c6450cc8
|
|
7
|
+
data.tar.gz: e022a619a37fb50308ed5414644c8c82cc4e70cacc6b30c06a588718e70c71d54f56e1f49b953fb2875a628399cc50dde6424037da8760f88066db3079f26566
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# GPX Doctor
|
|
2
2
|
|
|
3
|
-
A Ruby gem for parsing and manipulating GPX 1.1
|
|
3
|
+
A Ruby gem for parsing and manipulating GPX routes. The parser reads GPX 1.1 and GPX 1.0 (`http://www.topografix.com/GPX/1/0`, e.g. Traseo and older RideWithGPS exports); the builder always writes GPX 1.1.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
data/lib/gpx_doctor/parser.rb
CHANGED
|
@@ -6,6 +6,11 @@ require 'time'
|
|
|
6
6
|
module GpxDoctor
|
|
7
7
|
class Parser
|
|
8
8
|
GPX_NS = 'http://www.topografix.com/GPX/1/1'
|
|
9
|
+
GPX_10_NS = 'http://www.topografix.com/GPX/1/0'
|
|
10
|
+
# Validator accepts both versions, so the parser must read both. Element
|
|
11
|
+
# names used here (wpt, rte, trk, trkseg, trkpt, ele, time, name) are the
|
|
12
|
+
# same in 1.0 and 1.1 — only the namespace differs.
|
|
13
|
+
GPX_NAMESPACES = [GPX_NS, GPX_10_NS].freeze
|
|
9
14
|
|
|
10
15
|
Result = Struct.new(:waypoints, :routes, :tracks, :metadata, :pois, keyword_init: true) do
|
|
11
16
|
# The path described by the file, in order: <rtept> then <trkpt>.
|
|
@@ -48,7 +53,7 @@ module GpxDoctor
|
|
|
48
53
|
|
|
49
54
|
def detect_namespace(doc)
|
|
50
55
|
root_ns = doc.root&.namespace&.href
|
|
51
|
-
root_ns
|
|
56
|
+
GPX_NAMESPACES.include?(root_ns) ? root_ns : nil
|
|
52
57
|
end
|
|
53
58
|
end
|
|
54
59
|
|
data/lib/gpx_doctor/version.rb
CHANGED