Skip to content

mike-decarlo/gcd

Repository files navigation

gcd

Travis-CI Build Status AppVeyor Build Status codecov

The {gcd} package for R contains several tools for working with latitude and longitude values and obtaining estimated distances between points. The name of the package comes from the term "great circle distance" used to describe distances on the surface of the "Great Circle" (Earth). There are a few different methods for estimating the distance with varying trade-offs of efficiency vs. accuracy.

  • Spherical Law of Cosines (slc): assumes spherical shape; sensitive to very close distances
  • Haversine formula (haversine): assumes spherical shape; more robust to close distances
  • Vincenty inverse formula for ellipsoids (vincenty): uses ellipsoid shape with Earth's polar radius and equatorial radius Using these methods, the {gcd} package allows users to make easy measurements from place to place on the Earth's surface in km or miles.

Also in this package are functions to take advantage of the Google and HERE APIs that perform geocoding and routing analysis. From this geocoded cooordinates and a standard set of location components can be returned from a single address string. Additionally, the drive time (both) and distance (Google only) between two points can be retrieved.

Getting Started

Prerequisites

Some prerequisites to getting this product up and running in R:

If planning to use Google's geocoding API services

If planning to use HERE"s geocoding API services

Installing

Now that R is setup (with or without RStudio) and the {devtools} package is installed, it's possible to start downloading and installing R packages directly from Github. To download, install, and start using the {gcd} package follow the steps:

  • Download and install the {gcd} package from Github
    • From R/RStudio console enter: remotes::install_github("mike-decarlo/gcd")
  • Load the {gcd} package library
    • From R/RStudio console enter: library(gcd)

Authors

License

This project is licensed under the GPL-3 License - see the LICENSE file for details

Acknowledgments

  • Mario Pineda-Krch
  • The reasoning behind this product is to supply an easy solution for geocoding and geodesic distance calculation for a client

About

Geospatial Related Toolkit for Location, Distance, and Routing in R

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages