Skip to content

Commit

Permalink
Merge pull request #163 from munterfi/feature/prepare-major-release
Browse files Browse the repository at this point in the history
Feature/prepare major release
  • Loading branch information
munterfi authored Sep 18, 2023
2 parents 62b9177 + a37209f commit c0f3bb0
Show file tree
Hide file tree
Showing 27 changed files with 40 additions and 533 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: hereR
Type: Package
Title: 'sf'-Based Interface to the 'HERE' REST APIs
Version: 0.9.1.9000
Version: 1.0.0
Authors@R: c(
person("Merlin", "Unterfinger", role = c("aut", "cre"), email = "info@munterfinger.ch", comment = c(ORCID = "0000-0003-2020-2366")),
person("Daniel", "Possenriede", role = "ctb", comment = c(ORCID = "0000-0002-6738-9845")))
Expand Down
7 changes: 0 additions & 7 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ S3method(geocode,list)
S3method(weather,character)
S3method(weather,sf)
S3method(weather,sfc)
export(autocomplete)
export(autosuggest)
export(connection)
export(flow)
Expand All @@ -16,18 +15,12 @@ export(isoline)
export(reverse_geocode)
export(route)
export(route_matrix)
export(set_auth)
export(set_currency)
export(set_freemium)
export(set_key)
export(set_proxy)
export(set_rate_limit)
export(set_verbose)
export(station)
export(traffic)
export(unset_auth)
export(unset_key)
export(unset_proxy)
export(weather)
import(data.table)
import(sf)
5 changes: 4 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# version 0.9.1.9000
# version 1.0.0

Please note that there are breaking changes introduced in this major version release for the `weather()`, `flow()`, and `incidents()` functions. Be sure to review the updated documentation to understand how these changes may affect your usage.

- Upgrade HERE Traffic API to v7 for `flow()` and `incident()` requests (closes [#158](https://github.com/munterfi/hereR/issues/158))
- Upgrade HERE Destination Weather API to v3 for `weather()`.
Expand All @@ -8,6 +10,7 @@
- Replace GitHub actions with current versions from **r-lib/actions**.
- Bugfix: Fix decoding of polylines with NA value in `intermodal_route()`.
- Bugfix: NAs introduced by coercion, do not convert `snowFall` column to numeric in weather observation request.
- Bugfix: Remove `defunct.R` and `deprecated.R` to avoid NOTE (closes [#162](https://github.com/munterfi/hereR/issues/162)).

# version 0.9.1

Expand Down
4 changes: 2 additions & 2 deletions R/autosuggest.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ autosuggest <- function(address, results = 5, url_only = FALSE) {
result <- data.table::rbindlist(
append(
list(template),
lapply(data, function(con) {
lapply(data, function(res) {
count <<- count + 1
df <- jsonlite::fromJSON(con)
df <- jsonlite::fromJSON(res)
if (length(nrow(df$items)) == 0) {
return(NULL)
}
Expand Down
4 changes: 3 additions & 1 deletion R/checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ qualified_keys <- c(
)

.check_qualified_query_list <- function(query) {
if (any(names(query) %in% qualified_keys) || length(query) == 0) stop("Invalid format, needs to be 'list(query, ...)'.")
if (any(names(query) %in% qualified_keys) || length(query) == 0) {
stop("Invalid format, needs to be 'list(query, ...)'.")
}
}

.check_qualified_query <- function(query) {
Expand Down
6 changes: 3 additions & 3 deletions R/connection.R
Original file line number Diff line number Diff line change
Expand Up @@ -194,18 +194,18 @@ connection <- function(origin, destination, datetime = Sys.time(),
routes <- data.table::rbindlist(
append(
list(template),
lapply(data, function(con) {
lapply(data, function(res) {
count <<- count + 1

# Parse JSON
df <- jsonlite::fromJSON(con)
df <- jsonlite::fromJSON(res)
if (is.null(df$routes$sections)) {
return(NULL)
}

# Connections
rank <- 0
connections <- data.table::data.table(
data.table::data.table(
id = ids[count],

# Segments
Expand Down
182 changes: 0 additions & 182 deletions R/defunct.R

This file was deleted.

37 changes: 0 additions & 37 deletions R/deprecated.R

This file was deleted.

4 changes: 2 additions & 2 deletions R/flow.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ flow <- function(aoi, min_jam_factor = 0, url_only = FALSE) {
ids <- .get_ids(data)
count <- 0
geoms <- list()
flow_data <- data.table::rbindlist(lapply(data, function(con) {
flow_data <- data.table::rbindlist(lapply(data, function(res) {
count <<- count + 1
df <- jsonlite::fromJSON(con)
df <- jsonlite::fromJSON(res)
# parse geometries
geoms <<- append(
geoms,
Expand Down
4 changes: 2 additions & 2 deletions R/geocode.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@ geocode.character <- function(address, alternatives = FALSE, sf = TRUE, url_only
geocoded <- data.table::rbindlist(
append(
list(template),
lapply(data, function(con) {
lapply(data, function(res) {
count <<- count + 1
df <- jsonlite::fromJSON(con)
df <- jsonlite::fromJSON(res)
if (length(df$items) == 0) {
geocode_failed <<- c(geocode_failed, address[count])
return(NULL)
Expand Down
6 changes: 3 additions & 3 deletions R/intermodal_route.R
Original file line number Diff line number Diff line change
Expand Up @@ -163,18 +163,18 @@ intermodal_route <- function(origin, destination, datetime = Sys.time(),
routes <- data.table::rbindlist(
append(
list(template),
lapply(data, function(con) {
lapply(data, function(res) {
count <<- count + 1

# Parse JSON
df <- jsonlite::fromJSON(con)
df <- jsonlite::fromJSON(res)
if (is.null(df$routes$sections)) {
return(NULL)
}

# Connections
rank <- 0
routes <- data.table::data.table(
data.table::data.table(
id = ids[count],

# Segments
Expand Down
4 changes: 2 additions & 2 deletions R/isoline.R
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ isoline <- function(poi, datetime = Sys.time(), arrival = FALSE,
isolines <- data.table::rbindlist(
append(
list(template),
lapply(data, function(con) {
lapply(data, function(res) {
count <<- count + 1
df <- jsonlite::fromJSON(con)
df <- jsonlite::fromJSON(res)
if (is.null(df$isolines)) {
return(NULL)
}
Expand Down
4 changes: 2 additions & 2 deletions R/reverse_geocode.R
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ reverse_geocode <- function(poi, results = 1, sf = TRUE, url_only = FALSE) {
result <- data.table::rbindlist(
append(
list(template),
lapply(data, function(con) {
lapply(data, function(res) {
count <<- count + 1
df <- jsonlite::fromJSON(con)
df <- jsonlite::fromJSON(res)
if (length(nrow(df$items)) == 0) {
return(NULL)
}
Expand Down
Loading

0 comments on commit c0f3bb0

Please sign in to comment.