Questions tagged [osmar]

An R package to provide access to OpenStreetMap data and work with the data in R.

25 questions
6
votes
1 answer

Openstreetmap / iGraph - Create a center_bbox from center_bbox osmar object / make it efficient

the call get_osm(muc_bbox, src) takes quite a lot of time (46.151 sec) while loading from a big osm file. I was wondering is it possible to create a center_bbox from a center_bbox so to say on demand? Load a big file into memory once and create…
Andreas
  • 397
  • 4
  • 18
  • 37
6
votes
1 answer

Error in osmar::get_osm() downloading OSM data fails: SYSTEM or PUBLIC, the URI is missing

I was following a tutorial on how to download OSM data in R with osmar package, so the code is: library(osmar) src <- osmsource_api() bb <- center_bbox(174.76778, -36.85056, 700, 700) ua <- get_osm(bb, source = src) When I run this last line, this…
La Cordillera
  • 410
  • 5
  • 17
6
votes
1 answer

How do I divide a very large OpenStreetMap file into smaller files in R without running out of memory?

I am currently looking to have map files that are no larger than the sizes of municipalities in Mexico (at largest, about 3 degrees longitude/latitude across). However, I have been running into memory issues (at the very least) when trying to do…
Max Candocia
  • 4,294
  • 35
  • 58
4
votes
1 answer

Change the weight of an Edge of a path in a open street map based igraph based on a list of gps coordinates

i would like to change weight of parts of a route based on gps coordinates. For that i would like to get gps coordinates of an edge of a calculated route then compare them with a list of coordinates i have and if the coordinates in my list matches…
Andreas
  • 397
  • 4
  • 18
  • 37
4
votes
1 answer

Convert SpatialLinesDataframe with multiple line elements to KML in R

I try to convert a spatial object (a river retrieved from OSM) with multiple lines to KML. For an object with a single line it is easy with kmlLine. However, with multiple lines the below approach is not working and my attempts to adapt the example…
Kay
  • 2,702
  • 6
  • 32
  • 48
3
votes
1 answer

Using Open Street Map in R with get_osm {osmar}

I'd like to append a set of ways which are related and give a district's boundary. I tried the following but got stuck up: require(osmar) require(XML) # a set of open street map ways (lines) related as given by a relation.. # (if connected these…
Kay
  • 2,702
  • 6
  • 32
  • 48
3
votes
1 answer

Optimize the runtime: change the weight of edges in an igraph takes long time. Is there a way to optimize it?

I am searching for a set of edges in an igraph built from an osmar object and would like to change the weight of these. Since my graph is quite big, this task takes quite a long time. Since I run this function in a loop the runtime grows even…
Andreas
  • 397
  • 4
  • 18
  • 37
2
votes
1 answer

How to extract osm data using osmar

Similar to this question I get an error from get_osm library(maptools) library(osmar) url <- "http://osmar.r-forge.r-project.org/" file <- "muenchen.osm.gz" # download.file(sprintf("%s%s", url, file), file) # gzip is linux only, on windows I…
Christoph
  • 6,841
  • 4
  • 37
  • 89
2
votes
1 answer

Osmar package in R "Error in file(con, "r") : cannot open the connection"

I am trying to run the osmar package on my windows 10, R 3.4.2, and have correctly installed osmosis. However when I try to run the code: >library("osmar") > >src <- osmsource_osmosis(file = "c:/users/ben_c/Documents/FYP/FYP_NL_Map/muenchen.osm",…
bCul
  • 21
  • 2
2
votes
1 answer

Plotting roads from an osmar object on a ggplot map

I have created an elevation map from a raster object (elevation data from worldclim) of my study sites in China, using ggplot code (simplified version of the code). The relevant raster objects have been downloaded from worldclim.org and converted to…
Aud
  • 23
  • 2
2
votes
1 answer

Issues with OSM encoding

I am having troubles with the encoding of the osm data. Here is a reproducible example using the osmar package: osmData <- osmar::get_osm(osmar::center_bbox(23.334360, 42.693180, 100, 100)) osmData$nodes$tags[80:100, ] #the output is not UTF-8 I…
deann
  • 756
  • 9
  • 24
2
votes
3 answers

How to extract specific values from a DEM (digital elevation model)?

I'm trying to calculate elevation data for hiking routes, using open data (avoiding licensing constraints like Google). I was able to read a public DEM of my country (with a 10-metres resolution) using readGDAL (from package RGDAL), and…
mbranco
  • 101
  • 2
  • 8
1
vote
1 answer

What is the basis for the weight function of igraph route object created from osmar object?

I was wondering how is the weight value calculated while creating igraph route object from osmar object? Is there a maximum? library(osmar) library(igraph) src <- osmsource_api(url = "https://api.openstreetmap.org/api/0.6/") muc_bbox <-…
Andreas
  • 397
  • 4
  • 18
  • 37
1
vote
0 answers

No such file or directoryError in file(con, "r") : cannot open the connection, what solution do you have for this Error?

I am a new R-user and currently face a problem with Osmar package while I am running the chunk: osm_file_path <- "~/Downloads/berlin-latest.osm" src <- osmsource_osmosis(file = "/Users/Soodi/Downloads/berlin-latest.osm") ber_bbox <-…
soodi
  • 11
  • 1
1
vote
2 answers

info package osmar R

I'm using osmar package with R but I would like to understand some outputs. In general I would like to understand these…
dag
  • 59
  • 1
  • 8
1
2