process_pbf {arcpbf}R Documentation

Process a FeatureCollection PBF

Description

Process a pbf from a raw vector or a list of raw vectors.

Usage

process_pbf(proto)

Arguments

proto

either a raw vector or a list of raw vectors containing a FeatureCollection pbf

Details

There are three types of PBF FeatureCollection responses that may be returned.

Feature Result

In the case the PBF is a FeatureResult and use_sf = FALSE, a data.frame is returned with the spatial reference stored in the crs attribute. Otherwise an sf object is returned.

Count Result

The PBF can also return a count result, for example if the query parameter returnCountOnly is set to true. In this case, a scalar integer vector is returned.

Object ID Result

In the case that the query parameter returnIdsOnly is true, a data.frame is returned containing the object IDs and the column name set to the object ID field name in the feature service.

Value

Important: Use post_process_pbf() to convert to an sf object with a computed bounding box and CRS.

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
count_raw <- open_pbf(count_fp)
process_pbf(count_raw)

# object id response
oid_raw <- open_pbf(oid_fp)
head(process_pbf(oid_raw))

# table feature collection
tbl_raw <- open_pbf(tbl_fp)
process_pbf(tbl_raw)

# feature collection with geometry 
fc_raw <- open_pbf(fc_fp)
process_pbf(fc_raw)

[Package arcpbf version 0.1.3 Index]