You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importstravaplotasstravas=strava.plot('20130902-171543-Ride.gpx')
s.color("gyroscope")
# display the plots.show()
# save it as an images.save('20130902-171543-Ride.png')
Plots this:
On Strava it looks like this:
What's going on is the "normal" maps aren't being plotted with 1:1 units. Looking at this next map from here shows nice squares, but one grid in one direction is 0N0.50, and to the other is 0E1.00:
Of course, the reason is the earth is a sphere and flat maps are projections. At the equator one degree of lat/lon are roughly equal. As we go further north, one degree of latitude gets to zero. At 60N, we're 2/3 up.
Rather than appending latitude and longitude values, this uses a Mercator projection calculations to come up with x and y values instead. Dummy, unit map width and height values are used, as we don't know and don't need to know the final size as matplotlib will take care of that.
I've not submitted this as a PR, as any settings applied after the Mercator calculations, like padding, are using the original lat/lon scale, not the new x/y scale. But this works for my purposes as I'm not showing any scale or adjusting those settings.
This is a similar issue to marcusvolz/strava#5.
Plots of tracks in Helsinki, at 60 degrees north, look a bit squashed, as no map projection is used.
Plots this:
On Strava it looks like this:
What's going on is the "normal" maps aren't being plotted with 1:1 units. Looking at this next map from here shows nice squares, but one grid in one direction is 0N0.50, and to the other is 0E1.00:
Of course, the reason is the earth is a sphere and flat maps are projections. At the equator one degree of lat/lon are roughly equal. As we go further north, one degree of latitude gets to zero. At 60N, we're 2/3 up.
So we probably want to scale the latitude by how far away from the equator we are. Perhaps something along the lines of https://stackoverflow.com/a/14457180/724176?
The text was updated successfully, but these errors were encountered: