read_pbf {arcpbf}R Documentation

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)

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.

Value

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

See process_pbf() for more.

Examples

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)


[Package arcpbf version 0.1.3 Index]