Skip to content

Commit

Permalink
Merge branch 'master' into version
Browse files Browse the repository at this point in the history
  • Loading branch information
Robinlovelace authored Jan 20, 2025
2 parents 087bdde + 35f1434 commit 37704e5
Show file tree
Hide file tree
Showing 20 changed files with 53 additions and 46 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: osmextract
Type: Package
Title: Download and Import Open Street Map Data Extracts
Version: 0.5.1.900
Version: 0.5.2.9000
Authors@R: c(
person("Andrea", "Gilardi", email = "[email protected]", role=c("aut", "cre"),
comment = c(ORCID = "0000-0002-9424-7439")),
Expand Down
9 changes: 6 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# osmextract (development version)

* Added a `version` argument to `oe_match` to simplify the download of old extracts from Geofabrik provider ([#295](https://github.com/ropensci/osmextract/issues/295))

# osmextract 0.5.2

### MAJOR CHANGES

* Bump minimum R version from 3.5.0 to 3.6.0 since that's a requirement for one of our indirect dependencies (i.e. [evaluate](https://cran.r-project.org/package=evaluate)).
* Adjusted the SQL syntax used inside `oe_get_network` so that the queries are compatible with GDAL 3.10 ([#298](https://github.com/ropensci/osmextract/issues/291)).
* Added a `version` argument to `oe_match` to simplify the download of old extracts from Geofabrik provider ([#295](https://github.com/ropensci/osmextract/issues/295))
* The output of `oe_get_network` does not drop elements tagged as `access = 'no'` as long as the `foot`/`bicycle`/`motor_vehicle` (according to the chosen mode of transport) key is equal to `yes`, `permissive`, or `designated` ([#289](https://github.com/ropensci/osmextract/issues/289)).

### MINOR CHANGES

* Updated the `osmconf.ini` file to be in synch with the GDAL version.
* Added `oneway` as column by default when using `oe_get_network(mode = "driving")`, which indicates if a link represents an uni-directional road ([#296](https://github.com/ropensci/osmextract/issues/296))
* Furthermore, `oe_get_network(mode = "driving")` also include the `motor_vehicle` field (see [#303](https://github.com/ropensci/osmextract/pull/303)).
* Added `oneway` column by default when using `oe_get_network(mode = "driving")`, which indicates if a link represents a uni-directional road ([#296](https://github.com/ropensci/osmextract/issues/296))
* Furthermore, `oe_get_network(mode = "driving")` always include the `motor_vehicle` field (see [#303](https://github.com/ropensci/osmextract/pull/303)).

# osmextract 0.5.1

Expand Down
2 changes: 1 addition & 1 deletion R/get-key-values.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' be explicitly added to the `.gpkg` file. All the other keys are
#' automatically stored using an `other_tags` field with a syntax compatible
#' with the PostgreSQL HSTORE type. See
#' [here](https://gdal.org/drivers/vector/osm.html#driver-capabilities) for
#' [here](https://gdal.org/en/stable/drivers/vector/osm.html#driver-capabilities) for
#' more details.
#'
#' When the argument `values` is `TRUE`, then the function returns a named
Expand Down
2 changes: 1 addition & 1 deletion R/get-network.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#'
#' @details The definition of usable transport network was taken from the Python
#' packages
#' [osmnx](https://github.com/gboeing/osmnx/blob/main/osmnx/_downloader.py) and
#' [osmnx](https://raw.githubusercontent.com/gboeing/osmnx/refs/heads/main/osmnx/_overpass.py) and
#' [pyrosm](https://pyrosm.readthedocs.io/en/latest/) and several other
#' documents found online, i.e.
#' <https://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Access_restrictions>,
Expand Down
4 changes: 2 additions & 2 deletions R/get.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
#' argument `options`. Set by default. Check details in the introductory
#' vignette and the help page of [oe_vectortranslate()].
#' @param osmconf_ini The configuration file. See documentation at
#' [gdal.org](https://gdal.org/drivers/vector/osm.html). Check details in the
#' [gdal.org](https://gdal.org/en/stable/drivers/vector/osm.html). Check details in the
#' introductory vignette and the help page of [oe_vectortranslate()]. Set by
#' default.
#' @param extra_tags Which additional columns, corresponding to OSM tags, should
Expand Down Expand Up @@ -92,7 +92,7 @@
#' @param boundary_type A character vector of length 1 specifying the type of
#' spatial filter. The `spat` filter selects only those features that
#' intersect a given area, while `clipsrc` also clips the geometries. Check
#' the examples and also [here](https://gdal.org/programs/ogr2ogr.html) for
#' the examples and also [here](https://gdal.org/en/stable/programs/ogr2ogr.html) for
#' more details.
#' @param download_only Boolean. If `TRUE`, then the function only returns the
#' path where the matched file is stored, instead of reading it. `FALSE` by
Expand Down
10 changes: 5 additions & 5 deletions R/vectortranslate.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' This function is used to translate a `.osm.pbf` file into `.gpkg` format.
#' The conversion is performed using
#' [ogr2ogr](https://gdal.org/programs/ogr2ogr.html#ogr2ogr) via the
#' [ogr2ogr](https://gdal.org/en/stable/programs/ogr2ogr.html) via the
#' `vectortranslate` utility in [sf::gdal_utils()] . It was created following
#' [the
#' suggestions](https://github.com/OSGeo/gdal/issues/2100#issuecomment-565707053)
Expand All @@ -18,7 +18,7 @@
#' The `.osm.pbf` files processed by GDAL are usually categorized into 5
#' layers, named `points`, `lines`, `multilinestrings`, `multipolygons` and
#' `other_relations`. Check the first paragraphs
#' [here](https://gdal.org/drivers/vector/osm.html) for more details. This
#' [here](https://gdal.org/en/stable/drivers/vector/osm.html) for more details. This
#' function can covert only one layer at a time, and the parameter `layer` is
#' used to specify which layer of the `.osm.pbf` file should be converted.
#' Several layers with different names can be stored in the same `.gpkg` file.
Expand Down Expand Up @@ -75,11 +75,11 @@
#' * `"-overwrite` is used to delete an existing layer and recreate
#' it empty;
#' * `"-oo", paste0("CONFIG_FILE=", osmconf_ini)` is used to set the
#' [Open Options](https://gdal.org/drivers/vector/osm.html#open-options)
#' [Open Options](https://gdal.org/en/stable/drivers/vector/osm.html#open-options)
#' for the `.osm.pbf` file and change the `CONFIG` file (in case the user
#' asks for any extra tag or a totally different CONFIG file);
#' * `"-lco", "GEOMETRY_NAME=geometry"` is used to change the
#' [layer creation options](https://gdal.org/drivers/vector/gpkg.html?highlight=gpkg#layer-creation-options)
#' [layer creation options](https://gdal.org/en/stable/drivers/vector/gpkg.html#layer-creation-options)
#' for the `.gpkg` file and modify the name of the geometry column;
#' * `layer` indicates which layer should be converted.
#'
Expand All @@ -100,7 +100,7 @@
#' introductory vignette.
#'
#' See also the help page of [`sf::gdal_utils()`] and
#' [ogr2ogr](https://gdal.org/programs/ogr2ogr.html) for more examples and
#' [ogr2ogr](https://gdal.org/en/stable/programs/ogr2ogr.html) for more examples and
#' extensive documentation on all available options that can be tuned during
#' the vectortranslate process.
#'
Expand Down
3 changes: 2 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ knitr::include_graphics("man/figures/89990770-22bf2480-dc83-11ea-9092-7645945349

The package is designed to complement `osmdata`, which has advantages over `osmextract` for small datasets: `osmdata` is likely to be quicker for datasets less than a few MB in size, provides up-to-date data and has an intuitive interface.
`osmdata` can provide data in a range of formats, while `osmextract` only returns [`sf`](https://github.com/r-spatial/sf) objects.
`osmextract`'s niche is that it provides a fast way to download large OSM datasets in the highly compressed `pbf` format and read them in via the fast C library [GDAL](https://gdal.org/drivers/vector/osm.html) and the popular R package for working with geographic data [`sf`](https://github.com/r-spatial/sf).
`osmextract`'s niche is that it provides a fast way to download large OSM datasets in the highly compressed `pbf` format and read them in via the fast C library [GDAL](https://gdal.org/en/stable/drivers/vector/osm.html) and the popular R package for working with geographic data [`sf`](https://github.com/r-spatial/sf).

## Installation

Expand Down Expand Up @@ -246,3 +246,4 @@ By contributing to this project, you agree to abide by its terms.
<!-- :) -->
<!-- :) -->
<!-- :) -->
<!-- :) -->
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ formats, while `osmextract` only returns
[`sf`](https://github.com/r-spatial/sf) objects. `osmextract`’s niche is
that it provides a fast way to download large OSM datasets in the highly
compressed `pbf` format and read them in via the fast C library
[GDAL](https://gdal.org/drivers/vector/osm.html) and the popular R
package for working with geographic data
[GDAL](https://gdal.org/en/stable/drivers/vector/osm.html) and the
popular R package for working with geographic data
[`sf`](https://github.com/r-spatial/sf).

## Installation
Expand Down Expand Up @@ -118,7 +118,7 @@ attaching this geographic data package as follows:

``` r
library(sf)
#> Linking to GEOS 3.11.2, GDAL 3.6.2, PROJ 9.2.0; sf_use_s2() is TRUE
#> Linking to GEOS 3.11.2, GDAL 3.7.2, PROJ 9.3.0; sf_use_s2() is TRUE
```

### Warnings:
Expand Down Expand Up @@ -149,9 +149,9 @@ can be read-in by changing the `layer` argument:
osm_lines = oe_get("Isle of Wight", stringsAsFactors = FALSE, quiet = TRUE)
osm_points = oe_get("Isle of Wight", layer = "points", stringsAsFactors = FALSE, quiet = TRUE)
nrow(osm_lines)
#> [1] 51226
#> [1] 51875
nrow(osm_points)
#> [1] 67783
#> [1] 68660
par(mar = rep(0, 4))
plot(st_geometry(osm_lines), xlim = c(-1.59, -1.1), ylim = c(50.5, 50.8))
plot(st_geometry(osm_points), xlim = c(-1.59, -1.1), ylim = c(50.5, 50.8))
Expand All @@ -167,7 +167,8 @@ roads. The column names in the `osm_lines` object are as follows:
``` r
names(osm_lines) # default variable names
#> [1] "osm_id" "name" "highway" "waterway" "aerialway"
#> [6] "barrier" "man_made" "z_order" "other_tags" "geometry"
#> [6] "barrier" "man_made" "railway" "z_order" "other_tags"
#> [11] "geometry"
```

Once imported, you can use all functions for data frames in base R and
Expand Down Expand Up @@ -266,7 +267,6 @@ states that
> terms of:
- 1. This License;

- 2. A later version of this License similar in spirit to this

See the [Introducing osmextract
Expand Down Expand Up @@ -324,3 +324,4 @@ project, you agree to abide by its terms.
<!-- :) -->
<!-- :) -->
<!-- :) -->
<!-- :) -->
6 changes: 3 additions & 3 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"codeRepository": "https://github.com/ropensci/osmextract",
"issueTracker": "https://github.com/ropensci/osmextract/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.5.1",
"version": "0.5.2",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down Expand Up @@ -121,7 +121,7 @@
"@type": "SoftwareApplication",
"identifier": "R",
"name": "R",
"version": ">= 3.5.0"
"version": ">= 3.6.0"
},
"2": {
"@type": "SoftwareApplication",
Expand Down Expand Up @@ -172,7 +172,7 @@
},
"SystemRequirements": null
},
"fileSize": "3676.091KB",
"fileSize": "3678.118KB",
"releaseNotes": "https://github.com/ropensci/osmextract/blob/master/NEWS.md",
"readme": "https://github.com/ropensci/osmextract/blob/master/README.md",
"contIntegration": ["https://github.com/ropensci/osmextract/actions", "https://app.codecov.io/gh/ropensci/osmextract?branch=master"],
Expand Down
5 changes: 3 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## Release summary

- Following the previous reviews, we fixed the invalid URLs (also in the vignette) and added the URI protocol when relevant. Apologies for these troubles.
- We fixed a bug to preserve compatibility with GDAL 3.9 and slightly adjust an error message. We also updated the Open Street Map databases within the package.
- Fixed the invalid language tag in DESCRIPTION file.
- Fixed a bug to preserve compatibility with GDAL 3.10.
- Several minor improvements.

## Test environments

Expand Down
1 change: 1 addition & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ ogr
openstreetmap
org
osm
osmapiR
osmdata
osmnx
param
Expand Down
Binary file modified man/figures/README-iow1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-points-lines-iow-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-points-lines-iow-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions man/oe_get.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/oe_get_keys.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/oe_get_network.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/oe_read.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions man/oe_vectortranslate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 37704e5

Please sign in to comment.