bevingtona / planetr Goto Github PK
View Code? Open in Web Editor NEW(early development) R tools to search, activate and download satellite imagery from the Planet API.
License: Apache License 2.0
(early development) R tools to search, activate and download satellite imagery from the Planet API.
License: Apache License 2.0
It would be nice to be able to use the R package to filter images for additional things like ground control, quality, etc.
Lines 93 to 117 in a135a79
I noticed that the API request for ground control and quality category in the planet_search function is wrongly written. With the "NotFilter", I suspect we are requesting for the opposite category, leading to significantly fewer and low-quality results. I suggest the following changes.
# filter by ground control, quality
gq_filter <- list(
type= jsonlite::unbox("AndFilter"),
config = list(
list(
field_name= jsonlite::unbox("ground_control"),
type= jsonlite::unbox("StringInFilter"),
config = list(jsonlite::unbox(tolower(ground_control)))
),
list(
field_name= jsonlite::unbox("quality_category"),
type= jsonlite::unbox("StringInFilter"),
config = list(jsonlite::unbox(quality))
))
)
# combine filters
filter_configs <- list(
type= jsonlite::unbox("AndFilter"),
config = list(date_range_filter, cloud_cover_filter, gq_filter, geometry_filter) #, coverage_filter
)
Script is not yet able to read multiple pages in the API response. Currently limited to 250.
I removed the yday
filter as it was causing issues (see #12)... need to fix and reimplement...
Dear contributor,
I have finally set the API key and now it is working perfectly. #12
Congrants and thanks to develop this package.
I kidly ask you if it is possible to add an additional argument to planet_order that request to download only the latest available image for those parameters.
Best regards
First of all, thanks for making this package! There is very little support outside of Python for the Planet API, and I'm relatively new to APIs in general so having your code to look at was a real help. I believe right now you are exclusively using Planet's Data API? I'm not sure if you've looked at or worked with the Orders API, but it has some useful aspects like the built in clipping tool that clips images before download to save data (it seems like your download_withClip function clips them after but correct me if I'm wrong), and the orders themselves show up on the Planet account similar to orders placed using the Planet Explorer (they can be downloaded again using the order_id). I've written a function that uses your planet_search function to get item_ids and then places an order with those ids and clips them to the AOI. Let me know if this is something you would find useful and I can submit it with a pull request.
Hi very cool product! just wanted help on how to specify list of exact dates as filter instead of the date range? (for example I have listed 15 dates where low tide conditions are expected). Many thanks!
Dear creator,
I am trying to download the images of the "PSScene4Band" by using the tool that you have developed but i am receving the following error output
Error in permissions[, 1] : subscript out of bounds
I have setted correctly the api key because I had previously successfully downloaded the images.
I will report here all the information in order to reproduce the error
class : Extent
xmin : 13.38829
xmax : 13.39752
ymin : 43.60996
ymax : 43.61316
date_start<-2022-05-10
date_end<-2022-05-18
most_recent=2
cloud_lim = 0.2
item_name= PSScene4Band
product = analytic_sr
could you please help me to understand and fix the issue.
Thanks as always.
Planet API has the ability to clip to AOI (or not). It would be great to implement this option.
Just learned that the item types have changed so that all the Planet Scope data has the item type "PSScene" including the new 8-band data. Items types of "PSScene4Band" (for example) are being depreciated.
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)
How to install dependencies during package installation?
My Planet subscription does not allow me to make large orders using the Orders API...? Is there a limit?
Large requests (>100 images) work fine using the original API (v1) but the Orders API function does not work with orders > 100.
This is the error message:
No access to assets: PSScene4Band/20200424_185242_1105/[analytic_sr]
Unable to accept order
In the example in the readme, the output of the planet_search() function is named response. The example assumes that response has rows, when I am getting a vector as the output.
for(i in 1:nrow(response)) {
planet_activate(i, item_name = item_name)
print(paste("Activating", i, "of", nrow(response)))}
# PLANET_DOWNLOAD: Batch Download
for(i in 1:nrow(response)) {
planet_download(i)
print(paste("Downloading", i, "of", nrow(response)))}
The example should be changed to the following:
for(i in 1:length(response)) {
planet_activate(i, item_name = item_name)
print(paste("Activating", i, "of", length(response)))}
# PLANET_DOWNLOAD: Batch Download
for(i in 1:length(response)) {
planet_download(i)
print(paste("Downloading", i, "of", length(response)))}
In addition, within the functions planet_activate() and planet_download(), the index of response should be changed from 2-dimensional to 1-dimensional:
response[i]
I'm trying to search for images within my bounding box and even after trying several combinations of dates I receive the same error after running response <- planet_search(bbox, date_end, date_start, cloud_lim, item_name)
Error in permissions[, 1] : subscript out of bounds
Above my item_name = "PSScene"
after the recent changes in Planet's item assets and merging of the SuperDove datasets.
Not sure what the error is referring to within the planet_search() variables. Upon trying the example in the README i still receive the same error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.