-
Notifications
You must be signed in to change notification settings - Fork 57
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
"Squashed" maps #5
Comments
That's strange, the addition of coord_equal() should provide the true aspect ratio. Could you provide your data? |
Here's a single coastal route: 20130902-171543-Ride.gpx.zip On Strava it looks like this: > data <- process_data('.')
> p1 <- plot_facets(data)
> ggsave("plots/facets003.png", p1, width = 20, height = 20, units = "cm")
> p2a <- plot_map(data, lon_min = 24.8312, lon_max = 25.2022, lat_min = 60.1301, lat_max = 60.2893)
> ggsave("plots/map003.png", p2a, width = 20, height = 20, units = "cm", dpi = 600) Which produces this facet: But this map: |
The facet uses scales = "free" and doesn't use coord_equal, so it will scale to fill out the facet. The map uses coord_equal, so the x and y axes have the same relative scale (i.e. one unit on the x-axis is the same length as one unit on the y-axis). From the raw data it looks like the ranges are [60.14653. 60.16568] and [24.920093, 24.961935], so it looks like the map is being plotted correctly - maybe the data has been corrupted? As a temp solution you can just remove coord_equal from the map code and then manually resize the plot in RStudio before saving. |
I think the data is fine, the first map is from 7 years of data and different devices, and if some were corrupt I'd expect the map as a whole to show more square, with some odd points. But the map as a whole looks accurate, except being "squashed". The last file uploads and shows fine on GPSies: Those ranges look correct. Here's one corner of those ranges, 60.14653N, 24.920093E: And the other one, 60.16568N, 24.961935E: So I guess 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: I wonder why that is? |
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. |
Thanks for figuring this out. It makes sense, Helsinki is further from the equator than Melbourne which is why my one didn't seem to be particularly distorted. |
My maps look great, but also a bit squashed. If I plot it with Helsinki's bounding box:
I get a map like this:
When it normally looks more like this:
http://maps.stamen.com/#toner/11/60.1934/25.0715
Do you know what accounts for this, and how I could square it off? Thanks!
The text was updated successfully, but these errors were encountered: