Skip to contents

This function retrieves a filtered dataset from the specified Overture dataset type, optionally within a bounding box, and converts it to an sf object.

Usage

record_batch_reader(overture_type, bbox = NULL)

Arguments

overture_type

Character. Required. The type of feature to select. Examples include 'building', 'place', etc. To learn more, run get_all_overture_types().

bbox

Numeric vector. Optional. A bounding box specified as c(xmin, ymin, xmax, ymax). It is recommended to use a bounding box to limit the dataset size and processing time. Without a bounding box, processing the entire dataset (e.g., buildings over 2 billion) can be time-consuming.

Value

An sf object containing the filtered dataset based on the bounding box.

Examples

# \donttest{
# Example usage with a bounding box takes > 20 secs
sf_bbox <- c(-122.5, 37.7, -122.3, 37.8)
result <- record_batch_reader(overture_type = 'place', bbox = sf_bbox)
#> OGR: Unsupported geometry type
#> OGR: Unsupported geometry type
#> OGR: Unsupported geometry type
print(result)
#> Simple feature collection with 34384 features and 14 fields (with 10 geometries empty)
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: -122.5 ymin: 37.70001 xmax: -122.3003 ymax: 37.79999
#> Geodetic CRS:  WGS 84
#> # A tibble: 34,384 × 15
#>    id                        geometry bbox$xmin version update_time      sources
#>  * <chr>                  <POINT [°]>     <dbl>   <int> <chr>            <list<>
#>  1 08f283094059… (-122.4964 37.70068)     -122.       0 2024-05-10T00:0… [1 × 4]
#>  2 08f28309462d…  (-122.494 37.70005)     -122.       0 2024-05-10T00:0… [6 × 4]
#>  3 08f283094290… (-122.4918 37.70196)     -122.       0 2024-05-10T00:0… [1 × 4]
#>  4 08f283094290… (-122.4905 37.70099)     -122.       0 2024-05-10T00:0… [1 × 4]
#>  5 08f283094291… (-122.4889 37.70062)     -122.       0 2024-05-10T00:0… [1 × 4]
#>  6 08f28309429a… (-122.4885 37.70176)     -122.       0 2024-05-10T00:0… [1 × 4]
#>  7 08f283094282… (-122.4919 37.70281)     -122.       0 2024-05-10T00:0… [1 × 4]
#>  8 08f283094282…   (-122.492 37.7029)     -122.       0 2024-05-10T00:0… [2 × 4]
#>  9 08f283094282…   (-122.492 37.7029)     -122.       0 2024-05-10T00:0… [1 × 4]
#> 10 08f283094282… (-122.4919 37.70293)     -122.       0 2024-05-10T00:0… [1 × 4]
#> # ℹ 34,374 more rows
#> # ℹ 12 more variables: bbox$xmax <dbl>, $ymin <dbl>, $ymax <dbl>,
#> #   names <tibble[,3]>, categories <tibble[,2]>, confidence <dbl>,
#> #   websites <list<character>>, socials <list<character>>,
#> #   emails <list<character>>, phones <list<character>>, brand <tibble[,2]>,
#> #   addresses <list<  tbl_df<    freeform: character    locality: character    postcode: character    region  : character    country : character  >>>
# }