Ant*_*ico 5 r map shapefile ggplot2 map-projections
我正在尝试制作一些城市地图,我想稍微扭曲它们,以便在最终地图上最密集的部分(在这种情况下是曼哈顿)看起来有点宽.我很难在城市一级找到好的投影例子.
我只是想投影制作一张看起来更好看的纽约市地图,但这可能过于主观,所以我想说我想让曼哈顿变胖.我在下面尝试过的可重现代码:
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)
Run Code Online (Sandbox Code Playgroud)
理想情况下,结果将更接近纽约地铁地图中的比例.据我所知,只有投影才能实现这种扭曲,我只是好奇,如果有任何投影可以使地图更接近理想的形状.谢谢!

# this is clearly insane
p +
geom_map(map=nyc, aes(map_id=id, group=group), fill="white", color="black") +
coord_map( "globular" , orientation = c( 40.55 , -74.11 , -24 ) )
Run Code Online (Sandbox Code Playgroud)
