- Home
- CRAN
**stplanr**: Sustainable Transport Planning**decode_gl**: Decode Google polyline compressed string

# Decode Google polyline compressed string

### Description

Decode Google polyline compressed string

### Usage

1 | ```
decode_gl(polyline, precision = 6, forceline = TRUE)
``` |

### Arguments

`polyline` |
A character string or vector of character strings containing the encoded polyline to be decoded. |

`precision` |
An integer indicating the number of decimals in the initial encoded coordinates. Default is 6 (for OSRM default). |

`forceline` |
Boolean value indicating if the returned coordinates should be a line (i.e., minimum two points) Default is TRUE. |

### Details

An implementation of the Google Maps Encoded Polyline Algorithm for decoding strings. Returns a dataframe if polyline is of length 1 and a list of dataframes otherwise.

### Examples

1 2 3 4 | ```
## Not run:
decode_gl("_p~iF~ps|U_ulLnnqC_mqNvxq`@", precision = 5)
## End(Not run)
``` |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.

- angle_diff: Calculate the angular difference between lines and a...
- api_pat: Retrieve personal access token.
- bb2poly: Convert a bounding box to a SpatialPolygonsDataFrame
- bbox_scale: Scale a bounding box
- buff_geo: Create a buffer of n metres for non-projected 'geographical'...
- calc_catchment: Calculate catchment area and associated summary statistics.
- calc_catchment_sum: Calculate summary statistics for catchment area.
- calc_moving_catchment: Calculate summary statistics for all features independently.
- calc_network_catchment: Calculate catchment area and associated summary statistics...
- cents: SpatialPointsDataFrame of home locations for flow analysis.
- crs_select_aeq: Select a custom projected CRS for the area of interest
- decode_gl: Decode Google polyline compressed string
- destination_zones: example destinations data
- dist_google: Return travel network distances and time using the Google...
- dl_stats19: Download Stats19 data
- find_network_nodes: Find graph node ID of closest node to given coordinates
- flow: data frame of commuter flows
- flow_dests: data frame of invented commuter flows with destinations in a...
- flowlines: SpatialLinesDataFrame of commuter flows
- format_stats19_ac: Format UK 'Stats19' road traffic casualty data
- format_stats19_ca: Format UK 'Stats19' road traffic casualty data
- format_stats19_ve: Format UK 'Stats19' road traffic casualty data
- gclip: Crops spatial object x to the bounding box of spatial object...
- gprojected: Perform GIS functions on a temporary, projected version of a...
- gsection: Function to split overlapping SpatialLines into segments
- gtfs2sldf: Import GTFS shapes and route data to SpatialLinesDataFrame.
- is_linepoint: Identify lines that are points
- islines: Do the intersections between two geometries create lines?
- line2df: Convert SpatialLinesDataFrame objects to a data.frame with...
- line2points: Convert a SpatialLinesDataFrame to points
- line2route: Convert straight SpatialLinesDataFrame from flow data into...
- line_bearing: Find the bearing of straight lines
- lineLabels: Label SpatialLinesDataFrame objects
- line_length: Calculate length of lines in geographic CRS
- line_midpoint: Find the mid-point of lines
- line_segment: Divide SpatialLines dataset into regular segments
- locate2spdf: Return SpatialPointsDataFrame with located points from OSRM...
- mapshape: Simplify geometry of spatial objects with the mapshaper...
- mapshape_available: Does the computer have mapshaper available?
- nearest2spdf: Return SpatialPointsDataFrame with nearest street from OSRM...
- nearest_cyclestreets: Generate nearest point on the route network of a point using...
- nearest_google: Generate nearest point on the route network of a point using...
- nearest_osm: Generate nearest point on the route network of a point from...
- n_vertices: Retrieve the number of vertices from a SpatialLines or...
- od2line: Convert flow data to SpatialLinesDataFrame
- od2odf: Extract coordinates from OD data
- od_dist: Quickly calculate Euclidean distances of od pairs
- od_id_order: Generate ordered ids of OD pairs so lowest is always first
- od_radiation: Function that estimates flow between points or zones using...
- onewaygeo: Aggregate flows so they become non-directional (by geometry -...
- onewayid: Aggregate ods so they become non-directional
- overline: Convert series of overlapping lines into a route network
- plot-SpatialLinesNetwork-ANY-method: Plot a SpatialLinesNetwork
- points2flow: Convert a series of points into geographical flows
- points2line: Convert a series of points, or a matrix of coordinates, into...
- points2odf: Convert a series of points into a dataframe of origins and...
- read_stats19_ac: Import and format UK 'Stats19' road traffic casualty data
- read_stats19_ca: Import and format UK 'Stats19' road traffic casualty data
- read_stats19_ve: Import and format UK 'Stats19' road traffic casualty data
- read_table_builder: Import and format Australian Bureau of Statistics (ABS)...
- reproject: Reproject lat/long spatial object so that they are in units...
- route_cyclestreet: Plan a single route with CycleStreets.net
- route_graphhopper: Plan a route with the graphhopper routing engine
- routes_fast: SpatialLinesDataFrame of commuter flows on the travel network
- routes_slow: SpatialLinesDataFrame of commuter flows on the travel network
- route_transportapi_public: Plan a single route with TransportAPI.com
- SpatialLinesNetwork: Create object of class SpatialLinesNetwork from...
- SpatialLinesNetwork-class: An S4 class representing a (typically) transport network
- stplanr-package: *stplanr: Sustainable Transport Planning with R*
- summary-SpatialLinesNetwork-method: Print a summary of a SpatialLinesNetwork
- sum_network_routes: Summarise shortest path between nodes on network
- table2matrix: Return Matrix containing travel times between origins and...
- toptail: Clip the first and last n metres of SpatialLines
- toptail_buff: Clip the beginning and ends SpatialLines to the edge of...
- toptailgs: Clip the first and last n metres of SpatialLines
- update_line_geometry: Update line geometry
- viaroute: Query OSRM service and return json string result
- viaroute2sldf: Convert json result of OSRM routing query to...
- weightfield: Get or set weight field in SpatialLinesNetwork
- writeGeoJSON: Write to geojson easily
- zones: SpatialPolygonsDataFrame of home locations for flow analysis.