tyson-swetnam / porder

Simple CLI for Planet ordersV2 API
https://tyson-swetnam.github.io/porder/
Apache License 2.0
48 stars 12 forks source link

support n string or range filters #42

Open rbavery opened 4 years ago

rbavery commented 4 years ago

This would be super useful for whittling down planet scenes that are in the "test" category, fall outside of sensor view angle limits, and are not of a particular instrument type (I'm looking to get all of one type, either PS2 or the new PS2). Filtering by these three categories requires 2 string filters and a range filter (plus I'd also like to filter by boolean, the positional_accuracy flag).

If I run porder idlist with two string filters I get more scenes returned than if I used 1 string filter, which makes me think the second string filter is causing the other string filters to not be ran (using two string filters should return less scenes than 1 string filter)

Running search for a maximum of: 1000000 assets
Total number of assets written to /home/rave/temporal_mixing/data/idlist_standard_and_test.csv ===> 2635
Running search for a maximum of: 1000000 assets
Total number of assets written to /home/rave/temporal_mixing/data/idlist_all_filters.csv ===> 2665
samapriya commented 4 years ago

Hey @rbavery For now it only handles one filter of each type , string or range and so on. The issue is with the common keys overwriting values in the overall payload . In any case I welcome help on figuring this out, there might be a simple fix but I welcome PRs to add this capability or maybe just something fun to explore over Christmas :)

rbavery commented 4 years ago

Gotcha, thanks for the explanation @samapriya. For now I'll filter by whatever reduces the order count the most, and I think using the harmonize option means I don't need to filter by instrument type. I might be able to take a crack at figuring this out later this month.