I was Inspired from Ben Frys all Streets project. There he plotted all streets of the United States of America (about 240 million segments). I tried this first for the countries in Europe, France has about 22 million segments, with the goal to get an all street map of Europe.
osmconvert france.osm.pbf --out-o5m –o="france.o5m"
In the second step, I filtered all relevant streets with the osmfilter tool
osmfilter france.o5m --keep="highway=motorway =motorway_link =trunk =trunk_link =primary =primary_link =secondary =secondary_link =tertiary =tertiary_link =living_street =pedestrian =residential =unclassified =service" --drop-author --drop-version > france_streets.osm
Similar as in the first step, this file is transformed to a osm-file format and by Quantum Gis into the ESRI-shapefile format. This ESRI-data file is now loaded into R.
The geom_segment function for plotting the lines was originares form the blog-post Great Maps with ggplot2. The function conv_sp_lines_to_seg converts the shp-data to lines described by two 2-dim points (start and end-point).
library(sp) library(ggplot2) library(maptools) source("../convert_shp_line_to_seg.R") source("../geom_segment2.R") shpFrance < - readShapeLines("france.shp") linesFrance <- conv_sp_lines_to_seg(shpFrance) rm(shpFrance) streets <- geom_segment2(data=linesFrance, aes(xend=elon, yend=elat), size=.025, color="black") p <- ggplot(linesFrance, aes(x=slon,y=slat)) + streets + scale_x_continuous("", breaks=NULL) + scale_y_continuous("", breaks=NULL) + theme(panel.background=element_rect(fill='#f5f4e0'))
- The data OpenStreetMap-data is published under CC BY-SA-licence
I plotted this map on my notbook with 16GB RAM which is completely used at the rendering for the 22 million segments. It seems that for plotting Europe another solution has to be developed.