Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update api_segments to handle empty segments #1155

Merged
merged 8 commits into from
Jun 14, 2024
Prev Previous commit
Next Next commit
fix empty segments classification
  • Loading branch information
M3nin0 committed Jun 13, 2024
commit 03160ea343e19a08c79a81d74ad2b232b062652e
4 changes: 4 additions & 0 deletions R/api_segments.R
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,9 @@
# retrieve the segments
segments <- .vector_read_vec(chunk[["segments"]][[1]])
# include lat/long information
segments <- segments |> dplyr::filter(
.data[["pol_id"]] %in% unique(ts_bands[["polygon_id"]])
)
lat_long <- .proj_to_latlong(segments[["x"]], segments[["y"]], .crs(tile))
# create metadata for the polygons
samples <- tibble::tibble(
Expand Down Expand Up @@ -477,3 +480,4 @@
})
return(seg_tile_band_lst)
}
#