Skip to content

Commit bb79e04

Browse files
authored
Merge pull request #991 from planetlabs/issue985
Document new CLI features of 2.1.0
2 parents ae1f880 + a88da21 commit bb79e04

File tree

2 files changed

+99
-46
lines changed

2 files changed

+99
-46
lines changed

docs/cli/cli-orders.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,33 @@ planet orders request \
149149
}
150150
```
151151

152+
#### Zip archives of bundles and orders
153+
154+
You can request that all files of a bundle be zipped together by using the `--archive-type` option. The only type of archive currently available is "zip".
155+
156+
```sh
157+
planet orders request \
158+
--item-type PSScene \
159+
--bundle analytic_sr_udm2 \
160+
--name 'My First Zipped Order' \
161+
--archive-type zip \
162+
20220605_124027_64_242b
163+
```
164+
165+
You can request that all files of the entire order be zipped together by using the `--single-archive` option.
166+
167+
```sh
168+
planet orders request \
169+
--item-type PSScene \
170+
--bundle analytic_sr_udm2 \
171+
--name 'My First Zipped Order' \
172+
--archive-type zip \
173+
--single-archive \
174+
20220605_124027_64_242b,20220605_124025_34_242b
175+
```
176+
177+
*New in version 2.1*
178+
152179
### Save an Order Request
153180

154181
The above command just prints out the necessary JSON to create an order. To actually use it you can
@@ -613,13 +640,13 @@ Orders with Google Earth Engine delivery will force the STAC flag to false.
613640
### Cloud Delivery
614641

615642
Another option is to delivery your orders directly to a cloud bucket, like AWS S3 or Google Cloud Storage.
616-
The file given with the `--cloudconfig` option should contain JSON that follows
643+
The file given with the `--delivery` option should contain JSON that follows
617644
the options and format given in
618645
[Delivery to Cloud Storage](https://developers.planet.com/docs/orders/delivery/#delivery-to-cloud-storage).
619646

620647
An example would be:
621648

622-
Example: `cloudconfig.json`
649+
Example: `delivery.json`
623650

624651
```json
625652
{
@@ -633,6 +660,12 @@ Example: `cloudconfig.json`
633660
}
634661
```
635662

663+
*New in 2.1*
664+
665+
!!! note
666+
667+
`--cloudconfig` was the name of this option in version 2.0 and can continue to be used as an alias for `--delivery`.
668+
636669
### Using Orders output as input
637670

638671
One useful thing to note is that the order JSON that reports status and location is a valid Orders API request.

docs/cli/cli-subscriptions.md

Lines changed: 64 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -157,21 +157,33 @@ planet subscriptions get cb817760-1f07-4ee7-bba6-bcac5346343f
157157
To see what items have been delivered to your cloud bucket you can use the `results` command:
158158

159159
```sh
160-
planet subscriptions results cb817760-1f07-4ee7-bba6-bcac5346343f
160+
planet subscriptions results SUBSCRIPTION_ID
161161
```
162162

163+
`SUBSCRIPTION_ID` above is a placeholder for a unique subscription identifier, which will be a UUID like `cb817760-1f07-4ee7-bba6-bcac5346343f`.
164+
163165
By default this displays the first 100 results. As with other commands, you can use the `--limit` param to
164166
set a higher limit, or set it to 0 to see all results (this can be quite large with subscriptions results).
165167

166168
You can also filter by status:
167169

168170
```sh
169-
planet subscriptions results --status processing
171+
planet subscriptions results SUBSCRIPTION_ID --status processing
170172
```
171173

172174
The available statuses are `created`, `queued`, `processing`, `failed`, and `success`. Note it’s quite useful
173175
to use `jq` to help filter out results as well.
174176

177+
#### Results as comma-seperated values (CSV)
178+
179+
Planetary Variable subscribers can benefit from retrieving results as a CSV. The results contain variable statistics and can serve as data for time series analysis and visualization.
180+
181+
```sh
182+
planet subscriptions results SUBSCRIPTION_ID --csv
183+
```
184+
185+
*New in version 2.1*
186+
175187
### Update Subscription
176188

177189
You can update a subscription that is running, for example to change the 'tools' it’s using or to alter
@@ -306,6 +318,28 @@ planet data filter --range clear_percent gt 90 \
306318

307319
Do not bother with geometry or date filters, as they will be ignored in favor of the `--start-time` and `--geometry` values that are required.
308320

321+
#### Publishing stages and time range types
322+
323+
By using the `--time-range-type` you can choose to temporally filter by
324+
acquisition or publication time. The `--publishing-stage` option allows you to
325+
receive the earliest preview imagery or wait until finalized imagery is
326+
available. See [Catalog Source
327+
Types:Parameters](https://developers.planet.com/docs/subscriptions/source/#parameters)
328+
for more details.
329+
330+
```sh
331+
planet subscriptions request-catalog \
332+
--item-types PSScene \
333+
--asset-types ortho_analytic_8b \
334+
--geometry geometry.geojson \
335+
--start-time 2022-08-24T00:00:00-07:00 \
336+
--time-range-type acquired \
337+
--publishing-stage finalized \
338+
--filter filter.json
339+
```
340+
341+
*New in version 2.1*
342+
309343
#### Saving the output
310344

311345
You’ll likely want to save the output of your `request-catalog` call to disk, so that you can more easily use it in constructing the complete subscription
@@ -321,6 +355,25 @@ planet subscriptions request-catalog \
321355
--filter filter.json > request-catalog.json
322356
```
323357

358+
### Planetary Variable Request
359+
360+
Subscribing to Planetary Variables is much like subscribing to imagery from
361+
Planet's catalog. The `planet subscriptions request-pv` command can construct the source
362+
part of a Planetary Variable request like `request-catalog` does for cataloged
363+
imagery. Planetary Variable subscriptions come in 4 types and are further
364+
subdivided within these types by an identifier. See [Subscribing to Planetary
365+
Variables](https://developers.planet.com/docs/subscriptions/pvs-subs/#planetary-variables-types-and-ids)
366+
for details. To constrain data delivery by space and time, you will use the
367+
`--geometry`, `start-time`, and `end-time` options described above.
368+
369+
```sh
370+
planet subscriptions request-pv \
371+
--var-type biomass_proxy \
372+
--var-id BIOMASS-PROXY_V3.0_10 \
373+
--geometry geometry.geojson \
374+
--start-time 2022-08-24T00:00:00-07:00 > request-pv.json
375+
```
376+
324377
### Subscription Tools
325378

326379
Now we’ll dive into some of the tools options for subscriptions. These are quite similar to the tools for
@@ -332,51 +385,18 @@ for Orders, future of the versions of the CLI will likely add `tools` convenienc
332385

333386
The most used tool is the `clip` operation, which lets you pass a geometry to the
334387
Subscriptions API and it creates new images that only have pixels within the geometry you
335-
gave it. We’ll use the same geometry from [above](#geometry), as it is quite
336-
typical to use the same subscription geometry as the clip geometry, so you don't get
337-
any pixels outside of your area of interest (99.9% of all subscriptions use the clip
338-
tool, so it’s strongly recommended to also use clip). The proper 'clip' tool for it
339-
would be:
388+
gave it. 99% of the time you will want to clip to the subscription geometry. The easiest way to do this is to use the `--clip-to-source` option added to the `subscriptions request` command in version 2.1.
340389

341-
```json
342-
[
343-
{
344-
"type": "clip",
345-
"parameters": {
346-
"aoi": {
347-
"type": "Polygon",
348-
"coordinates": [
349-
[
350-
[
351-
-163.828125,
352-
-44.59046718130883
353-
],
354-
[
355-
181.7578125,
356-
-44.59046718130883
357-
],
358-
[
359-
181.7578125,
360-
78.42019327591201
361-
],
362-
[
363-
-163.828125,
364-
78.42019327591201
365-
],
366-
[
367-
-163.828125,
368-
-44.59046718130883
369-
]
370-
]
371-
]
372-
}
373-
}
374-
}
375-
]
390+
```sh
391+
planet subscriptions request \
392+
--name 'Clipped Subscription' \
393+
--source request-catalog.json \
394+
--delivery cloud-delivery.json \
395+
--clip-to-source
376396
```
377397

378-
You can save this tools as `tools.json` to include in the `subscriptions request`
379-
command.
398+
*New in version 2.1*
399+
380400

381401
#### Additional Tools
382402

0 commit comments

Comments
 (0)