File tree Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -305,7 +305,41 @@ knitr::kable(size_df)
305305
306306# Other command line tools for working with OSM data {#sec-command-line}
307307
308- ...
308+ ## pyrosm
309+
310+ Install the Python package ` pyrosm ` as follows:
311+
312+ ``` bash
313+ pip install pyrosm
314+ ```
315+
316+ ``` {r}
317+ #| include: false
318+ # Install pyrosm if not already installed:
319+ # Installed Python packages:
320+ py_pkgs = reticulate::py_list_packages()
321+ py_pkg_names = py_pkgs$package
322+ if (!"pyrosm" %in% py_pkg_names) {
323+ reticulate::py_install("pyrosm")
324+ }
325+ ```
326+
327+ Search for Poznan in extracts available from ` pyrosm ` as follows (note: this fails for me currently):
328+
329+ ``` {python}
330+ #| eval: false
331+ import pyrosm
332+ from pyrosm import OSM
333+ import geopandas as gpd
334+
335+ poznan_file = pyrosm.get_data("Poznan")
336+ osm = OSM(poznan_file)
337+ poznan_cycling = osm.get_network(network_type="cycling")
338+ poznan_cycling.plot()
339+ ```
340+
341+ ``` {r}
342+ ```
309343
310344# Ideas for using OSM data {#sec-ideas}
311345
You can’t perform that action at this time.
0 commit comments