🌐 R package for the OpenCage API -- both forward and reverse geocoding 🌐
Switch branches/tags
Clone or download
Latest commit 8bf3b62 May 16, 2018

README.md

opencage

CRAN_Status_Badge Build Status AppVeyor Build Status codecov.io

Installation

Install the package with:

install.packages("opencage")

Or install the development version using devtools with:

library("devtools")
install_github("ropensci/opencage")

This package is an interface to the OpenCage API that allows forward and reverse geocoding. To use the package, you will need an API key. To get an API key for OpenCage geocoding, register at https://geocoder.opencagedata.com/pricing. The free API key provides up to 2,500 calls a day. For ease of use, save your API key as an environment variable as described at http://stat545.com/bit003_api-key-env-var.html.

Both functions of the package will conveniently look for your API key using Sys.getenv("OPENCAGE_KEY") so if your API key is an environment variable called "OPENCAGE_KEY" you don't need to input it manually.

Geocoding

The OpenCage API supports forward and reverse geocoding. Sources of OpenCage are open geospatial data including OpenStreetMap, Yahoo! GeoPlanet, Natural Earth Data, Thematic Mapping, Ordnance Survey OpenSpace, Statistics New Zealand, Zillow, MaxMind, GeoNames, the US Census Bureau and Flickr's shapefiles plus a whole lot more besides. See this page for the full list of credits.

Both forward and reverse geocoding typically return multiple results. Regarding these multiple results, the API doc states, "In cases where the geocoder is able to find multiple matches, the geocoder will return multiple results. The confidence or coordinates for each result should be examined to determine whether each result from an ambiguous query is sufficiently high to warrant using a result or not. A good strategy to reduce ambiguity is to use the optional bounds parameter described below to limit the area searched." Multiple results might mean you get a result for the airport and a road when querying a city name, or results for cities with the same name in different countries.

Below are two simple examples.

Forward geocoding

Forward geocoding is from placename to latitude and longitude tuplet(s).

library("opencage")
output <- opencage_forward(placename = "Sarzeau")
print(output$time_stamp)
## [1] "2017-05-11 20:22:07 CEST"
library("dplyr")
output$rate_info %>% knitr::kable()
limit remaining reset
2500 2285 2017-05-12 02:00:00
output$results %>% knitr::kable()
annotations.DMS.lat annotations.DMS.lng annotations.MGRS annotations.Maidenhead annotations.Mercator.x annotations.Mercator.y annotations.OSM.edit_url annotations.OSM.url annotations.callingcode annotations.currency.decimal_mark annotations.currency.html_entity annotations.currency.iso_code annotations.currency.iso_numeric annotations.currency.name annotations.currency.smallest_denomination annotations.currency.subunit annotations.currency.subunit_to_unit annotations.currency.symbol annotations.currency.symbol_first annotations.currency.thousands_separator annotations.geohash annotations.qibla annotations.sun.rise.apparent annotations.sun.rise.astronomical annotations.sun.rise.civil annotations.sun.rise.nautical annotations.sun.set.apparent annotations.sun.set.astronomical annotations.sun.set.civil annotations.sun.set.nautical annotations.timezone.name annotations.timezone.now_in_dst annotations.timezone.offset_sec annotations.timezone.offset_string annotations.timezone.short_name annotations.what3words.words annotations.wikidata bounds.northeast.lat bounds.northeast.lng bounds.southwest.lat bounds.southwest.lng components._type components.city components.country components.country_code components.county components.postcode components.state confidence formatted geometry.lat geometry.lng components.post_office components.road components.suburb components.village
47° 31' 43.56984'' N 2° 45' 51.11856'' W 30TWT1774963954 IN87om86hv -307709.292 5997281.031 https://www.openstreetmap.org/edit?relation=959447#map=17/47.52877/-2.76420 https://www.openstreetmap.org/?mlat=47.52877&mlon=-2.76420#map=17/47.52877/-2.76420 33 , EUR 978 Euro 1 Cent 100 1 . gbqn3h75jkz3h3mvtyj6 112.34 1494477480 1494469200 1494475320 1494472560 1494531420 1494539820 1494533580 1494536400 Europe/Paris 1 7200 200 CEST gasp.jiggle.creamier Q128716 47.568813 -2.6630649 47.484236 -2.8536849 city Sarzeau France fr Vannes 56370 Brittany 6 56370 Sarzeau, France 47.52877 -2.7642 NA NA NA NA
47° 31' 40.80828'' N 2° 46' 7.68144'' W 30TWT1740363867 IN87om76rr -308221.451 5997154.952 https://www.openstreetmap.org/edit?node=846574100#map=17/47.52800/-2.76880 https://www.openstreetmap.org/?mlat=47.52800&mlon=-2.76880#map=17/47.52800/-2.76880 33 , EUR 978 Euro 1 Cent 100 1 . gbqn2upydmbc15dm9h6g 112.34 1494477480 1494469200 1494475320 1494472560 1494531420 1494539820 1494533580 1494536400 Europe/Paris 1 7200 200 CEST netball.anchored.accomplice NA 47.5280523 -2.7687504 47.5279523 -2.7688504 post_office NA France fr Vannes 56370 Brittany 9 Sarzeau, Rue de la Poste, 56370 Sarzeau, France 47.52800 -2.7688 Sarzeau Rue de la Poste Kerjolis Sarzeau

Reverse geocoding

Reverse geocoding is from latitude and longitude to placename(s).

output2 <- opencage_reverse(latitude = 51.5034070, 
                            longitude = -0.1275920)
print(output2$time_stamp)
## [1] "2017-05-11 20:22:09 CEST"
output2$rate_info %>% knitr::kable()
limit remaining reset
2500 2284 2017-05-12 02:00:00
output2$results %>% knitr::kable()
annotations.DMS.lat annotations.DMS.lng annotations.MGRS annotations.Maidenhead annotations.Mercator.x annotations.Mercator.y annotations.OSGB.easting annotations.OSGB.gridref annotations.OSGB.northing annotations.OSM.edit_url annotations.OSM.url annotations.callingcode annotations.currency.decimal_mark annotations.currency.html_entity annotations.currency.iso_code annotations.currency.iso_numeric annotations.currency.name annotations.currency.smallest_denomination annotations.currency.subunit annotations.currency.subunit_to_unit annotations.currency.symbol annotations.currency.symbol_first annotations.currency.thousands_separator annotations.geohash annotations.qibla annotations.sun.rise.apparent annotations.sun.rise.astronomical annotations.sun.rise.civil annotations.sun.rise.nautical annotations.sun.set.apparent annotations.sun.set.astronomical annotations.sun.set.civil annotations.sun.set.nautical annotations.timezone.name annotations.timezone.now_in_dst annotations.timezone.offset_sec annotations.timezone.offset_string annotations.timezone.short_name annotations.what3words.words annotations.wikidata bounds.northeast.lat bounds.northeast.lng bounds.southwest.lat bounds.southwest.lng components._type components.attraction components.city components.country components.country_code components.house_number components.neighbourhood components.postcode components.road components.state components.state_district components.suburb confidence formatted geometry.lat geometry.lng
51° 30' 12.38472'' N 0° 7' 39.74916'' E 30UXC9933909723 IO91wm40qt -14216.402 6677371.368 530044.64 TQ 300 799 179939.726 https://www.openstreetmap.org/edit?relation=1879842#map=17/51.50344/-0.12771 https://www.openstreetmap.org/?mlat=51.50344&mlon=-0.12771#map=17/51.50344/-0.12771 44 . £ GBP 826 British Pound 1 Penny 100 £ 1 , gcpuvpgj21jujy3ytfp1 118.98 1494476040 1494465780 1494473580 1494470340 1494531660 1494542100 1494534120 1494537420 Europe/London 1 3600 100 BST onions.toned.active Q169101 51.5036483 -0.1273037 51.5032573 -0.1278355 attraction 10 Downing Street London United Kingdom gb 10 St. James's SW1A 2AA Downing Street England Greater London Covent Garden 9 10 Downing Street, London SW1A 2AA, United Kingdom 51.50344 -0.1277081

Output

For both opencage_forward and opencage_reverse functions, the package returns a list with a time stamp for the query, the total number of results, a data.frame (dplyr tbl_df) with information about the remaining calls to the API unless you have an unlimited account, and a data.frame (dplyr tbl_df) with the results corresponding to your query. You can find longitude and latitude for each results as geometry.lat and geometry.lng. Other information includes country and country information, time of sunset and sunrise, geohash (a geocoding system identifying a point with a single string, as explained in many more details here and here; for pure conversion between longitude/latitude and geohashes, see this package). Depending on the data available in the API for the results one gets different columns; there can be a lot to explore!

Parameters

Optional parameters of both opencage_forward and opencage_reverse can make the query more precise:

  • bounds: Provides the geocoder with a hint to the region that the query resides in. This value will restrict the possible results to the supplied region. The bounds parameter should be specified as 4 coordinate points forming the south-west and north-east corners of a bounding box. For example, bounds = c(-0.563160, 51.280430, 0.278970, 51.683979) (min long, min lat, max long, max lat).

Below is an example of the use of bounds where the rectangle given in the second call does not include Europe so that we don't get results for Berlin in Germany.

results1 <- opencage_forward(placename = "Berlin")
results1$results %>% knitr::kable()
annotations.DMS.lat annotations.DMS.lng annotations.MGRS annotations.Maidenhead annotations.Mercator.x annotations.Mercator.y annotations.OSM.edit_url annotations.OSM.url annotations.callingcode annotations.currency.decimal_mark annotations.currency.html_entity annotations.currency.iso_code annotations.currency.iso_numeric annotations.currency.name annotations.currency.smallest_denomination annotations.currency.subunit annotations.currency.subunit_to_unit annotations.currency.symbol annotations.currency.symbol_first annotations.currency.thousands_separator annotations.geohash annotations.qibla annotations.sun.rise.apparent annotations.sun.rise.astronomical annotations.sun.rise.civil annotations.sun.rise.nautical annotations.sun.set.apparent annotations.sun.set.astronomical annotations.sun.set.civil annotations.sun.set.nautical annotations.timezone.name annotations.timezone.now_in_dst annotations.timezone.offset_sec annotations.timezone.offset_string annotations.timezone.short_name annotations.what3words.words annotations.wikidata bounds.northeast.lat bounds.northeast.lng bounds.southwest.lat bounds.southwest.lng components._type components.city components.country components.country_code components.state confidence formatted geometry.lat geometry.lng annotations.currency.alternate_symbols annotations.currency.disambiguate_symbol components.county components.state_code components.town components.city_district
52° 31' 1.33140'' N 13° 23' 19.89564'' E 33UUU9067619766 JO62qm64pc 1490441.066 6860227.862 https://www.openstreetmap.org/edit?node=240109189#map=17/52.51704/13.38886 https://www.openstreetmap.org/?mlat=52.51704&mlon=13.38886#map=17/52.51704/13.38886 49 , EUR 978 Euro 1 Cent 100 1 . u33db8mmzj1t355u0c0j 136.66 1494472560 1494461400 1494470040 1494466620 1494528660 1494540060 1494531180 1494534660 Europe/Berlin 1 7200 200 CEST third.gurgled.such Q64 52.6770365 13.5488599 52.3570365 13.2288599 city Berlin Germany de Berlin 4 Berlin, Germany 52.517037 13.38886 NA NA NA NA NA NA
44° 28' 8.65560'' N 71° 11' 6.81324'' W 19TCK2618626296 FN44jl72sn -7924303.099 5508377.717 https://www.openstreetmap.org/edit?relation=170184#map=17/44.46907/-71.18523 https://www.openstreetmap.org/?mlat=44.46907&mlon=-71.18523#map=17/44.46907/-71.18523 1 . $ USD 840 United States Dollar 1 Cent 100 $ 1 , drvkupke058mhuudkdh3 60.36 1494494400 1494486960 1494492420 1494489900 1494460860 1494468360 1494462900 1494465420 America/New_York 1 -14400 -400 EDT strong.clean.crib Q821244 44.528436 -71.1236419 44.445057 -71.3978579 city Berlin United States of America us New Hampshire 5 Berlin, Coös County, New Hampshire, United States of America 44.469071 -71.18523 US$ US$ Coös County NH NA NA
41° 37' 17.35680'' N 72° 44' 44.34648'' W 18TXM8780710206 FN31po09md -8098008.916 5076059.694 https://www.openstreetmap.org/edit?node=158845944#map=17/41.62149/-72.74565 https://www.openstreetmap.org/?mlat=41.62149&mlon=-72.74565#map=17/41.62149/-72.74565 1 . $ USD 840 United States Dollar 1 Cent 100 $ 1 , drkkb8unxrwwbsuj9tjy 59.3 1494495240 1494488400 1494493380 1494491040 1494460800 1494467640 1494462660 1494465000 America/New_York 1 -14400 -400 EDT frosts.crowds.reef Q821199 41.661488 -72.7056518 41.581488 -72.7856518 city NA United States of America us Connecticut 7 Berlin, Hartford County, Connecticut, United States of America 41.621488 -72.74565 US$ US$ Hartford County CT Berlin NA
39° 47' 28.41432'' N 74° 55' 44.59260'' W 18SWK0607404588 FM29ms89mv -8341064.081 4808298.871 https://www.openstreetmap.org/edit?relation=170680#map=17/39.79123/-74.92905 https://www.openstreetmap.org/?mlat=39.79123&mlon=-74.92905#map=17/39.79123/-74.92905 1 . $ USD 840 United States Dollar 1 Cent 100 $ 1 , dr4dqgy2dw0jyzb7kgs3 57.91 1494496020 1494489540 1494494220 1494492000 1494461040 1494467580 1494462840 1494465120 America/New_York 1 -14400 -400 EDT verdict.rushes.upgrading Q1086827 39.8091498 -74.9079589 39.77601 -74.9661129 city Berlin United States of America us New Jersey 7 Berlin, Camden County, New Jersey, United States of America 39.791226 -74.92905 US$ US$ Camden County NJ NA NA
42° 22' 52.33440'' N 71° 38' 13.24320'' W 19TBG8291095470 FN42ej31nl -7974595.698 5189444.074 https://www.openstreetmap.org/edit?relation=1844156#map=17/42.38120/-71.63701 https://www.openstreetmap.org/?mlat=42.38120&mlon=-71.63701#map=17/42.38120/-71.63701 1 . $ USD 840 United States Dollar 1 Cent 100 $ 1 , drt11g782th32euc09nn 60.04 1494494880 1494487920 1494492960 1494490560 1494547020 1494467640 1494462540 1494464940 America/New_York 1 -14400 -400 EDT astonished.rightfully.pythons NA 42.4182811 -71.5802309 42.3505932 -71.6787957 city Berlin United States of America us Massachusetts 7 Berlin, Worcester County, Massachusetts, United States of America 42.381204 -71.63701 US$ US$ Worcester County MA NA NA
38° 19' 21.41544'' N 75° 13' 3.68076'' W 18SVH8097141633 FM28jh37vk -8373194.849 4598602.233 https://www.openstreetmap.org/edit?relation=133689#map=17/38.32262/-75.21769 https://www.openstreetmap.org/?mlat=38.32262&mlon=-75.21769#map=17/38.32262/-75.21769 1 . $ USD 840 United States Dollar 1 Cent 100 $ 1 , dqfd02kjkv3cm4dts5ph 57.81 1494496320 1494490020 1494494520 1494492360 1494460920 1494467220 1494462660 1494464820 America/New_York 1 -14400 -400 EDT floral.evenly.shortwave Q614184 38.355184 -75.1880179 38.308406 -75.2347939 city Berlin United States of America us Maryland 7 Berlin, Worcester County, Maryland, United States of America 38.322615 -75.21769 US$ US$ Worcester County MD NA NA
43° 58' 4.93140'' N 88° 56' 36.41136'' W 16TCP4410170158 EN53mx62sh -9901139.296 5430821.988 https://www.openstreetmap.org/edit?relation=251729#map=17/43.96804/-88.94345 https://www.openstreetmap.org/?mlat=43.96804&mlon=-88.94345#map=17/43.96804/-88.94345 1 . $ USD 840 United States Dollar 1 Cent 100 $ 1 , dpbf0h1k7kn9fnpft5qz 47.39 1494498720 1494491400 1494496740 1494494280 1494465060 1494472380 1494467040 1494469560 America/Chicago 1 -18000 -500 CDT admits.indecision.skins Q1569850 43.997968 -88.9207259 43.947614 -88.9808519 city City of Berlin United States of America us Wisconsin 7 City of Berlin, Green Lake County, Wisconsin, United States of America 43.968036 -88.94345 US$ US$ Green Lake County WI NA NA
39° 55' 14.29068'' N 78° 57' 28.08756'' W 17SPE7452920945 FM09mw50bw -8789542.324 4826990.633 https://www.openstreetmap.org/edit?relation=189091#map=17/39.92064/-78.95780 https://www.openstreetmap.org/?mlat=39.92064&mlon=-78.95780#map=17/39.92064/-78.95780 1 . $ USD 840 United States Dollar 1 Cent 100 $ 1 , dppg572dtcgx2cbq86cy 55.17 1494496980 1494490440 1494495180 1494492900 1494462000 1494468600 1494463860 1494466080 America/New_York 1 -14400 -400 EDT rangers.chopsticks.crumbs Q1130950 39.927231 -78.9372069 39.914615 -78.9657809 city Berlin United States of America us Pennsylvania 8 Berlin, Somerset County, Pennsylvania, United States of America 39.920636 -78.95780 US$ US$ Somerset County PA NA NA
4° 48' 37.67328'' N 75° 40' 55.66260'' W 18NVL2435931751 FJ24dt84dm -8424896.003 532548.055 https://www.openstreetmap.org/edit?way=426681623#map=17/4.81046/-75.68213 https://www.openstreetmap.org/?mlat=4.81046&mlon=-75.68213#map=17/4.81046/-75.68213 57 , $ COP 170 Colombian Peso 20 Centavo 100 $ 1 . d2f5mg9yyxdud4nypuh1 64.68 1494499680 1494495300 1494498420 1494496860 1494544080 1494462060 1494545400 1494546960 America/Bogota 0 -18000 -500 COT tornado.snippet.flipping NA 4.8118583 -75.6783716 4.8088997 -75.6845896 neighbourhood Pereira Colombia co Risaralda 9 Berlin, Pereira, Colombia 4.810465 -75.68213 COL$ COL$ Pereira NA NA Berlin
results2 <- opencage_forward(placename = "Berlin",
                             bounds = c(-90,38,0, 45))
results2$results %>% knitr::kable()
annotations.DMS.lat annotations.DMS.lng annotations.MGRS annotations.Maidenhead annotations.Mercator.x annotations.Mercator.y annotations.OSM.edit_url annotations.OSM.url annotations.callingcode annotations.currency.alternate_symbols annotations.currency.decimal_mark annotations.currency.disambiguate_symbol annotations.currency.html_entity annotations.currency.iso_code annotations.currency.iso_numeric annotations.currency.name annotations.currency.smallest_denomination annotations.currency.subunit annotations.currency.subunit_to_unit annotations.currency.symbol annotations.currency.symbol_first annotations.currency.thousands_separator annotations.geohash annotations.qibla annotations.sun.rise.apparent annotations.sun.rise.astronomical annotations.sun.rise.civil annotations.sun.rise.nautical annotations.sun.set.apparent annotations.sun.set.astronomical annotations.sun.set.civil annotations.sun.set.nautical annotations.timezone.name annotations.timezone.now_in_dst annotations.timezone.offset_sec annotations.timezone.offset_string annotations.timezone.short_name annotations.what3words.words annotations.wikidata bounds.northeast.lat bounds.northeast.lng bounds.southwest.lat bounds.southwest.lng components._type components.city components.country components.country_code components.county components.state components.state_code confidence formatted geometry.lat geometry.lng components.town components.village
44° 28' 8.65560'' N 71° 11' 6.81324'' W 19TCK2618626296 FN44jl72sn -7924303.099 5508377.717 https://www.openstreetmap.org/edit?relation=170184#map=17/44.46907/-71.18523 https://www.openstreetmap.org/?mlat=44.46907&mlon=-71.18523#map=17/44.46907/-71.18523 1 US$ . US$ $ USD 840 United States Dollar 1 Cent 100 $ 1 , drvkupke058mhuudkdh3 60.36 1494494400 1494486960 1494492420 1494489900 1494460860 1494468360 1494462900 1494465420 America/New_York 1 -14400 -400 EDT strong.clean.crib Q821244 44.528436 -71.1236419 44.445057 -71.3978579 city Berlin United States of America us Coös County New Hampshire NH 5 Berlin, Coös County, New Hampshire, United States of America 44.46907 -71.18523 NA NA
41° 37' 17.35680'' N 72° 44' 44.34648'' W 18TXM8780710206 FN31po09md -8098008.916 5076059.694 https://www.openstreetmap.org/edit?node=158845944#map=17/41.62149/-72.74565 https://www.openstreetmap.org/?mlat=41.62149&mlon=-72.74565#map=17/41.62149/-72.74565 1 US$ . US$ $ USD 840 United States Dollar 1 Cent 100 $ 1 , drkkb8unxrwwbsuj9tjy 59.3 1494495240 1494488400 1494493380 1494491040 1494460800 1494467640 1494462660 1494465000 America/New_York 1 -14400 -400 EDT frosts.crowds.reef Q821199 41.661488 -72.7056518 41.581488 -72.7856518 city NA United States of America us Hartford County Connecticut CT 7 Berlin, Hartford County, Connecticut, United States of America 41.62149 -72.74565 Berlin NA
39° 47' 28.41432'' N 74° 55' 44.59260'' W 18SWK0607404588 FM29ms89mv -8341064.081 4808298.871 https://www.openstreetmap.org/edit?relation=170680#map=17/39.79123/-74.92905 https://www.openstreetmap.org/?mlat=39.79123&mlon=-74.92905#map=17/39.79123/-74.92905 1 US$ . US$ $ USD 840 United States Dollar 1 Cent 100 $ 1 , dr4dqgy2dw0jyzb7kgs3 57.91 1494496020 1494489540 1494494220 1494492000 1494461040 1494467580 1494462840 1494465120 America/New_York 1 -14400 -400 EDT verdict.rushes.upgrading Q1086827 39.8091498 -74.9079589 39.77601 -74.9661129 city Berlin United States of America us Camden County New Jersey NJ 7 Berlin, Camden County, New Jersey, United States of America 39.79123 -74.92905 NA NA
42° 22' 52.33440'' N 71° 38' 13.24320'' W 19TBG8291095470 FN42ej31nl -7974595.698 5189444.074 https://www.openstreetmap.org/edit?relation=1844156#map=17/42.38120/-71.63701 https://www.openstreetmap.org/?mlat=42.38120&mlon=-71.63701#map=17/42.38120/-71.63701 1 US$ . US$ $ USD 840 United States Dollar 1 Cent 100 $ 1 , drt11g782th32euc09nn 60.04 1494494880 1494487920 1494492960 1494490560 1494547020 1494467640 1494462540 1494464940 America/New_York 1 -14400 -400 EDT astonished.rightfully.pythons NA 42.4182811 -71.5802309 42.3505932 -71.6787957 city Berlin United States of America us Worcester County Massachusetts MA 7 Berlin, Worcester County, Massachusetts, United States of America 42.38120 -71.63701 NA NA
38° 19' 21.41544'' N 75° 13' 3.68076'' W 18SVH8097141633 FM28jh37vk -8373194.849 4598602.233 https://www.openstreetmap.org/edit?relation=133689#map=17/38.32262/-75.21769 https://www.openstreetmap.org/?mlat=38.32262&mlon=-75.21769#map=17/38.32262/-75.21769 1 US$ . US$ $ USD 840 United States Dollar 1 Cent 100 $ 1 , dqfd02kjkv3cm4dts5ph 57.81 1494496320 1494490020 1494494520 1494492360 1494460920 1494467220 1494462660 1494464820 America/New_York 1 -14400 -400 EDT floral.evenly.shortwave Q614184 38.355184 -75.1880179 38.308406 -75.2347939 city Berlin United States of America us Worcester County Maryland MD 7 Berlin, Worcester County, Maryland, United States of America 38.32262 -75.21769 NA NA
43° 58' 4.93140'' N 88° 56' 36.41136'' W 16TCP4410170158 EN53mx62sh -9901139.296 5430821.988 https://www.openstreetmap.org/edit?relation=251729#map=17/43.96804/-88.94345 https://www.openstreetmap.org/?mlat=43.96804&mlon=-88.94345#map=17/43.96804/-88.94345 1 US$ . US$ $ USD 840 United States Dollar 1 Cent 100 $ 1 , dpbf0h1k7kn9fnpft5qz 47.39 1494498720 1494491400 1494496740 1494494280 1494465060 1494472380 1494467040 1494469560 America/Chicago 1 -18000 -500 CDT admits.indecision.skins Q1569850 43.997968 -88.9207259 43.947614 -88.9808519 city City of Berlin United States of America us Green Lake County Wisconsin WI 7 City of Berlin, Green Lake County, Wisconsin, United States of America 43.96804 -88.94345 NA NA
39° 55' 14.29068'' N 78° 57' 28.08756'' W 17SPE7452920945 FM09mw50bw -8789542.324 4826990.633 https://www.openstreetmap.org/edit?relation=189091#map=17/39.92064/-78.95780 https://www.openstreetmap.org/?mlat=39.92064&mlon=-78.95780#map=17/39.92064/-78.95780 1 US$ . US$ $ USD 840 United States Dollar 1 Cent 100 $ 1 , dppg572dtcgx2cbq86cy 55.17 1494496980 1494490440 1494495180 1494492900 1494462000 1494468600 1494463860 1494466080 America/New_York 1 -14400 -400 EDT rangers.chopsticks.crumbs Q1130950 39.927231 -78.9372069 39.914615 -78.9657809 city Berlin United States of America us Somerset County Pennsylvania PA 8 Berlin, Somerset County, Pennsylvania, United States of America 39.92064 -78.95780 NA NA
39° 45' 32.17932'' N 89° 54' 11.38824'' W 16SBK5129805033 EM59bs12od -10007974.37 4803640.851 https://www.openstreetmap.org/edit?relation=126290#map=17/39.75894/-89.90316 https://www.openstreetmap.org/?mlat=39.75894&mlon=-89.90316#map=17/39.75894/-89.90316 1 US$ . US$ $ USD 840 United States Dollar 1 Cent 100 $ 1 , dp044jys87qee3bchu0k 47.27 1494499620 1494493140 1494497820 1494495540 1494464640 1494471180 1494466440 1494468660 America/Chicago 1 -18000 -500 CDT fluent.mocked.fancied Q2504681 39.764932 -89.8931649 39.750371 -89.9121009 city Berlin United States of America us Sangamon County Illinois IL 8 Berlin, Sangamon County, Illinois, United States of America 39.75894 -89.90316 NA NA
42° 41' 35.28636'' N 73° 22' 19.39728'' W 18TXN3335128023 FN32hq56ii -8167739.779 5236398.071 https://www.openstreetmap.org/edit?node=158915747#map=17/42.69314/-73.37205 https://www.openstreetmap.org/?mlat=42.69314&mlon=-73.37205#map=17/42.69314/-73.37205 1 US$ . US$ $ USD 840 United States Dollar 1 Cent 100 $ 1 , dreffkh1e1nwfg7r4r2t 58.85 1494495240 1494488220 1494493320 1494490920 1494461100 1494468180 1494463020 1494465480 America/New_York 1 -14400 -400 EDT cartons.eliminates.uses NA 42.7131351 -73.3520548 42.6731351 -73.3920548 village NA United States of America us Rensselaer County New York NY 7 Berlin, Rensselaer County, New York, United States of America 42.69314 -73.37205 NA Berlin
40° 33' 40.22424'' N 81° 47' 39.48144'' W 17TME3275690348 EN90cn44qq -9105299.87 4920037.921 https://www.openstreetmap.org/edit?node=153968558#map=17/40.56117/-81.79430 https://www.openstreetmap.org/?mlat=40.56117&mlon=-81.79430#map=17/40.56117/-81.79430 1 US$ . US$ $ USD 840 United States Dollar 1 Cent 100 $ 1 , dpjydxzjywtpgn0rxvjf 53.12 1494497580 1494490920 1494495720 1494493440 1494462780 1494469440 1494464640 1494466920 America/New_York 1 -14400 -400 EDT sing.quietest.certificate NA 40.5811734 -81.7743004 40.5411734 -81.8143004 village NA United States of America us Holmes County Ohio OH 7 Berlin, Holmes County, Ohio, United States of America 40.56117 -81.79430 NA Berlin
  • countrycode: Restricts the results to the given country. The country code is a two letter code as defined by the ISO 3166-1 Alpha 2 standard. E.g. "GB" for the United Kingdom, "FR" for France, "US" for United States. See example below.
results3 <- opencage_forward(placename = "Berlin", country = "DE")
results3$results %>% knitr::kable()
annotations.DMS.lat annotations.DMS.lng annotations.MGRS annotations.Maidenhead annotations.Mercator.x annotations.Mercator.y annotations.OSM.edit_url annotations.OSM.url annotations.callingcode annotations.currency.decimal_mark annotations.currency.html_entity annotations.currency.iso_code annotations.currency.iso_numeric annotations.currency.name annotations.currency.smallest_denomination annotations.currency.subunit annotations.currency.subunit_to_unit annotations.currency.symbol annotations.currency.symbol_first annotations.currency.thousands_separator annotations.geohash annotations.qibla annotations.sun.rise.apparent annotations.sun.rise.astronomical annotations.sun.rise.civil annotations.sun.rise.nautical annotations.sun.set.apparent annotations.sun.set.astronomical annotations.sun.set.civil annotations.sun.set.nautical annotations.timezone.name annotations.timezone.now_in_dst annotations.timezone.offset_sec annotations.timezone.offset_string annotations.timezone.short_name annotations.what3words.words annotations.wikidata bounds.northeast.lat bounds.northeast.lng bounds.southwest.lat bounds.southwest.lng components._type components.city components.country components.country_code components.state confidence formatted geometry.lat geometry.lng components.city_district components.house_number components.industrial components.postcode components.suburb components.county components.village components.road components.unknown components.cafe components.neighbourhood components.building components.residential
52° 31' 1.33140'' N 13° 23' 19.89564'' E 33UUU9067619766 JO62qm64pc 1490441.066 6860227.862 https://www.openstreetmap.org/edit?node=240109189#map=17/52.51704/13.38886 https://www.openstreetmap.org/?mlat=52.51704&mlon=13.38886#map=17/52.51704/13.38886 49 , EUR 978 Euro 1 Cent 100 1 . u33db8mmzj1t355u0c0j 136.66 1494472560 1494461400 1494470040 1494466620 1494528660 1494540060 1494531180 1494534660 Europe/Berlin 1 7200 200 CEST third.gurgled.such Q64 52.6770365 13.5488599 52.3570365 13.2288599 city Berlin Germany de Berlin 4 Berlin, Germany 52.51704 13.388860 NA NA NA NA NA NA NA NA NA NA NA NA NA
52° 27' 45.73296'' N 13° 24' 34.80876'' E 33UUU9195513692 JO62ql91db 1492757.537 6850319.462 https://www.openstreetmap.org/edit?way=273524069#map=17/52.46270/13.40967 https://www.openstreetmap.org/?mlat=52.46270&mlon=13.40967#map=17/52.46270/13.40967 49 , EUR 978 Euro 1 Cent 100 1 . u33d3ns97uy08jxsdgtg 136.64 1494472560 1494461460 1494470040 1494466620 1494528660 1494540000 1494531180 1494534660 Europe/Berlin 1 7200 200 CEST learning.pumps.whom NA 52.4641919 13.4120134 52.4615635 13.4077792 industrial NA Germany de Berlin 9 Bahlsen GmbH & Co. KG, 91-93, 12099 Berlin, Germany 52.46270 13.409669 Tempelhof-Schöneberg 91-93 Bahlsen GmbH & Co. KG 12099 Tempelhof NA NA NA NA NA NA NA NA
54° 2' 10.89780'' N 10° 26' 46.07268'' E 32UNE9470788534 JO54fa38mr 1162858.017 7142435.831 https://www.openstreetmap.org/edit?node=50798110#map=17/54.03636/10.44613 https://www.openstreetmap.org/?mlat=54.03636&mlon=10.44613#map=17/54.03636/10.44613 49 , EUR 978 Euro 1 Cent 100 1 . u1x7mtn8se8n18vzuczv 134.07 1494472860 0 1494470220 1494466440 1494529740 0 1494532440 1494536280 Europe/Berlin 1 7200 200 CEST jungle.scaled.quantity NA 54.0563605 10.4661313 54.0163605 10.4261313 village NA Germany de Schleswig-Holstein 7 23823 Berlin, Germany 54.03636 10.446131 NA NA NA 23823 NA Trave-Land Berlin NA NA NA NA NA NA
54° 24' 18.42840'' N 9° 25' 55.18776'' E 32UNF2804128682 JO44rj17uf 1049965.059 7212486.314 https://www.openstreetmap.org/edit?way=68276512#map=17/54.40512/9.43200 https://www.openstreetmap.org/?mlat=54.40512&mlon=9.43200#map=17/54.40512/9.43200 49 , EUR 978 Euro 1 Cent 100 1 . u1wtw8hhv3q2jjmfesu3 133.07 1494473040 0 1494470340 1494466440 1494530100 0 1494532800 1494536760 Europe/Berlin 1 7200 200 CEST makeups.propelled.panther NA 54.4069751 9.4342708 54.4029778 9.4299614 road NA Germany de Schleswig-Holstein 9 Berlin, 24848 Klein Bennebek, Germany 54.40512 9.431997 NA NA NA 24848 NA Kropp-Stapelholm Klein Bennebek Berlin NA NA NA NA NA
52° 30' 13.47300'' N 13° 19' 47.85456'' E 33UUU8664618379 JO62pm90ov 1483884.315 6857802.372 https://www.openstreetmap.org/edit?node=4012854129#map=17/52.50374/13.32996 https://www.openstreetmap.org/?mlat=52.50374&mlon=13.32996#map=17/52.50374/13.32996 49 , EUR 978 Euro 1 Cent 100 1 . u336xq486wfr91wcvvev 136.57 1494472560 1494461460 1494470040 1494466620 1494528660 1494540060 1494531180 1494534660 Europe/Berlin 1 7200 200 CEST touchy.candle.reserved NA 52.5037925 13.3300096 52.5036925 13.3299096 building NA Germany de Berlin 10 Berlin, Kurfürstendamm 21, 10719 Berlin, Germany 52.50374 13.329960 Charlottenburg-Wilmersdorf 21 NA 10719 Charlottenburg NA NA Kurfürstendamm Berlin NA NA NA NA
52° 22' 12.67680'' N 9° 45' 10.62252'' E 32UND5126202479 JO42vi08iu 1085693.506 6833476.151 https://www.openstreetmap.org/edit?node=320881943#map=17/52.37019/9.75295 https://www.openstreetmap.org/?mlat=52.37019&mlon=9.75295#map=17/52.37019/9.75295 49 , EUR 978 Euro 1 Cent 100 1 . u1qcvvtyknx5um9fq9f9 131.66 1494473460 1494462480 1494470940 1494467520 1494529500 1494540780 1494532020 1494535440 Europe/Berlin 1 7200 200 CEST army.outdoors.hitters NA 52.370238 9.7530007 52.370138 9.7529007 road Hanover Germany de Lower Saxony 9 Berliner Allee, 30175 Hanover, Germany 52.37019 9.752951 South-City-Bult NA NA 30175 South-City Region Hannover NA Berliner Allee Berlin NA NA NA NA
52° 30' 20.91132'' N 13° 19' 56.43624'' E 33UUU8681318605 JO62pm91vj 1484149.678 6858179.301 https://www.openstreetmap.org/edit?node=3889599519#map=17/52.50581/13.33234 https://www.openstreetmap.org/?mlat=52.50581&mlon=13.33234#map=17/52.50581/13.33234 49 , EUR 978 Euro 1 Cent 100 1 . u336xqkkd05ubvhv9zd8 136.57 1494472560 1494461400 1494470040 1494466620 1494528660 1494540060 1494531180 1494534660 Europe/Berlin 1 7200 200 CEST empire.opposite.unwell NA 52.5058587 13.3323934 52.5057587 13.3322934 building NA Germany de Berlin 10 Berlin, Hardenbergstraße 27-28a, 10623 Berlin, Germany 52.50581 13.332343 Charlottenburg-Wilmersdorf 27-28a NA 10623 Charlottenburg NA NA Hardenbergstraße Berlin NA NA NA NA
52° 31' 23.64780'' N 13° 24' 12.97080'' E 33UUU9169220434 JO62qm85kn 1492082.261 6861359.122 https://www.openstreetmap.org/edit?node=700843686#map=17/52.52324/13.40360 https://www.openstreetmap.org/?mlat=52.52324&mlon=13.40360#map=17/52.52324/13.40360 49 , EUR 978 Euro 1 Cent 100 1 . u33dc184n8dzc4mfyfnv 136.69 1494472560 1494461400 1494470040 1494466620 1494528660 1494540060 1494531180 1494534660 Europe/Berlin 1 7200 200 CEST sampled.premiums.stick NA 52.5232855 13.403653 52.5231855 13.403553 cafe Alt-Berlin Germany de Berlin 9 Berlin, Dircksenstraße 52, 10178 Berlin, Germany 52.52324 13.403603 Mitte 52 NA 10178 Mitte NA NA Dircksenstraße NA Berlin Scheunenviertel NA NA
52° 27' 24.31584'' N 13° 34' 45.17328'' E 33UVU0346012790 JO62sk99mo 1511631.276 6849235.295 https://www.openstreetmap.org/edit?way=168058334#map=17/52.45675/13.57921 https://www.openstreetmap.org/?mlat=52.45675&mlon=13.57921#map=17/52.45675/13.57921 49 , EUR 978 Euro 1 Cent 100 1 . u33dmj2ndxu2tewv03c0 136.87 1494472560 1494461460 1494470040 1494466560 1494528600 1494539940 1494531120 1494534600 Europe/Berlin 1 7200 200 CEST fields.lists.impulse NA 52.4569793 13.5798073 52.4565392 13.5784995 building NA Germany de Berlin 10 Vitanas Seniorencentrum, Parrisiusstraße 4-14, 12555 Berlin, Germany 52.45675 13.579215 Treptow-Köpenick 4-14 NA 12555 Köpenick NA NA Parrisiusstraße NA NA NA Vitanas Seniorencentrum Dammvorstadt
  • language: an IETF format language code (such as "es" for Spanish or "pt-BR" for Brazilian Portuguese). If no language is explicitly specified, we will look for an HTTP Accept-Language header like those sent by a brower and use the first language specified and if none are specified "en" (English) will be assumed. See example below.
results3$results %>% knitr::kable()
annotations.DMS.lat annotations.DMS.lng annotations.MGRS annotations.Maidenhead annotations.Mercator.x annotations.Mercator.y annotations.OSM.edit_url annotations.OSM.url annotations.callingcode annotations.currency.decimal_mark annotations.currency.html_entity annotations.currency.iso_code annotations.currency.iso_numeric annotations.currency.name annotations.currency.smallest_denomination annotations.currency.subunit annotations.currency.subunit_to_unit annotations.currency.symbol annotations.currency.symbol_first annotations.currency.thousands_separator annotations.geohash annotations.qibla annotations.sun.rise.apparent annotations.sun.rise.astronomical annotations.sun.rise.civil annotations.sun.rise.nautical annotations.sun.set.apparent annotations.sun.set.astronomical annotations.sun.set.civil annotations.sun.set.nautical annotations.timezone.name annotations.timezone.now_in_dst annotations.timezone.offset_sec annotations.timezone.offset_string annotations.timezone.short_name annotations.what3words.words annotations.wikidata bounds.northeast.lat bounds.northeast.lng bounds.southwest.lat bounds.southwest.lng components._type components.city components.country components.country_code components.state confidence formatted geometry.lat geometry.lng components.city_district components.house_number components.industrial components.postcode components.suburb components.county components.village components.road components.unknown components.cafe components.neighbourhood components.building components.residential
52° 31' 1.33140'' N 13° 23' 19.89564'' E 33UUU9067619766 JO62qm64pc 1490441.066 6860227.862 https://www.openstreetmap.org/edit?node=240109189#map=17/52.51704/13.38886 https://www.openstreetmap.org/?mlat=52.51704&mlon=13.38886#map=17/52.51704/13.38886 49 , EUR 978 Euro 1 Cent 100 1 . u33db8mmzj1t355u0c0j 136.66 1494472560 1494461400 1494470040 1494466620 1494528660 1494540060 1494531180 1494534660 Europe/Berlin 1 7200 200 CEST third.gurgled.such Q64 52.6770365 13.5488599 52.3570365 13.2288599 city Berlin Germany de Berlin 4 Berlin, Germany 52.51704 13.388860 NA NA NA NA NA NA NA NA NA NA NA NA NA
52° 27' 45.73296'' N 13° 24' 34.80876'' E 33UUU9195513692 JO62ql91db 1492757.537 6850319.462 https://www.openstreetmap.org/edit?way=273524069#map=17/52.46270/13.40967 https://www.openstreetmap.org/?mlat=52.46270&mlon=13.40967#map=17/52.46270/13.40967 49 , EUR 978 Euro 1 Cent 100 1 . u33d3ns97uy08jxsdgtg 136.64 1494472560 1494461460 1494470040 1494466620 1494528660 1494540000 1494531180 1494534660 Europe/Berlin 1 7200 200 CEST learning.pumps.whom NA 52.4641919 13.4120134 52.4615635 13.4077792 industrial NA Germany de Berlin 9 Bahlsen GmbH & Co. KG, 91-93, 12099 Berlin, Germany 52.46270 13.409669 Tempelhof-Schöneberg 91-93 Bahlsen GmbH & Co. KG 12099 Tempelhof NA NA NA NA NA NA NA NA
54° 2' 10.89780'' N 10° 26' 46.07268'' E 32UNE9470788534 JO54fa38mr 1162858.017 7142435.831 https://www.openstreetmap.org/edit?node=50798110#map=17/54.03636/10.44613 https://www.openstreetmap.org/?mlat=54.03636&mlon=10.44613#map=17/54.03636/10.44613 49 , EUR 978 Euro 1 Cent 100 1 . u1x7mtn8se8n18vzuczv 134.07 1494472860 0 1494470220 1494466440 1494529740 0 1494532440 1494536280 Europe/Berlin 1 7200 200 CEST jungle.scaled.quantity NA 54.0563605 10.4661313 54.0163605 10.4261313 village NA Germany de Schleswig-Holstein 7 23823 Berlin, Germany 54.03636 10.446131 NA NA NA 23823 NA Trave-Land Berlin NA NA NA NA NA NA
54° 24' 18.42840'' N 9° 25' 55.18776'' E 32UNF2804128682 JO44rj17uf 1049965.059 7212486.314 https://www.openstreetmap.org/edit?way=68276512#map=17/54.40512/9.43200 https://www.openstreetmap.org/?mlat=54.40512&mlon=9.43200#map=17/54.40512/9.43200 49 , EUR 978 Euro 1 Cent 100 1 . u1wtw8hhv3q2jjmfesu3 133.07 1494473040 0 1494470340 1494466440 1494530100 0 1494532800 1494536760 Europe/Berlin 1 7200 200 CEST makeups.propelled.panther NA 54.4069751 9.4342708 54.4029778 9.4299614 road NA Germany de Schleswig-Holstein 9 Berlin, 24848 Klein Bennebek, Germany 54.40512 9.431997 NA NA NA 24848 NA Kropp-Stapelholm Klein Bennebek Berlin NA NA NA NA NA
52° 30' 13.47300'' N 13° 19' 47.85456'' E 33UUU8664618379 JO62pm90ov 1483884.315 6857802.372 https://www.openstreetmap.org/edit?node=4012854129#map=17/52.50374/13.32996 https://www.openstreetmap.org/?mlat=52.50374&mlon=13.32996#map=17/52.50374/13.32996 49 , EUR 978 Euro 1 Cent 100 1 . u336xq486wfr91wcvvev 136.57 1494472560 1494461460 1494470040 1494466620 1494528660 1494540060 1494531180 1494534660 Europe/Berlin 1 7200 200 CEST touchy.candle.reserved NA 52.5037925 13.3300096 52.5036925 13.3299096 building NA Germany de Berlin 10 Berlin, Kurfürstendamm 21, 10719 Berlin, Germany 52.50374 13.329960 Charlottenburg-Wilmersdorf 21 NA 10719 Charlottenburg NA NA Kurfürstendamm Berlin NA NA NA NA
52° 22' 12.67680'' N 9° 45' 10.62252'' E 32UND5126202479 JO42vi08iu 1085693.506 6833476.151 https://www.openstreetmap.org/edit?node=320881943#map=17/52.37019/9.75295 https://www.openstreetmap.org/?mlat=52.37019&mlon=9.75295#map=17/52.37019/9.75295 49 , EUR 978 Euro 1 Cent 100 1 . u1qcvvtyknx5um9fq9f9 131.66 1494473460 1494462480 1494470940 1494467520 1494529500 1494540780 1494532020 1494535440 Europe/Berlin 1 7200 200 CEST army.outdoors.hitters NA 52.370238 9.7530007 52.370138 9.7529007 road Hanover Germany de Lower Saxony 9 Berliner Allee, 30175 Hanover, Germany 52.37019 9.752951 South-City-Bult NA NA 30175 South-City Region Hannover NA Berliner Allee Berlin NA NA NA NA
52° 30' 20.91132'' N 13° 19' 56.43624'' E 33UUU8681318605 JO62pm91vj 1484149.678 6858179.301 https://www.openstreetmap.org/edit?node=3889599519#map=17/52.50581/13.33234 https://www.openstreetmap.org/?mlat=52.50581&mlon=13.33234#map=17/52.50581/13.33234 49 , EUR 978 Euro 1 Cent 100 1 . u336xqkkd05ubvhv9zd8 136.57 1494472560 1494461400 1494470040 1494466620 1494528660 1494540060 1494531180 1494534660 Europe/Berlin 1 7200 200 CEST empire.opposite.unwell NA 52.5058587 13.3323934 52.5057587 13.3322934 building NA Germany de Berlin 10 Berlin, Hardenbergstraße 27-28a, 10623 Berlin, Germany 52.50581 13.332343 Charlottenburg-Wilmersdorf 27-28a NA 10623 Charlottenburg NA NA Hardenbergstraße Berlin NA NA NA NA
52° 31' 23.64780'' N 13° 24' 12.97080'' E 33UUU9169220434 JO62qm85kn 1492082.261 6861359.122 https://www.openstreetmap.org/edit?node=700843686#map=17/52.52324/13.40360 https://www.openstreetmap.org/?mlat=52.52324&mlon=13.40360#map=17/52.52324/13.40360 49 , EUR 978 Euro 1 Cent 100 1 . u33dc184n8dzc4mfyfnv 136.69 1494472560 1494461400 1494470040 1494466620 1494528660 1494540060 1494531180 1494534660 Europe/Berlin 1 7200 200 CEST sampled.premiums.stick NA 52.5232855 13.403653 52.5231855 13.403553 cafe Alt-Berlin Germany de Berlin 9 Berlin, Dircksenstraße 52, 10178 Berlin, Germany 52.52324 13.403603 Mitte 52 NA 10178 Mitte NA NA Dircksenstraße NA Berlin Scheunenviertel NA NA
52° 27' 24.31584'' N 13° 34' 45.17328'' E 33UVU0346012790 JO62sk99mo 1511631.276 6849235.295 https://www.openstreetmap.org/edit?way=168058334#map=17/52.45675/13.57921 https://www.openstreetmap.org/?mlat=52.45675&mlon=13.57921#map=17/52.45675/13.57921 49 , EUR 978 Euro 1 Cent 100 1 . u33dmj2ndxu2tewv03c0 136.87 1494472560 1494461460 1494470040 1494466560 1494528600 1494539940 1494531120 1494534600 Europe/Berlin 1 7200 200 CEST fields.lists.impulse NA 52.4569793 13.5798073 52.4565392 13.5784995 building NA Germany de Berlin 10 Vitanas Seniorencentrum, Parrisiusstraße 4-14, 12555 Berlin, Germany 52.45675 13.579215 Treptow-Köpenick 4-14 NA 12555 Köpenick NA NA Parrisiusstraße NA NA NA Vitanas Seniorencentrum Dammvorstadt
results4 <- opencage_forward(placename = "Berlin", country = "DE", language = "de")
results4$results %>% knitr::kable()
annotations.DMS.lat annotations.DMS.lng annotations.MGRS annotations.Maidenhead annotations.Mercator.x annotations.Mercator.y annotations.OSM.edit_url annotations.OSM.url annotations.callingcode annotations.currency.decimal_mark annotations.currency.html_entity annotations.currency.iso_code annotations.currency.iso_numeric annotations.currency.name annotations.currency.smallest_denomination annotations.currency.subunit annotations.currency.subunit_to_unit annotations.currency.symbol annotations.currency.symbol_first annotations.currency.thousands_separator annotations.geohash annotations.qibla annotations.sun.rise.apparent annotations.sun.rise.astronomical annotations.sun.rise.civil annotations.sun.rise.nautical annotations.sun.set.apparent annotations.sun.set.astronomical annotations.sun.set.civil annotations.sun.set.nautical annotations.timezone.name annotations.timezone.now_in_dst annotations.timezone.offset_sec annotations.timezone.offset_string annotations.timezone.short_name annotations.what3words.words annotations.wikidata bounds.northeast.lat bounds.northeast.lng bounds.southwest.lat bounds.southwest.lng components._type components.city components.country components.country_code components.state confidence formatted geometry.lat geometry.lng components.city_district components.house_number components.industrial components.postcode components.suburb components.county components.village components.road components.unknown components.cafe components.neighbourhood components.building components.residential
52° 31' 1.33140'' N 13° 23' 19.89564'' E 33UUU9067619766 JO62qm64pc 1490441.066 6860227.862 https://www.openstreetmap.org/edit?node=240109189#map=17/52.51704/13.38886 https://www.openstreetmap.org/?mlat=52.51704&mlon=13.38886#map=17/52.51704/13.38886 49 , EUR 978 Euro 1 Cent 100 1 . u33db8mmzj1t355u0c0j 136.66 1494472560 1494461400 1494470040 1494466620 1494528660 1494540060 1494531180 1494534660 Europe/Berlin 1 7200 200 CEST nirgends.digitalen.landkarte Q64 52.6770365 13.5488599 52.3570365 13.2288599 city Berlin Deutschland de Berlin 4 Berlin, Deutschland 52.51704 13.388860 NA NA NA NA NA NA NA NA NA NA NA NA NA
52° 27' 45.73296'' N 13° 24' 34.80876'' E 33UUU9195513692 JO62ql91db 1492757.537 6850319.462 https://www.openstreetmap.org/edit?way=273524069#map=17/52.46270/13.40967 https://www.openstreetmap.org/?mlat=52.46270&mlon=13.40967#map=17/52.46270/13.40967 49 , EUR 978 Euro 1 Cent 100 1 . u33d3ns97uy08jxsdgtg 136.64 1494472560 1494461460 1494470040 1494466620 1494528660 1494540000 1494531180 1494534660 Europe/Berlin 1 7200 200 CEST fichte.ergänzen.darüber NA 52.4641919 13.4120134 52.4615635 13.4077792 industrial NA Deutschland de Berlin 9 Berlin, 91-93, 12099 Berlin, Deutschland 52.46270 13.409669 Tempelhof-Schöneberg 91-93 Berlin 12099 Tempelhof NA NA NA NA NA NA NA NA
54° 2' 10.89780'' N 10° 26' 46.07268'' E 32UNE9470788534 JO54fa38mr 1162858.017 7142435.831 https://www.openstreetmap.org/edit?node=50798110#map=17/54.03636/10.44613 https://www.openstreetmap.org/?mlat=54.03636&mlon=10.44613#map=17/54.03636/10.44613 49 , EUR 978 Euro 1 Cent 100 1 . u1x7mtn8se8n18vzuczv 134.07 1494472860 0 1494470220 1494466440 1494529740 0 1494532440 1494536280 Europe/Berlin 1 7200 200 CEST zusehen.sicht.besucht NA 54.0563605 10.4661313 54.0163605 10.4261313 village NA Deutschland de Schleswig-Holstein 7 23823 Berlin, Deutschland 54.03636 10.446131 NA NA NA 23823 NA Trave-Land Berlin NA NA NA NA NA NA
54° 24' 18.42840'' N 9° 25' 55.18776'' E 32UNF2804128682 JO44rj17uf 1049965.059 7212486.314 https://www.openstreetmap.org/edit?way=68276512#map=17/54.40512/9.43200 https://www.openstreetmap.org/?mlat=54.40512&mlon=9.43200#map=17/54.40512/9.43200 49 , EUR 978 Euro 1 Cent 100 1 . u1wtw8hhv3q2jjmfesu3 133.07 1494473040 0 1494470340 1494466440 1494530100 0 1494532800 1494536760 Europe/Berlin 1 7200 200 CEST niedrig.sicher.kranz NA 54.4069751 9.4342708 54.4029778 9.4299614 road NA Deutschland de Schleswig-Holstein 9 Berlin, 24848 Klein Bennebek, Deutschland 54.40512 9.431997 NA NA NA 24848 NA Kropp-Stapelholm Klein Bennebek Berlin NA NA NA NA NA
52° 30' 13.47300'' N 13° 19' 47.85456'' E 33UUU8664618379 JO62pm90ov 1483884.315 6857802.372 https://www.openstreetmap.org/edit?node=4012854129#map=17/52.50374/13.32996 https://www.openstreetmap.org/?mlat=52.50374&mlon=13.32996#map=17/52.50374/13.32996 49 , EUR 978 Euro 1 Cent 100 1 . u336xq486wfr91wcvvev 136.57 1494472560 1494461460 1494470040 1494466620 1494528660 1494540060 1494531180 1494534660 Europe/Berlin 1 7200 200 CEST abgekürzt.vergabe.bequem NA 52.5037925 13.3300096 52.5036925 13.3299096 building NA Deutschland de Berlin 10 Berlin, Kurfürstendamm 21, 10719 Berlin, Deutschland 52.50374 13.329960 Charlottenburg-Wilmersdorf 21 NA 10719 Charlottenburg NA NA Kurfürstendamm Berlin NA NA NA NA
52° 22' 12.67680'' N 9° 45' 10.62252'' E 32UND5126202479 JO42vi08iu 1085693.506 6833476.151 https://www.openstreetmap.org/edit?node=320881943#map=17/52.37019/9.75295 https://www.openstreetmap.org/?mlat=52.37019&mlon=9.75295#map=17/52.37019/9.75295 49 , EUR 978 Euro 1 Cent 100 1 . u1qcvvtyknx5um9fq9f9 131.66 1494473460 1494462480 1494470940 1494467520 1494529500 1494540780 1494532020 1494535440 Europe/Berlin 1 7200 200 CEST greift.zentrum.teilt NA 52.370238 9.7530007 52.370138 9.7529007 road Hannover Deutschland de Niedersachsen 9 Berliner Allee, 30175 Hannover, Deutschland 52.37019 9.752951 Südstadt-Bult NA NA 30175 Südstadt Region Hannover NA Berliner Allee Berlin NA NA NA NA
52° 30' 20.91132'' N 13° 19' 56.43624'' E 33UUU8681318605 JO62pm91vj 1484149.678 6858179.301 https://www.openstreetmap.org/edit?node=3889599519#map=17/52.50581/13.33234 https://www.openstreetmap.org/?mlat=52.50581&mlon=13.33234#map=17/52.50581/13.33234 49 , EUR 978 Euro 1 Cent 100 1 . u336xqkkd05ubvhv9zd8 136.57 1494472560 1494461400 1494470040 1494466620 1494528660 1494540060 1494531180 1494534660 Europe/Berlin 1 7200 200 CEST übungen.schon.zuzüge NA 52.5058587 13.3323934 52.5057587 13.3322934 building NA Deutschland de Berlin 10 Berlin, Hardenbergstraße 27-28a, 10623 Berlin, Deutschland 52.50581 13.332343 Charlottenburg-Wilmersdorf 27-28a NA 10623 Charlottenburg NA NA Hardenbergstraße Berlin NA NA NA NA
52° 31' 23.64780'' N 13° 24' 12.97080'' E 33UUU9169220434 JO62qm85kn 1492082.261 6861359.122 https://www.openstreetmap.org/edit?node=700843686#map=17/52.52324/13.40360 https://www.openstreetmap.org/?mlat=52.52324&mlon=13.40360#map=17/52.52324/13.40360 49 , EUR 978 Euro 1 Cent 100 1 . u33dc184n8dzc4mfyfnv 136.69 1494472560 1494461400 1494470040 1494466620 1494528660 1494540060 1494531180 1494534660 Europe/Berlin 1 7200 200 CEST geige.geschoben.helfer NA 52.5232855 13.403653 52.5231855 13.403553 cafe Alt-Berlin Deutschland de Berlin 9 Berlin, Dircksenstraße 52, 10178 Berlin, Deutschland 52.52324 13.403603 Mitte 52 NA 10178 Mitte NA NA Dircksenstraße NA Berlin Scheunenviertel NA NA
52° 27' 24.31584'' N 13° 34' 45.17328'' E 33UVU0346012790 JO62sk99mo 1511631.276 6849235.295 https://www.openstreetmap.org/edit?way=168058334#map=17/52.45675/13.57921 https://www.openstreetmap.org/?mlat=52.45675&mlon=13.57921#map=17/52.45675/13.57921 49 , EUR 978 Euro 1 Cent 100 1 . u33dmj2ndxu2tewv03c0 136.87 1494472560 1494461460 1494470040 1494466560 1494528600 1494539940 1494531120 1494534600 Europe/Berlin 1 7200 200 CEST allein.ausübt.ansprechend NA 52.4569793 13.5798073 52.4565392 13.5784995 building NA Deutschland de Berlin 10 Vitanas Seniorencentrum, Parrisiusstraße 4-14, 12555 Berlin, Deutschland 52.45675 13.579215 Treptow-Köpenick 4-14 NA 12555 Köpenick NA NA Parrisiusstraße NA NA NA Vitanas Seniorencentrum Dammvorstadt
  • limit: How many results should be returned (1-100). Default is 10.

  • min_confidence: an integer from 1-10. Only results with at least this confidence will be returned.

  • no_annotations: Logical (default FALSE), when TRUE the output will not contain annotations.

  • no_dedupe: Logical (default FALSE), when TRUE the output will not be deduplicated.

For more information about the output and the query parameters, see the package documentation, the API doc and OpenCage FAQ.

Caching

The underlying data at OpenCage is updated about once a day. Note that the package uses memoise with no timeout argument so that results are cached inside an active R session.

system.time(opencage_reverse(latitude = 10, longitude = 10))
##    user  system elapsed 
##    0.05    0.02    0.59
system.time(opencage_reverse(latitude = 10, longitude = 10))
##    user  system elapsed 
##       0       0       0
memoise::forget(opencage_reverse)
## [1] TRUE
system.time(opencage_reverse(latitude = 10, longitude = 10))
##    user  system elapsed 
##    0.01    0.03    0.45

Privacy

Both functions have a parameter no_record. It is FALSE by default.

  • When no_record is FALSE a log of the query is made by OpenCage. The company uses them to better generally understand how people are using its service (forward or reverse geocoding, what parts of the world are people most interested in, etc) and for debugging. The overwhelming majority (99.9999+% of queries) are never specifically looked at (sheer volume prevents that) and are automatically deleted after a few days. More information about privacy can be found here.

  • When no_record is TRUE the actual query is replaced with FILTERED in OpenCage logs, so that the company has no chance to see what your request was.

Addresses

They also have an abbr parameter, FALSE by default. When it is TRUE the addresses are abbreviated in the results, see more details in this blog post.

Meta

  • Please report any issues or bugs.
  • License: GPL
  • Get citation information for opencage in R doing citation(package = 'opencage')
  • Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

ropensci_footer