cboettig commited on
Commit
32deb59
·
1 Parent(s): 7446924
Files changed (1) hide show
  1. app.R +12 -2
app.R CHANGED
@@ -166,6 +166,9 @@ observeEvent(input$get_features, {
166
  Always use table notation like 'gbif.order' to specify column names.
167
  Be sure to generate fully valid SQL. Check your SQL for possible errors.
168
 
 
 
 
169
  Always use the table 'gbif_aoi' rather than 'gbif' table if both are present.
170
 
171
  IMPORTANT: return raw JSON only, do not decorate your reply with markdown code syntax.
@@ -219,7 +222,11 @@ observeEvent(input$get_features, {
219
  cached_data <- open_dataset(cache_parquet)
220
 
221
  # so we can scale color and height to max value
222
- biggest <- cached_data |> summarise(max = max(log_count)) |> pull(max) |> first()
 
 
 
 
223
 
224
  # so we can zoom to the selected data (choose random point)
225
  aoi_info <- cached_data |>
@@ -234,6 +241,9 @@ observeEvent(input$get_features, {
234
  h3j <- glue("s3://public-data/cache/{query_id}.h3j")
235
  cached_data |> to_h3j(h3j)
236
 
 
 
 
237
  # override previous map with drawn map
238
  # we should use set_h3j_source and set_layer on maplibre_proxy instead.
239
  output$map <- renderMaplibre({
@@ -254,7 +264,7 @@ observeEvent(input$get_features, {
254
  list("linear"),
255
  list("zoom"),
256
  0, 0, biggest,
257
- list("*", 10000, list("get", "log_count"))
258
  ),
259
  fill_extrusion_opacity = 0.7
260
  )
 
166
  Always use table notation like 'gbif.order' to specify column names.
167
  Be sure to generate fully valid SQL. Check your SQL for possible errors.
168
 
169
+ Do not use the 'scientificname' column! Instead, filter specific species using the
170
+ binomial name as the 'species' column.
171
+
172
  Always use the table 'gbif_aoi' rather than 'gbif' table if both are present.
173
 
174
  IMPORTANT: return raw JSON only, do not decorate your reply with markdown code syntax.
 
222
  cached_data <- open_dataset(cache_parquet)
223
 
224
  # so we can scale color and height to max value
225
+ biggest <-
226
+ cached_data |>
227
+ summarise(max = max(log_count)) |>
228
+ pull(max) |>
229
+ first()
230
 
231
  # so we can zoom to the selected data (choose random point)
232
  aoi_info <- cached_data |>
 
241
  h3j <- glue("s3://public-data/cache/{query_id}.h3j")
242
  cached_data |> to_h3j(h3j)
243
 
244
+ # adjust v-scale based on zoom:
245
+ vscale <- 7000 / aoi_info$zoom
246
+
247
  # override previous map with drawn map
248
  # we should use set_h3j_source and set_layer on maplibre_proxy instead.
249
  output$map <- renderMaplibre({
 
264
  list("linear"),
265
  list("zoom"),
266
  0, 0, biggest,
267
+ list("*", vscale, list("get", "log_count"))
268
  ),
269
  fill_extrusion_opacity = 0.7
270
  )