【发布时间】:2014-10-21 18:18:46
【问题描述】:
我正在尝试制作一些城市地图,我想对它们进行一些扭曲,以使最密集的部分(在本例中为曼哈顿)在最终地图上显得更宽一些。我很难在城市级别找到好的投影示例。
我只是想要一个能制作出更好看的纽约市地图的投影,但这可能过于主观,所以假设我想增肥曼哈顿。我在下面尝试过的可重现代码:
library(ggplot2)
library(maptools)
shpny.tf <- tempfile()
download.file(
"http://www2.census.gov/geo/tiger/TIGER2010/COUNTY/2010/tl_2010_36_county10.zip" ,
shpny.tf ,
mode = 'wb'
)
shpny.uz <- unzip( shpny.tf , exdir = tempdir() )
ny.shp <- readShapePoly( shpny.uz[ grep( 'shp$' , shpny.uz ) ] )
# limit the shapefile to only the five boroughs
nyc.shp <- subset( ny.shp , as.numeric( as.character( COUNTYFP10 ) ) %in% c( 5 , 47 , 61 , 81 , 85 ) )
# prepare for plotting
nyc <- fortify( nyc.shp )
# make a plot
p <- qplot( data = nyc , x = long , y = lat )
# default plot
p
# these two seem like good candidates for fattening,
# but i'm not sure how to make them take up more space on the right and left side
p + coord_map("ortho", orientation=c(41, -74, -25))
p + coord_map("azequalarea",orientation=c(41,-74,-22))
# this one's okay but still not ideal
p + coord_map("lagrange")
# this one is named for new york yet i can't get it to do anything useful
p + coord_map("newyorker",r=10)
理想情况下,结果应该更接近这张纽约地铁地图中的比例。我知道只有投影不可能有这么大的失真,我只是好奇是否有任何投影可以使地图更接近那个理想形状。谢谢!
【问题讨论】:
-
仅仅选择一个合适的投影并不是一个真正的特定编程问题,因此与本网站无关。也许可以尝试Cross Validated 获取一般可视化建议或Geographic Information Systems 获取有关图形信息系统的信息。
-
您能否发布一个五区地图的链接或图片,看起来更像您想要的那样?
-
在一周内设置了 10 次赏金之后,您甚至还拥有良好的声誉......
-
@DavidArenburg 哈哈我已经破产了,我承认 ;)
-
@miles2know 鉴于此 q 已收到三个答案 - 所有这些都推荐非投影解决方案 - 我认为你是对的:/
标签: r map ggplot2 shapefile map-projections