I am having some trouble with ggplot's fortify. When using Open Streetmap shapefile, fortify is loosing the order of some lines. The order must be correct in the file as qgis and the sp package have no problem with the plots.
我对ggplot的fortify有些不满。使用Open Streetmap shapefile时,fortify是放松了一些线条的顺序。订单必须在文件中正确,因为qgis和sp包对图没有问题。
Here is an example with some roads of a German town.
Qgis:
Qgis:
Looks good in sp:
在sp:看起来不错
But after using fortify, there are some problems in ggplot like the enter/exit of the highway:
但在使用了加固技术后,在ggplot中出现了一些问题,如高速公路的出入口:
Here is a little example of that highway-part
(数据)
library(ggplot)
library(sp)
plot(sample_shape)
ggplot(data = fortify(sample_shape), aes(x = long, y = lat, group = group), size = 0.05) + geom_line() + theme_bw()
Again, sp looks nice, ggplot does not:
sp看起来不错,ggplot没有:
Any help or hints is/are highly appreciated!
非常感谢您的帮助和提示!