Skip to content

Check bbox does not follow sf convenctions #176

Description

@sgunz

https://github.com/HelenaLC/SpatialData/blob/b653da6e832fc07b7fb373c40d0da1d72fe61705/R/crop.R#L44-L45

> bbx <- sf::st_bbox(c(xmin = 2500, ymin = 2500, xmax = 2750, ymax = 2750))
> bbx
xmin ymin xmax ymax 
2500 2500 2750 2750 

sf::st_bbox takes any order of {xmin, xmax, ymin, ymax} as valid input. Therefore in some cases the check is too restrictive.

> bbx <- sf::st_bbox(c(xmin = 2500, xmax = 2750, ymin = 2500, ymax = 2750))
> crop(shape(sd, "cell_boundaries"), bbx)
Error in .check_box(y) : 
  Invalid bounding box; should be length-4 numeric list with names 'xmin/xmax/ymin/ymax'
> packageVersion("SpatialData")
[1] ‘0.99.34’

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions