Learn R Programming

gloBFPr (version 0.1.3)

search_3dglobdf: search_3dglobdf

Description

Search and retrieve 3D-GloBFP tiles that intersect a given bounding box or area of interest, with options to return vector or raster outputs including building polygons, binary presence rasters, and height-coded rasters.

Usage

search_3dglobdf(
  bbox,
  metadata,
  crop = FALSE,
  out_type = "poly",
  mask = FALSE,
  cell_size = 1
)

Value

Varies based on out_type:

  • If "poly": an sf object of building footprints.

  • If "binary_rast": a binary SpatRaster (terra) indicating building presence.

  • If "graduated_rast": a quantitative SpatRaster of building heights.

  • If "rast": a named list with two SpatRaster objects: binary and graduated.

  • If "all": a named list with poly (sf), binary, and graduated rasters.

Arguments

bbox

sf, sfc, or a numeric vector (xmin, ymin, xmax, ymax) defining the area of interest.

metadata

sf. Typically output from get_metadata(), containing tile extents and download URLs.

crop

logical. If TRUE, the resulting building footprint geometries will be cropped to the input bbox. Default is FALSE.

out_type

character. Default is 'poly'. Output type(s) to return. Options include:

  • "poly": building footprints as an sf polygon object.

  • "binary_rast": binary terra raster where buildings = 1.

  • "graduated_rast": terra raster encoding building height values.

  • "rast": a named list with both binary and graduated rasters.

  • "all": a named list including the polygon layer and both raster layers.

mask

logical (optional). Default is FALSE. If TRUE, masks the graduated raster using the building footprint layer. Only used when out_type is "graduated_rast", "rast", or "all".

cell_size

numeric (optional). Default is 1. Only used when out_type is "graduated_rast", "rast", or "all".

References

Che Yangzi, Li Xuecao, Liu Xiaoping, Wang Yuhao, Liao Weilin, Zheng Xianwei, Zhang Xucai, Xu Xiaocong, Shi Qian, Zhu Jiajun, Zhang Honghui, Yuan Hua, & Dai Yongjiu (2024). 3D-GloBFP: the first global three-dimensional building footprint dataset. Earth Syst. Sci. Data, 16, 5357-5374

Examples

Run this code
metadata <- gloBFPr::get_metadata(test=TRUE)
buildings <- gloBFPr::search_3dglobdf(bbox=c(-84.485519,45.636118,-84.462774,45.650639),
                     metadata=metadata)

Run the code above in your browser using DataLab