Learn R Programming

arcpbf (version 0.1.7)

read_pbf: Read a FeatureCollection Protocol Buffer

Description

Given a binary file containing a FeatureCollection protocol buffer (pbf), read its contents into R as an R object.

Usage

read_pbf(path, post_process = TRUE, use_sf = TRUE)

Value

Either a data.frame, list, scalar integer, or sf object if post_process = TRUE and use_sf = TRUE.

See process_pbf() for more.

Arguments

path

a scalar character of the path to the pbf file

post_process

default TRUE. Apply post_process_pbf() to the pbf body.

use_sf

default TRUE. Whether or not to return an sf object.

Examples

Run this code
count_fp <- system.file("count.pbf", package = "arcpbf")
oid_fp <- system.file("ids.pbf", package = "arcpbf")
tbl_fp <- system.file("small-table.pbf", package = "arcpbf")
fc_fp <- system.file("small-points.pbf", package = "arcpbf")

# count response
read_pbf(count_fp)

# object id response
head(read_pbf(oid_fp))

# table feature collection
read_pbf(tbl_fp)

# feature collection with geometry
read_pbf(fc_fp)

Run the code above in your browser using DataLab