Skip to content

Commit

Permalink
- update
Browse files Browse the repository at this point in the history
  • Loading branch information
billbillbilly committed Jan 26, 2024
1 parent 0a21490 commit b1a1ce9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 46 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Language: en_GB
Suggests:
covr,
testthat (>= 3.0.0),
knitr,
rmarkdown,
Expand Down
9 changes: 5 additions & 4 deletions R/calculate_diversity.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ calculate_diversity <- function(viewshed,
p <- land_class$proportion
sdi <- sd_index(p)
if (proportion) {
return(list(SDI=sdi,
Proportion=t(subset(land_class,
select = c(.data$type,
proportion)))))
# sub_land_class <- subset(land_class,
# select = c(type, proportion))
sub_land_class <- land_class %>%
dplyr::select(.data$type, proportion)
return(list(SDI=sdi,Proportion=t(sub_land_class)))
} else {
return(sdi)
}
Expand Down
41 changes: 0 additions & 41 deletions vignettes/viewscape.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -144,44 +144,3 @@ test_canopy_proportion <- viewscape::calculate_feature(viewshed = output[[1]],
exclude_value=0)
test_canopy_proportion
```

## 3. Get LiDAR data

### 3.1 Get LiDAR data information via API

```{r eval = FALSE}
# search for lidar data information using bbox
search_result <- viewscape::lidar_search(bbox = c(-83.742282,
42.273389,
-83.733442,
42.278724),
preview = FALSE)
search_result
```

### 3.2 Download LiDAR data with a given point and searching distance

```{r eval = FALSE, include = FALSE}
# try coordinates -83.741289,42.270146 (in south Michigan, USA)
# radius is 1000ft
las <- viewscape::get_lidar(x = -83.741289,
y = 42.270146,
r = 1000,
epsg = 2253,
folder = '/Users/yangxiaohao/Downloads/testfunction',
plot = FALSE)
```

```{r eval = FALSE, include = FALSE}
# Create DTM
dtm_ <- lidR::rasterize_terrain(las, res = 5, lidR::tin())
terra::plot(dtm_)
```

```{r eval = FALSE, include = FALSE}
# Create DSM
dsm_ <- lidR::rasterize_canopy(las, res = 5, lidR::dsmtin())
raster::plot(dsm_)
```

For more usages of lidR please refer: https://github.com/r-lidar/lidR/tree/master and https://rpubs.com/jesseast/lidR4smarties

0 comments on commit b1a1ce9

Please sign in to comment.