Skip to content

Preserve GPX metadata and trkpt extensions in converted geojson #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"brfs": "~1.4.3",
"coveralls": "~2.11.12",
"cz-conventional-changelog": "^1.2.0",
"eslint": "^3.3.0",
"eslint": "^3.19.0",
"glob": "^7.0.5",
"istanbul": "~0.4.4",
"tape": "~4.6.0"
Expand Down
4 changes: 2 additions & 2 deletions test/data/gdal.gpx.geojson
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"name": "waypoint name",
"cmt": "waypoint comment",
"desc": "waypoint description",
"type": "type",
"time": "2007-11-25T17:58:00+01:00",
"links": [
{
Expand All @@ -86,8 +87,7 @@
"text": "text3",
"type": "type3"
}
],
"type": "type"
]
},
"geometry": {
"type": "Point",
Expand Down
3 changes: 3 additions & 0 deletions test/data/gxmultitrack.kml.geojson
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"name": "\n12/04/2014 11:24 AM (départ)\n ",
"styleUrl": "#start",
"styleHash": "1a92f2da",
"icon": "http://maps.google.com/mapfiles/kml/paddle/grn-circle.png",
"description": "\n\n ",
"timestamp": "2014-04-12T14:26:16.702Z"
}
Expand Down Expand Up @@ -170,6 +171,7 @@
"name": "\n12/04/2014 11:24 AM\n ",
"styleUrl": "#track",
"styleHash": "23ae7d4c",
"icon": "http://earth.google.com/images/kml-icons/track-directional/track-0.png",
"description": "\n\n ",
"stroke": "#ff0000",
"stroke-opacity": 0.4980392156862745,
Expand Down Expand Up @@ -224,6 +226,7 @@
"name": "\n12/04/2014 11:24 AM (fin)\n ",
"styleUrl": "#end",
"styleHash": "-8cb39ad",
"icon": "http://maps.google.com/mapfiles/kml/paddle/red-circle.png",
"description": "\nCréé par Google Mes parcours sur Android\n\nNom : 12/04/2014 11:24 AM\nType d'activité : course à pied\nDescription : -\nDistance totale : 10,43 km (6,5 mi)\nDurée totale : 1:13:38\nDurée du déplacement : 1:08:20\nVitesse moyenne : 8,49 km/h (5,3 mi/h)\nVitesse moyenne de déplacement : 9,16 km/h (5,7 mi/h)\nVitesse max. : 12,84 km/h (8,0 mi/h)\nVitesse moyenne : 7:04 min/km (11:22 min/mi)\nAllure moyenne : 6:33 min/km (10:33 min/mi)\nVitesse maximale : 4:40 min/km (7:31 min/mi)\nÉlévation max. : 1020 m (3347 pi)\nÉlévation min. : 678 m (2223 pi)\nDénivelé : 1095 m (3593 pi)\nInclinaison max. : 21 %\nInclinaison min. : -24 %\nDate d'enregistrement : 12/04/2014 11:24 AM\n\n ",
"timestamp": "2014-04-12T15:38:07.678Z"
}
Expand Down
116 changes: 58 additions & 58 deletions test/data/missing_hr.gpx.geojson
Original file line number Diff line number Diff line change
@@ -1,7 +1,62 @@
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"name": "missing hr",
"time": "2017-05-27T04:00:00Z",
"coordTimes": [
[
"2017-05-27T04:00:00Z",
"2017-05-27T04:00:01Z",
"2017-05-27T04:00:02Z"
],
[
"2017-05-27T04:01:00Z",
"2017-05-27T04:01:01Z",
"2017-05-27T04:01:02Z",
"2017-05-27T04:01:03Z",
"2017-05-27T04:01:04Z",
"2017-05-27T04:01:13Z",
"2017-05-27T04:01:20Z",
"2017-05-27T04:01:27Z",
"2017-05-27T04:01:34Z",
"2017-05-27T04:01:38Z"
],
[
"2017-05-27T04:02:00Z",
"2017-05-27T04:02:01Z",
"2017-05-27T04:02:02Z"
]
],
"heartRates": [
[
null,
null,
null
],
[
104,
104,
104,
105,
105,
null,
107,
116,
120,
131
],
[
null,
null,
null
]
]
},
"geometry": {
"type": "MultiLineString",
"coordinates": [
[
[
Expand Down Expand Up @@ -89,63 +144,8 @@
435.04
]
]
],
"type": "MultiLineString"
},
"properties": {
"coordTimes": [
[
"2017-05-27T04:00:00Z",
"2017-05-27T04:00:01Z",
"2017-05-27T04:00:02Z"
],
[
"2017-05-27T04:01:00Z",
"2017-05-27T04:01:01Z",
"2017-05-27T04:01:02Z",
"2017-05-27T04:01:03Z",
"2017-05-27T04:01:04Z",
"2017-05-27T04:01:13Z",
"2017-05-27T04:01:20Z",
"2017-05-27T04:01:27Z",
"2017-05-27T04:01:34Z",
"2017-05-27T04:01:38Z"
],
[
"2017-05-27T04:02:00Z",
"2017-05-27T04:02:01Z",
"2017-05-27T04:02:02Z"
]
],
"heartRates": [
[
null,
null,
null
],
[
104,
104,
104,
105,
105,
null,
107,
116,
120,
131
],
[
null,
null,
null
]
],
"name": "missing hr",
"time": "2017-05-27T04:00:00Z"
},
"type": "Feature"
]
}
}
],
"type": "FeatureCollection"
]
}
3 changes: 3 additions & 0 deletions test/data/multitrack.kml.geojson
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"name": "8/8/2013 17:20 (Start)",
"styleUrl": "#start",
"styleHash": "5a145216",
"icon": "http://maps.google.com/mapfiles/kml/paddle/grn-circle.png",
"timestamp": "2013-08-08T15:20:40.000Z"
}
},
Expand Down Expand Up @@ -109,6 +110,7 @@
"name": "8/8/2013 17:20",
"styleUrl": "#track",
"styleHash": "66da7df6",
"icon": "http://earth.google.com/images/kml-icons/track-directional/track-0.png",
"stroke": "#ff0000",
"stroke-opacity": 0.4980392156862745,
"stroke-width": 4,
Expand Down Expand Up @@ -148,6 +150,7 @@
"name": "8/8/2013 17:20 (End)",
"styleUrl": "#end",
"styleHash": "-77e98803",
"icon": "http://maps.google.com/mapfiles/kml/paddle/red-circle.png",
"timestamp": "2013-08-08T16:25:57.000Z"
}
}
Expand Down
3 changes: 3 additions & 0 deletions test/data/non_gx_multitrack.kml.geojson
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"name": "8/8/2013 17:20 (Start)",
"styleUrl": "#start",
"styleHash": "5a145216",
"icon": "http://maps.google.com/mapfiles/kml/paddle/grn-circle.png",
"timestamp": "2013-08-08T15:20:40.000Z"
}
},
Expand Down Expand Up @@ -109,6 +110,7 @@
"name": "8/8/2013 17:20",
"styleUrl": "#track",
"styleHash": "66da7df6",
"icon": "http://earth.google.com/images/kml-icons/track-directional/track-0.png",
"stroke": "#ff0000",
"stroke-opacity": 0.4980392156862745,
"stroke-width": 4,
Expand Down Expand Up @@ -148,6 +150,7 @@
"name": "8/8/2013 17:20 (End)",
"styleUrl": "#end",
"styleHash": "-77e98803",
"icon": "http://maps.google.com/mapfiles/kml/paddle/red-circle.png",
"timestamp": "2013-08-08T16:25:57.000Z"
}
}
Expand Down
4 changes: 3 additions & 1 deletion test/data/style.kml.geojson
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"name": "Google Earth - New Polygon",
"styleUrl": "#a",
"styleHash": "-1d694122",
"icon": "http://myserver.com/icon.jpg",
"description": "Here is some descriptive text"
}
},
Expand All @@ -31,7 +32,8 @@
"properties": {
"name": "Google Earth - New Path",
"styleUrl": "#b",
"styleHash": "-5b6ad921"
"styleHash": "-5b6ad921",
"icon": "http://myserver.com/icon.jpg"
}
}
]
Expand Down
Loading