bevingtona / planetR

(early development) R tools to search, activate and download satellite imagery from the Planet API.
Apache License 2.0
45 stars 14 forks source link

Error in permissions[, 1] : subscript out of bounds #21

Closed agronomofiorentini closed 1 year ago

agronomofiorentini commented 1 year ago

Dear creator, The script below was working a week ago but now the console give me the follow output

1] "Search from yday and year ranges"
[1] "You have DOWNLOAD permissions for these images."
[1] "Found 0 suitable PSScene ortho_analytic_8b_sr images that you have permission to download."
[1] "Between yday: 15 to 11"
[1] "You DO NOT have DOWNLOAD permissions for these images. You have  permission"
[1] "Item ID You DO NOT have DOWNLOAD permissions for these images. You have  permission / Item Type PSScene doesn't exist"
[1] "Save the Order ID: "
[1] "You can restart the download with `planet_order_download(order_id, order_name)`"
Error in while (get_content$state != "success") { : 
  argument is of length zero

Perhaps it is related to #15

The following is the parameter that i have use to download the satellite images

bbox

class      : Extent 
xmin       : 13.38879 
xmax       : 13.39702 
ymin       : 43.61046 
ymax       : 43.61266 

start_date

2022-01-15

end_date

2023-01-11

the api call

planet_order(api_key = api_key,
                 bbox = bbox,
                 date_end = date_end,
                 date_start = date_start,
                 cloud_lim = cloud_lim,
                 item_name = "PSScene",
                 product_bundle = "analytic_8b_sr_udm2",
                 asset = "ortho_analytic_8b_sr",
                 order_name = exportfolder)
bevingtona commented 1 year ago

Try this as input parameters:

item_name = "PSScene" product_bundle = "analytic_sr_udm2" asset = "ortho_udm2"

bevingtona commented 1 year ago

This should work also:

item_name = "PSScene"
product_bundle = "analytic_8b_sr_udm2"
asset = "ortho_udm2"
bevingtona commented 1 year ago

Here is a table of product bundles: https://developers.planet.com/docs/integrations/gee/delivery/

agronomofiorentini commented 1 year ago

Dear @bevingtona, I have tried using both of the proposed configurations but both do not work.

I also tried removing the asset parameter as well and using all the configurations proposed in the link but they do not work.

The strange thing I notice is that in the console output I have this strange thing

[1] "You DO NOT have DOWNLOAD permissions for these images. You have  permission"
bevingtona commented 1 year ago

Strange.. I can get your AOI working for older scenes (Jan 1, 2022 - Feb 1, 2022), but not the recent scenes. I get the same error. And when I change the AOI to somewhere else (the example in the readme of western Canada) I can get all dates working ... I need to investigate further..

@agronomofiorentini can you confirm that the function works for older scenes?

bevingtona commented 1 year ago

OK, I think I sort of fixed it. It seems the yday filter was not behaving as it should. Can you re-install the package and try again, sorry about that.

agronomofiorentini commented 1 year ago

Now it's working perfectly.

Thanks @bevingtona for your assistance and effort