itsleeds / itsleeds/OSMtools

bbox argument in osmt_convert

Open
#6 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
3
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Hello. When I used `st_bbox(my_sf)` in `osmt_convert` as the argument to clip, it repeatedly shows the error: `BBox first point is not south of second point`. After check the source code, I guess that there is one typo. For checking the lat of inputs, the correct code might be `if(bbox[1,2] > bbox[2,2])`. Could you please confirm that?

```
# Check bbox
if(!is.null(bbox)){
if(all(class(bbox) == "bbox")){
bbox <- matrix(as.numeric(bbox), ncol = 2, byrow = 2)
}
checkmate::assert_matrix(bbox, min.rows = 2, max.rows = 2, min.cols = 2,
max.cols = 2)

checkmate::assert_numeric(bbox[,1], lower = -180, upper = 180)
checkmate::assert_numeric(bbox[,2], lower = -90, upper = 90)
if(bbox[1,1] > bbox[2,1]){
stop("BBox first point is not west of second point")
}
if(bbox[2,1] > bbox[2,2]){
stop("BBox first point is not south of second point")
}

}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.