Skip to content

Commit

Permalink
synch with master
Browse files Browse the repository at this point in the history
Merge branch 'master' into get-.ini-from-sf

# Conflicts:
#	inst/osmconf.ini
  • Loading branch information
agila5 committed Nov 12, 2024
2 parents c7d5a59 + cfc9866 commit 61041da
Show file tree
Hide file tree
Showing 60 changed files with 961 additions and 555 deletions.
19 changes: 11 additions & 8 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
^codecov\.yml$
^codemeta\.json$
^CRAN-RELEASE$
my-rhub-commands.R
pkgdown/
notes.R
vignettes/_useR2021.rmd
docs/
^my-rhub-commands\.R$
^pkgdown$
^notes\.R$
^vignettes/_useR2021\.rmd$
^docs$
^\.lintr$
my-covr.R
internal-tests.R
tests/testthat/README.md
^my-covr\.R$
^internal-tests\.R$
^tests/testthat/README\.md$
^CRAN-SUBMISSION$
^\.devcontainer$

3 changes: 3 additions & 0 deletions .devcontainer/.devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"build": { "dockerfile": "Dockerfile"}
}
40 changes: 40 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM ubuntu:22.04
# minimal docker file to get sp and sf running on ubunty 16.04 image,
# using gdal/geos/proj from ppa:ubuntugis/ubuntugis-unstable

# MAINTAINER "edzerpebesma" [email protected]

RUN apt-get update && apt-get install -y software-properties-common dirmngr
RUN add-apt-repository ppa:ubuntugis/ubuntugis-unstable

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

# add the R 4.0 repo from CRAN -- adjust 'focal' to 'groovy' or 'bionic' as needed
RUN add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"

RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9

RUN apt-get update
RUN apt-get upgrade -y

RUN export DEBIAN_FRONTEND=noninteractive; apt-get -y update \
&& apt-get install -y \
devscripts \
gdb \
git \
libcairo2-dev \
libcurl4-openssl-dev \
libexpat1-dev \
libpq-dev \
libsqlite3-dev \
libudunits2-dev \
make \
pandoc \
qpdf \
r-base-dev \
sqlite3 \
subversion \
valgrind \
vim \
tk-dev \
wget
5 changes: 4 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
on:
push:
branches: [main, master]
paths-ignore:
- '.devcontainer/**'
pull_request:
branches: [main, master]

Expand All @@ -12,6 +14,7 @@ jobs:
R-CMD-check:
if: "!(contains(github.event.head_commit.message, 'skip ci')||contains(github.event.head_commit.message, 'ci skip')||contains(github.event.head_commit.message, 'skip-ci')||contains(github.event.head_commit.message, 'ci-skip')||contains(github.event.head_commit.message, 'skip_ci')||contains(github.event.head_commit.message, 'ci_skip'))"
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
R: ['3.6.3', 'release']
Expand All @@ -20,7 +23,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup R
uses: r-lib/actions/setup-r@v2
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
on:
push:
branches: [main, master]
paths-ignore:
- '.devcontainer/**'
release:
types: [published]

Expand All @@ -16,8 +18,9 @@ jobs:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
on:
push:
branches: [main, master]
paths-ignore:
- '.devcontainer/**'
pull_request:
branches: [main, master]

Expand All @@ -12,11 +14,12 @@ jobs:
test-coverage:
if: "!(contains(github.event.head_commit.message, 'skip ci')||contains(github.event.head_commit.message, 'ci skip')||contains(github.event.head_commit.message, 'skip-ci')||contains(github.event.head_commit.message, 'ci-skip')||contains(github.event.head_commit.message, 'skip_ci')||contains(github.event.head_commit.message, 'ci_skip'))"
runs-on: ubuntu-latest
timeout-minutes: 30
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
Expand All @@ -28,5 +31,5 @@ jobs:
needs: coverage

- name: Test coverage
run: covr::codecov()
run: covr::codecov(quiet = FALSE)
shell: Rscript {0}
10 changes: 5 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Package: osmextract
Type: Package
Title: Download and Import Open Street Map Data Extracts
Version: 0.4.1.9000
Version: 0.5.1.900
Authors@R: c(
person("Andrea", "Gilardi", email = "andrea.gilardi@unimib.it", role=c("aut", "cre"),
person("Andrea", "Gilardi", email = "andrea.gilardi@polimi.it", role=c("aut", "cre"),
comment = c(ORCID = "0000-0002-9424-7439")),
person("Robin", "Lovelace", role = c("aut"),
comment = c(ORCID = "0000-0001-5679-6536")),
Expand All @@ -19,11 +19,11 @@ Description: Match, download, convert and import Open Street Map data extracts
License: GPL-3
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
Roxygen: list(markdown = TRUE)
URL: https://docs.ropensci.org/osmextract/, https://github.com/ropensci/osmextract
BugReports: https://github.com/ropensci/osmextract/issues
Depends: R (>= 3.5.0)
Depends: R (>= 3.6.0)
Imports:
sf (>= 0.8.1),
utils,
Expand All @@ -37,6 +37,6 @@ Suggests:
covr,
withr
VignetteBuilder: knitr
Language: en_GB
Language: en-GB
Config/testthat/edition: 3
Config/build/copy-method: link
60 changes: 42 additions & 18 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,57 @@
# osmextract (development version)

### MAJOR CHANGES
* Fixed a bug in `oe_match()` that occurred every time `oe_match()` found an exact match between the input `place` and a non-default OSM data provider (i.e. non Geofabrik). In those cases, the downloaded file was named as `geofabrik_xyz.osm.pbf` instead of `different-provider_xyz.osm.pbf`. Reported by @GretaTimaite, thanks. See #246. This is a quite major bug, and we suggest you erase all `.pbf` and `.gpkg` files stored in the persistent download directory (see also `?oe_clean`).
* Fixed a bug in `oe_get_keys()` that occurred when the value for a given key was either empty or equal to `\n` (#250).
* Fixed a bug in `oe_vectortranslate()` that occurred when the attributed specified in the `extra_tags` argument included the character `:`. In fact, the presence of attributes like "lanes:left" always triggered the vectortranslate operations (#260).
* We implemented a new function named `oe_get_boundary()` that can be used to obtain administrative geographical boundaries of a given area (#206).
* Added a new function named `read_poly()` to read `.poly` files (#277).
* All the databases storing the data for the supported providers were updated. For simplicity, some fields were removed from the saved objects. More precisely, we removed the columns `pbf.internal`, `history`, `taginfo` and `updates` from `geofabrik_zones`; `last_modified`, `type`, `base_url` and `poly_url` from `bbbike_zones`.
* The function `oe_match_pattern()` now accepts `numeric`/`sfc`/`bbox`/`sf` inputs, following the same logic as `oe_match()` (#266).

* 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)).
* 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)).

# osmextract 0.5.1

### MINOR CHANGES

* Updated the code in the main vignette to fix a bug in the `ogr2ogr` options detected by GDAL v3.9 ([#291](https://github.com/ropensci/osmextract/issues/291)).
* More informative error message in case of malformed query ([#290](https://github.com/ropensci/osmextract/issues/290)).
* Updated the Open Street Map providers. In particular:
- The bbbike databse has a new area: Los Angeles
- The geofabrik database has a new area: United Kingdom
- The openstreetmap.fr database has 51 new areas: Asia/Europe/Philippines and its [subregions](https://download.openstreetmap.fr/polygons/asia/philippines/)/Turkey and its [subregions](https://download.openstreetmap.fr/polygons/europe/turkey/)/Portugal's [subregions](https://download.openstreetmap.fr/polygons/europe/portugal/)/Tuvalu/Chukotka Autonomous Okrug/Fiji/France Metro Dom Com Nc/Kiribati.

# osmextract 0.5.0

### MAJOR CHANGES
* Fixed a bug in `oe_match()` that occurred every time the function found an exact match between the input `place` and a non-default OSM data provider (i.e. everything but Geofabrik). In those cases, the downloaded file was named as `geofabrik_xyz.osm.pbf` instead of `differentprovider_xyz.osm.pbf`. Reported by @GretaTimaite, thanks. See [#246](https://github.com/ropensci/osmextract/pull/246). This is a major bug and, for safety, we suggest you erase all `.pbf` and `.gpkg` files currently stored in the persistent download directory (see also `oe_clean()`).
* Fixed a bug in `oe_get_keys()` that occurred when the value for a given key was either empty or equal to `\n` ([#250](https://github.com/ropensci/osmextract/issues/250)).
* Fixed a bug in `oe_vectortranslate()` that occurred when the attributes specified in the `extra_tags` argument included the character `:`. In fact, the presence of attributes like "lanes:left" always triggered the vectortranslate operations ([#260](https://github.com/ropensci/osmextract/issues/260)).
* We implemented a new function named `oe_get_boundary()` that can be used to obtain administrative geographical boundaries of a given area ([#206](https://github.com/ropensci/osmextract/issues/206)).
* Added a new function named `read_poly()` to read `.poly` files ([#277](https://github.com/ropensci/osmextract/issues/277)).
* All the databases storing the data for the supported providers were updated. For simplicity, some fields were removed from the saved objects. More precisely, we removed the columns `pbf.internal`, `history`, `taginfo`, `updates`, `bz2`, and `shp` from `geofabrik_zones`; `last_modified`, `type`, `base_url` and `poly_url` from `bbbike_zones`.
* The function `oe_match_pattern()` now accepts `numeric`/`sfc`/`bbox`/`sf` inputs, following the same logic as `oe_match()` ([#266](https://github.com/ropensci/osmextract/issues/266)).

### MINOR CHANGES
* The `boundary` argument can be specified using `bbox` objects. The `bbox` object is converted to `sfc` object with `sf::st_as_sfc` and preserves the same CRS.
* Added a more informative error message when `oe_get()` or `oe_read()` are run with empty or unnamed arguments in `...` (#234 and #241).
* The `boundary` argument can be specified using `bbox` objects. The `bbox` object is converted to `sfc` object with `sf::st_as_sfc()` and preserves the same CRS.
* Added a more informative error message when `oe_get()` or `oe_read()` are run with empty or unnamed arguments in `...` ([#234](https://github.com/ropensci/osmextract/issues/234) and [#241](https://github.com/ropensci/osmextract/issues/241)).
* The function `oe_get_keys()` gains a new argument named `download_directory` that can be used to specify the path of the directory that stores the `.osm.pbf` files.
* Included a new function named `oe_clean()` to remove all `.pbf` and `.gpkg` files stored in a given directory. Default value is `oe_download_directory()`.
* Added a message to `oe_download()` and removed a warning from `oe_read()`. The message is printed every time a user downloads a new OSM extract from a certain provider, whereas the warning used to be raised when a given `query` selected a layer different from the `layer` argument (#240).
* Added two new parameters to `oe_find` named `return_pbf` and `return_gpkg`. They can be used to select which file formats should the function return (#253).
* Added a more informative error message in case `oe_download()` fails explaining that partially downloaded `.pbf` files should be removed to avoid problems while running other functions (#221).
* We are experimenting with the new features of `testthat` and we implemented the so-called test-fixtures to run tests in a more isolated environment (#255). This is however still experimental for us.
* Added more informative error and warning messages to `oe_get_keys()` (#251).
* Added a message to `oe_download()` and removed a warning from `oe_read()`. The message is printed every time a user downloads a new OSM extract from a certain provider, whereas the warning used to be raised when a given `query` selected a layer different from the `layer` argument ([#240](https://github.com/ropensci/osmextract/issues/240)).
* Added two new parameters to `oe_find()` named `return_pbf` and `return_gpkg`. They can be used to select which file formats should the function return ([#253](https://github.com/ropensci/osmextract/pull/253)).
* Added a more informative error message in case `oe_download()` fails, explaining that partially downloaded `.pbf` files should be removed to avoid problems while running other functions ([#221](https://github.com/ropensci/osmextract/issues/221)).
* We are experimenting with the new (i.e. third edition) features of `testthat` and we implemented the so-called test-fixtures to run tests in a more isolated environment ([#255](https://github.com/ropensci/osmextract/pull/255)). This is however still experimental for us.
* Added more informative error and warning messages to `oe_get_keys()` ([#251](https://github.com/ropensci/osmextract/issues/251)).
* The file path returned by `oe_download()` is specified using `/` instead of `\\` separator on Windows.
* `oe_download()` takes into account the `timeout` option again. Unfortunately, we forgot to adjust the code when switching from `download.file` to `httr`.
* The `oe_vectortranslate()` function tries to correct the possible geometrical problem of the input `boundary` using `sf::st_make_valid()`.
* Updated the `geofabrik_zones` database (#270).

* The `oe_vectortranslate()` function tries to correct the possible geometrical problem(s) of the input `boundary` using `sf::st_make_valid()`.
* Updated the `geofabrik_zones` database ([#270](https://github.com/ropensci/osmextract/issues/270)).

### DOCUMENTATION FIXES
* Update description for `boundary` and `boundary_type` arguments.
* The main vignette and all examples save their files in `tempdir()` (#247).
* The main vignette and all examples save their files in `tempdir()` ([#247](https://github.com/ropensci/osmextract/issues/247)).

# osmextract 0.4.1

Expand Down
Loading

0 comments on commit 61041da

Please sign in to comment.