Jan-Philipp Kolb
22 Februar 2017
Logo Overpass API
The Overpass API is a read-only API that serves up custom selected parts of the OSM map data.
Spielplätze Mannheim
Export Rohdaten
Link1 <- "http://www.overpass-api.de/api/interpreter?
data=[maxsize:1073741824][timeout:900];area[name=\""
library(XML)
place <- "Mannheim"
type_obj <- "node"
object <- "leisure=playground"
InfoList <- xmlParse(paste(Link1,place,"\"];",
type_obj,"(area)[",object,"];out;",sep=""))
Spielplätze in Mannheim
Die Liste der ID’s mit dem Wert playground:
node_id <- xpathApply(InfoList,
"//tag[@v= 'playground']/parent::node/@ id")
## node_id[[1]]
Erste node id
lat_x <- xpathApply(InfoList,
"//tag[@v= 'playground']/parent::node/@ lat")
# lat_x[[1]];lat_x[[2]]
lat_x <- xpathApply(InfoList,
"//tag[@v= 'playground']/parent::node/@ lon")
Latitude Koordinate
library(devtools)
install_github("Japhilko/gosmd")
library(gosmd)
pg_MA <- get_osm_nodes(object="leisure=playground",
"Mannheim")
info <- extract_osm_nodes(OSM.Data=pg_MA,
value="playground")
leisure | lat | lon | note | |
---|---|---|---|---|
30560755 | playground | 49.51910 | 8.502807 | |
76468450 | playground | 49.49633 | 8.539396 | Rutsche, Schaukel, großer Sandkasten, Tischtennis |
76468534 | playground | 49.49678 | 8.552959 | |
76468535 | playground | 49.49230 | 8.548750 | |
76468536 | playground | 49.50243 | 8.548140 | Schaukel, Rutsche, Sandkasten, Spielhäuser, Tischtennis |
76468558 | playground | 49.49759 | 8.542036 |