Title: | Google Encoded Polyline Algorithm Format |
---|---|
Description: | Encode and decode the Google Encoded Polyline Algorithm Format. See <https://developers.google.com/maps/documentation/utilities/polylinealgorithm> for more information. |
Authors: | Matthieu Viry [aut] , Timothée Giraud [ctb, cre] |
Maintainer: | Timothée Giraud <[email protected]> |
License: | GPL-3 |
Version: | 0.2.0 |
Built: | 2024-11-15 06:07:18 UTC |
Source: | https://github.com/riatelab/gepaf |
Decode a Google polyline to a data frame of coordinates.
decodePolyline(enc_polyline, factor = 5)
decodePolyline(enc_polyline, factor = 5)
enc_polyline |
a Google polyline. |
factor |
number of decimal digits to be used. |
A data frame of latitudes and longitudes is returned.
coords <- decodePolyline(enc_polyline = "_p~iF~ps|U_ulLnnqC_mqNvxq`@") coords
coords <- decodePolyline(enc_polyline = "_p~iF~ps|U_ulLnnqC_mqNvxq`@") coords
Encode a data.frame of coordinates to a Google polyline.
encodePolyline(df_coords, factor = 5)
encodePolyline(df_coords, factor = 5)
df_coords |
a data frame of coordinates with two columns: latitudes and longitudes. Coordinates must be in decimal degrees (WGS84). |
factor |
number of decimal digits to be used. |
An encoded polyline is returned.
coords <- data.frame( lat = c(38.5, 40.7, 43.252), lon = c(-120.2, -120.95, -126.453) ) encpoly <- encodePolyline(coords) encpoly
coords <- data.frame( lat = c(38.5, 40.7, 43.252), lon = c(-120.2, -120.95, -126.453) ) encpoly <- encodePolyline(coords) encpoly
Encode and decode the Google Encoded Polyline Algorithm Format.
See the documentation here:
https://developers.google.com/maps/documentation/utilities/polylinealgorithm.
Mostly a translation of https://github.com/mthh/polyline_ggl/ (itself a modest translation (i.g no GeoJSON wrapper, etc.) of other well known available implementations such as Node.js Mapbox one).
Maintainer: Timothée Giraud [email protected] (ORCID) [contributor]
Authors:
Matthieu Viry [email protected] (ORCID)
encodePolyline, decodePolyline.