rosmosis

Helper Functions to Download and Run Osmosis

https://github.com/dhersz/rosmosis

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.4%) to scientific vocabulary

Keywords

openstreetmap osmosis r
Last synced: 9 months ago · JSON representation

Repository

Helper Functions to Download and Run Osmosis

Basic Info
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
openstreetmap osmosis r
Created over 2 years ago · Last pushed over 2 years ago
Metadata Files
Readme License Codemeta

README.Rmd

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# rosmosis

[![CRAN
status](https://www.r-pkg.org/badges/version/rosmosis)](https://CRAN.R-project.org/package=rosmosis)
[![B
status](https://github.com/dhersz/rosmosis/workflows/check/badge.svg)](https://github.com/dhersz/rosmosis/actions?query=workflow%3Acheck)
[![Codecov test
coverage](https://codecov.io/gh/dhersz/rosmosis/branch/main/graph/badge.svg)](https://app.codecov.io/gh/dhersz/rosmosis?branch=main)
[![Repo
status](https://www.repostatus.org/badges/latest/concept.svg)](https://www.repostatus.org/#concept)

**rosmosis** allows one to download and run
[Osmosis](https://wiki.openstreetmap.org/wiki/Osmosis) from R. Osmosis is a
command line application for processing OpenStreetMap data which consists of
several different pluggable components that can be chained to perform large
operations. The package currently does not aim to offer functions that covers
the entirety of Osmosis' API, and instead offers limited support to running
Osmosis through the `run_osmosis()` function.

## Installation

Development version:

```r
# install.packages("remotes")
remotes::install_github("dhersz/rosmosis")
```

## Usage

Currently, the main (and only) way of using Osmosis with **rosmosis** is through
`run_osmosis()`. This function takes the path to Osmosis and a string listing
the command that should be sent to it.

Let's see how it works using the sample data bundled with the package. In the
following code snippet, we use the function to crop a PBF file using a bounding
box. We also use the `osmosis_path()` function, that looks for a previously
cached Osmosis application and returns its path, downloading it if necessary.

```{r}
library(rosmosis)
library(ggplot2)

cur_osm <- system.file("extdata/cur.osm.pbf", package = "rosmosis")

fs::file_size(cur_osm)

original_pbf <- sf::st_read(cur_osm, layer = "lines", quiet = TRUE)
ggplot(original_pbf) + geom_sf()

output_path <- tempfile("cropped_cur", fileext = ".osm.pbf")

osmosis_command <- paste0(
  "--read-pbf ", cur_osm, " ",
  "--bounding-box ",
  "top=-25.4290 left=-49.2792 bottom=-25.4394 right=-49.2629 ",
  "completeWays=yes ",
  "--write-pbf ", output_path
)

run_osmosis(osmosis_path(), osmosis_command, echo = FALSE, spinner = FALSE)

fs::file_size(output_path)

cropped_pbf <- sf::st_read(output_path, layer = "lines", quiet = TRUE)
ggplot(cropped_pbf) + geom_sf()
```

Owner

  • Name: Daniel Herszenhut
  • Login: dhersz
  • Kind: user
  • Company: Ipea - Institute for Applied Economic Research

research assistant @ipeaGIT

CodeMeta (codemeta.json)

{
  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
  "@type": "SoftwareSourceCode",
  "identifier": "rosmosis",
  "description": "Allows one to download and run Osmosis from R. Osmosis is a command line application for processing OpenStreetMap data which consists of several different pluggable components that can be chained to perform large operations. The package currently does not aim to offer functions that covers the entirety of Osmosis' API, and instead offers limited support to running Osmosis through a helper function.",
  "name": "rosmosis: Helper Functions to Download and Run Osmosis",
  "codeRepository": "https://github.com/dhersz/rosmosis",
  "issueTracker": "https://github.com/dhersz/rosmosis/issues",
  "license": "https://spdx.org/licenses/MIT",
  "version": "0.0.0.9000",
  "programmingLanguage": {
    "@type": "ComputerLanguage",
    "name": "R",
    "url": "https://r-project.org"
  },
  "runtimePlatform": "R version 4.3.1 (2023-06-16)",
  "author": [
    {
      "@type": "Person",
      "givenName": "Daniel",
      "familyName": "Herszenhut",
      "email": "dhersz@gmail.com",
      "@id": "https://orcid.org/0000-0001-8066-1105"
    }
  ],
  "maintainer": [
    {
      "@type": "Person",
      "givenName": "Daniel",
      "familyName": "Herszenhut",
      "email": "dhersz@gmail.com",
      "@id": "https://orcid.org/0000-0001-8066-1105"
    }
  ],
  "softwareSuggestions": [
    {
      "@type": "SoftwareApplication",
      "identifier": "covr",
      "name": "covr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "ggplot2",
      "name": "ggplot2"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "rmarkdown",
      "name": "rmarkdown"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "sf",
      "name": "sf"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "testthat",
      "name": "testthat",
      "version": ">= 3.0.0"
    }
  ],
  "softwareRequirements": {
    "1": {
      "@type": "SoftwareApplication",
      "identifier": "checkmate",
      "name": "checkmate"
    },
    "2": {
      "@type": "SoftwareApplication",
      "identifier": "fs",
      "name": "fs"
    },
    "3": {
      "@type": "SoftwareApplication",
      "identifier": "httr2",
      "name": "httr2"
    },
    "4": {
      "@type": "SoftwareApplication",
      "identifier": "processx",
      "name": "processx"
    },
    "5": {
      "@type": "SoftwareApplication",
      "identifier": "rlang",
      "name": "rlang"
    },
    "6": {
      "@type": "SoftwareApplication",
      "identifier": "tools",
      "name": "tools"
    },
    "7": {
      "@type": "SoftwareApplication",
      "identifier": "zip",
      "name": "zip"
    },
    "SystemRequirements": null
  },
  "fileSize": "613.125KB",
  "readme": "https://github.com/dhersz/rosmosis/blob/main/README.md",
  "contIntegration": [
    "https://github.com/dhersz/rosmosis/actions?query=workflow%3Acheck",
    "https://app.codecov.io/gh/dhersz/rosmosis?branch=main"
  ],
  "developmentStatus": "https://www.repostatus.org/#concept",
  "keywords": [
    "openstreetmap",
    "osmosis",
    "r"
  ]
}

GitHub Events

Total
Last Year

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 19
  • Total Committers: 1
  • Avg Commits per committer: 19.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Daniel Herszenhut d****z@g****m 19

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels