# install.packages("devtools")
devtools::install_github("YsoSirius/getOSM")
The package offers an interactive interface to
the download service of Geofabrik GmbH. If osmconvert is
set as system variable, the function convertOSM
can also be
used. The same goes for osmosis, which enables the function
osmosisR
.
Some basic information about the data size per country
and continent can be plotted as treemap with treemapOSM
or
as mapview plot with mapviewOSM
dest <- getOSM()
dest <- getOSM(exclude = "md5", r1 = 2, r2=13)
dest <- getOSM(filterby="shp", r1 = 2, r2=13)
dest <- getOSM(filterby="osm", exclude = "md5", r1 = 2, r2 =13, dest="")
dest <- getOSM(filterby="osm", exclude = "md5", r1 = 2, r2 =13, dest="")
convertOSM(dest, cm=T, cb = F, cw = F, fname = "capverde4", ext = "pbf")
sumry <- summaryOSM()
treemapOSM(sumry)
mapviewOSM(sumry, mergeby = "country", unit = "gb")
The functions graphcycleOSM
and graphcarOSM
are used for bicycle and car routing.
## Download Comores Data
dest <- getOSM(filterby="osm", exclude = "md5", r1 = 2, r2 =13)
## Filters only highway elements for pedestrian routing and converts to osm
graphpedesOSM(dest)
## The Database must already exist beforahand.
dblist <- list(dbname="test", dbuser="postgres", dbhost="localhost",
dbport="5432", dbpwd="postgres")
cmd <- postgresOSM(dest, dblist)
ways <- sfOSM(dblist)
r <- filterSF(ways, tf=c("footway", "path"), plot=T);