Giter Club home page Giter Club logo

opencage's Introduction

opencage

CRAN Version CRAN Checks Status CRAN Downloads per Month R-universe status Project Status: Active – The project has reached a stable, usable state and is being actively developed. R-CMD-check Status on GitHub Actions codecov.io Status rOpenSci Peer-Review License

Geocode with the OpenCage API, either from place name to longitude and latitude (forward geocoding) or from longitude and latitude to the name and address of the location (reverse geocoding).

Installation

You can install {opencage} from CRAN, R-universe or GitHub like this:

  • Release version from CRAN

    install.packages("opencage")
  • Development version from R-universe

    install.packages(
      "opencage", 
      repos = c("https://ropensci.r-universe.dev", getOption("repos"))
    )
  • Development version from GitHub with {pak}

    pak::pak("ropensci/opencage")

    or with {remotes}

    remotes::install_github("ropensci/opencage")

Quickstart

For the best experience, we recommend that you read through the “Introduction to opencage” vignette (vignette("opencage")), but if you are in a hurry:

  1. Register at opencagedata.com/users/sign_up.
  2. Generate an API key at the OpenCage dashboard.
  3. Save your API key as an environment variable like OPENCAGE_KEY=yourkey in .Renviron. See help(oc_config) for alternative ways to set your OpenCage API key.

Now you are ready to turn place names into latitude and longitude coordinates:

library(opencage)
oc_forward_df(placename = "Sarzeau")
placename oc_lat oc_lng oc_formatted
Sarzeau 47.52877 -2.7642 56370 Sarzeau, France

Or turn a set of coordinates into the name and address of the location:

oc_reverse_df(latitude = 51.5034070, longitude = -0.1275920)
latitude longitude oc_formatted
51.50341 -0.127592 10 Downing Street, London, SW1A 2AA, United Kingdom

But remember, the vignettes are really great! We have:

About OpenCage

The OpenCage API supports forward and reverse geocoding. Sources of OpenCage are open geospatial data including OpenStreetMap, DataScienceToolkit, GeoPlanet, Natural Earth Data, libpostal, GeoNames, and Flickr’s shapefiles plus a whole lot more besides. Refer to the current full list of credits.

Code of Conduct

Please note that this package is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

opencage's People

Contributors

dpprdan avatar freyfogle avatar jakeruss avatar jessesadler avatar karthik avatar maelle avatar vaugoyeau avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.