Search code examples
rdictionaryggplot2shapefilemap-projections

What projections in r will fatten a city map?


I'm trying to make some city maps, and I'd like to distort them a bit so that the densest parts (manhattan in this case) appear to be a little wider on the final map. I'm having a hard time finding good projection examples at the city-level.

I'd just like a projection that makes a better-looking map of New York City, but that might be too subjective, so let's say I want to fatten Manhattan. Reproducible code of what I've tried below:

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)

ideally, the result would look closer to the proportions in this new york subway map. i understand that this much of a distortion isn't possible with only projection, i'm just curious if any projections could make the map closer to that ideal shape. thanks!

enter image description here


Solution

  • # 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 ) )
    

    enter image description here