Plot a GPX track in Python
up vote
0
down vote
favorite
I have a set of adjacent nodes obtained from a .graphml file from Open Street Map and I would like to know how I can represent them in such a way that they appear linked using GPX.
I have tried this to get the XML file:
import gpxpy
import gpxpy.gpx
def print_route(node):
gpx = gpxpy.gpx.GPX()
gpx_track = gpxpy.gpx.GPXTrack()
gpx.tracks.append(gpx_track)
gpx_segment = gpxpy.gpx.GPXTrackSegment()
gpx_track.segments.append(gpx_segment)
while node.parent is not None:
x, y = GRAPH.node_position(node.nodeOSM)
gpx_segment.points.append(gpxpy.gpx.GPXTrackPoint(x, y))
node = nodo.parent
return gpx.to_xml()
where every OSM node is enclosed in a node object with attributes such as its parent node.
python gpx
add a comment |
up vote
0
down vote
favorite
I have a set of adjacent nodes obtained from a .graphml file from Open Street Map and I would like to know how I can represent them in such a way that they appear linked using GPX.
I have tried this to get the XML file:
import gpxpy
import gpxpy.gpx
def print_route(node):
gpx = gpxpy.gpx.GPX()
gpx_track = gpxpy.gpx.GPXTrack()
gpx.tracks.append(gpx_track)
gpx_segment = gpxpy.gpx.GPXTrackSegment()
gpx_track.segments.append(gpx_segment)
while node.parent is not None:
x, y = GRAPH.node_position(node.nodeOSM)
gpx_segment.points.append(gpxpy.gpx.GPXTrackPoint(x, y))
node = nodo.parent
return gpx.to_xml()
where every OSM node is enclosed in a node object with attributes such as its parent node.
python gpx
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a set of adjacent nodes obtained from a .graphml file from Open Street Map and I would like to know how I can represent them in such a way that they appear linked using GPX.
I have tried this to get the XML file:
import gpxpy
import gpxpy.gpx
def print_route(node):
gpx = gpxpy.gpx.GPX()
gpx_track = gpxpy.gpx.GPXTrack()
gpx.tracks.append(gpx_track)
gpx_segment = gpxpy.gpx.GPXTrackSegment()
gpx_track.segments.append(gpx_segment)
while node.parent is not None:
x, y = GRAPH.node_position(node.nodeOSM)
gpx_segment.points.append(gpxpy.gpx.GPXTrackPoint(x, y))
node = nodo.parent
return gpx.to_xml()
where every OSM node is enclosed in a node object with attributes such as its parent node.
python gpx
I have a set of adjacent nodes obtained from a .graphml file from Open Street Map and I would like to know how I can represent them in such a way that they appear linked using GPX.
I have tried this to get the XML file:
import gpxpy
import gpxpy.gpx
def print_route(node):
gpx = gpxpy.gpx.GPX()
gpx_track = gpxpy.gpx.GPXTrack()
gpx.tracks.append(gpx_track)
gpx_segment = gpxpy.gpx.GPXTrackSegment()
gpx_track.segments.append(gpx_segment)
while node.parent is not None:
x, y = GRAPH.node_position(node.nodeOSM)
gpx_segment.points.append(gpxpy.gpx.GPXTrackPoint(x, y))
node = nodo.parent
return gpx.to_xml()
where every OSM node is enclosed in a node object with attributes such as its parent node.
python gpx
python gpx
asked Nov 19 at 17:41
Kolorao
12
12
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53380003%2fplot-a-gpx-track-in-python%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown