Changelog
Source:NEWS.md
opencage (development version)
- opencage now supports an
address_only
parameter, see “New optional API parameter ‘address_only’”, (#151). - The geocoding functions will not send a query to the API anymore if no API key is present (#133).
-
NA
s are allowed again for theplacename
orlatitude
/longitude
arguments (also empty strings forplacename
). These queries are not sent to the API. An empty/NA
response will be returned depending on the specific query (#143). -
opencage_forward()
,opencage_reverse()
, andopencage_key()
are now deprecated (leveling up from soft-deprecated, #147).
Internals
- {opencage} now uses {testthat} 3e for unit tests (#141).
- GitHub action workflows have been updated (#142, #149, #152). Styler and document workflows have been added (#153).
- Use {lintr} version 3.0 and add “package development” linters (#144).
-
countrycodes
source and script were moved todata-raw
(#146). - Add CITATION.cff and a corresponding GitHub action (#148).
- Select expressions inside
oc_forward_df()
andoc_reverse_df()
now use"column"
instead of.data$column
, because the latter is deprecated as of tidyselect v1.2.0 (#150). - The opencage code now uses a consistent style (
styler::tidyverse_style()
) and all internal functions are documented (#153).
opencage 0.2.1
CRAN release: 2021-02-14
This is a major rewrite of the {opencage} package. opencage_forward()
and opencage_reverse()
have been deprecated and are superseded by oc_forward()
and oc_reverse()
, respectively. In addition there are two new functions oc_forward_df()
and oc_reverse_df()
, which geocode place names or addresses into geographic coordinates (latitude and longitude) or vice versa, and return a data frame.
The new features include:
-
oc_forward()
andoc_reverse()
return either lists of data frames, JSON strings, GeoJSON strings, or URLs to be sent to the API (the latter for debugging purposes). -
oc_forward_df()
andoc_reverse_df()
take a data frame or vectors as input and return a data frame with the geocoding results, optionally with the source data frame bound to the results data frame. - Almost all arguments of the geocoding functions are vectorised (the exceptions being
output
), so it is possible to serially (reverse) geocode lists of locations or coordinates. The geocoding functions show a progress indicator when more than oneplacename
orlatitude
/longitude
pair is provided. - The forward geocoding functions now support multiple
countrycode
s in accordance with the OpenCage API (#44). Thecountrycode
s can now be provided in upper or lower case (#47). - A helper function
oc_bbox()
now makes it easier to create a list of bounding boxes from numeric vectors, bbox objects or data frames. -
oc_forward()
andoc_forward_df()
now support OpenCage’sproximity
parameter. The results of the geocoding request will be biased towards that location (#60). - A helper function
oc_points()
now makes it easier to create a list of point coordinates from numeric vectors or data frames to pass to theproximity
argument for example. - All geocoding functions now support OpenCage’s
roadinfo
parameter (#65). If set toTRUE
, OpenCage attempts to match the nearest road (rather than an address) and provides additional road and driving information. - Language tags passed to the
language
argument are not validated anymore, since the language tags used by OpenStreetMap and hence OpenCage do not always conform with the IETF BCP 47 standard (#90). Thelanguagecodes
, which were stored in {opencage} as external data, have therefore been omitted from the package. In addition, it is now possible to specifylanguage = "native"
, so OpenCage will attempt to return the results in the “official” language of the country. - http requests are now handled by {crul}, not {httr} (#37).
- API calls are now rate limited (#32). The default limit is set to 1 call per second as per the API limit of the Free Trial plan.
- {opencage} settings like the OpenCage API key or the API rate limit can be configured with
oc_config()
. If you want OpenCage to have no record of the contents of your queries, you can also set theno_record
parameter for the active R session withoc_config()
(as opposed to providing the parameter with each function call). Alloc_config()
settings can be set more permanently viaoptions()
or environment variables, seehelp(oc_config)
.
Breaking changes
-
opencage_forward()
,opencage_reverse()
, andopencage_key()
are soft-deprecated. -
opencage_forward()
andopencage_reverse()
will always output strings as characters, i.e. they won’t coerce to factor depending on thestringsAsFactor
option. -
opencage_key()
returns the OpenCage API key invisibly. -
NA
values are not allowed anymore for theplacename
orlatitude
/longitude
arguments, because OpenCage throws a HTTP 400 ‘bad query’ error when the query is empty (#98).
Minor changes
- The column name for
countrycodes
is nowcode
, notCode
. - HTTP error messages are now returned directly from the API and are therefore always up-to-date. The previously used responses in
code_message
, which were stored in {opencage} as external data, have been deleted. For more information on OpenCage’s HTTP status codes see https://opencagedata.com/api#codes. - Fixed two URLs, one of which was rejected on the v0.2.0 submission.
opencage 0.1.2
CRAN release: 2017-05-12
- Added a
abbrv
parameter, see https://blog.opencagedata.com/post/160294347883/shrtr-pls.
opencage 0.1.1
- Added a
no_record
parameter, see https://blog.opencagedata.com/post/145602604628/more-privacy-with-norecord-parameter