Skip to content

Commit bc29caa

Browse files
authored
updates to docs for new order request style (#718)
1 parent 20ae00d commit bc29caa

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

docs/cli-tutorial.md

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ To create an order you need a name, a [bundle](https://developers.planet.com/api
138138
one or more id's, and an [item type](https://developers.planet.com/docs/apis/data/items-assets/#item-types):
139139

140140
```console
141-
planet orders request --name "My First Order" --bundle analytic_sr_udm2 --id 20220605_124027_64_242b \
142-
--item-type PSScene
141+
planet orders request PSScene analytic_sr_udm2 --name "My First Order" --id 20220605_124027_64_242b
143142
```
144143

145144
You should replace the `id` with a scene you have access to, using [Explorer](https://planet.com/explorer)
@@ -157,8 +156,7 @@ easier to read, but you can still copy and paste the full line into your command
157156
You can also use `jq` here to make it a bit more readable:
158157

159158
```console
160-
planet orders request --name "My First Order" --bundle analytic_sr_udm2 --id 20220605_124027_64_242b \
161-
--item-type PSScene | jq
159+
planet orders request PSScene analytic_sr_udm2 --name "My First Order" --id 20220605_124027_64_242b | jq
162160
```
163161

164162
```json
@@ -182,8 +180,8 @@ The above command just prints out the necessary JSON to create an order. To actu
182180
save the output into a file:
183181

184182
```console
185-
planet orders request --name "My first Order" --bundle analytic_sr_udm2 --id 20220605_124027_64_242b \
186-
--item-type PSScene > request-1.json
183+
planet orders request PSScene analytic_sr_udm2 --name "My first Order" --id 20220605_124027_64_242b \
184+
> request-1.json
187185
```
188186

189187
This saves the above JSON in a file called `request-1.json`
@@ -234,8 +232,8 @@ passing the output of the `orders request` command directly to be the input of t
234232
command:
235233

236234
```console
237-
planet orders request --name "My Second Order" --bundle analytic_sr_udm2 \
238-
--id 20220605_124027_64_242b,20220605_124025_34_242b --item-type PSScene | planet orders create
235+
planet orders request PSScene analytic_sr_udm2 --name "My Second Order" \
236+
--id 20220605_124027_64_242b,20220605_124025_34_242b | planet orders create
239237
```
240238

241239
The Planet CLI is designed to work well with piping, as it aims at small commands that can be
@@ -343,17 +341,17 @@ You can move that geometry to your current directory and use the following comma
343341
tweak the geometry.geojson to refer to where you downloaded it.
344342

345343
```console
346-
planet orders request --item-type PSScene --clip geometry.geojson --name clipped-geom \
347-
--bundle analytic_sr_udm2 --id 20220605_124027_64_242b | planet orders create
344+
planet orders request PSScene analytic_sr_udm2 --clip geometry.geojson --name clipped-geom \
345+
--id 20220605_124027_64_242b | planet orders create
348346
```
349347

350348
#### Two Scenes, composited
351349

352350
Ordering two scenes is easy, just add another id:
353351

354352
```console
355-
planet orders request --item-type PSScene --name "Two Scenes" \
356-
--bundle analytic_sr_udm2 --id 20220605_124027_64_242b,20220605_124025_34_242b | planet orders create
353+
planet orders request PSScene analytic_sr_udm2 --name "Two Scenes" \
354+
--id 20220605_124027_64_242b,20220605_124025_34_242b | planet orders create
357355
```
358356

359357
And then you can composite them together, using the 'tools' json. You can
@@ -372,7 +370,7 @@ Once you've got it saved you call the `--tools` flag to refer to the JSON file,
372370
can pipe that to `orders create`.
373371

374372
```console
375-
planet orders request --item-type PSScene --name "Two Scenes Composited" --bundle analytic_sr_udm2 \
373+
planet orders request PSScene analytic_sr_udm2 --name "Two Scenes Composited" \
376374
--id 20220605_124027_64_242b,20220605_124025_34_242b --tools tools-composite.json | planet orders create
377375
```
378376

@@ -402,8 +400,8 @@ If you'd like the above order as a COG you Get the output as a cloud-optimized G
402400
The following command just shows the output, you can pipe into orders create if you'd like:
403401

404402
```console
405-
planet orders request --item-type PSScene --name "Two Scenes Composited" \
406-
--bundle analytic_sr_udm2 --id 20220605_124027_64_242b,20220605_124025_34_242b --tools tools-cog.json
403+
planet orders request PSScene analytic_sr_udm2 --name "Two Scenes Composited" \
404+
--id 20220605_124027_64_242b,20220605_124025_34_242b --tools tools-cog.json
407405
```
408406

409407
#### Clip & Composite
@@ -413,16 +411,16 @@ not use `--clip` and `--tools` in the same call. There is not yet CLI calls to g
413411
so you can just grab the [full tools.json](https://raw.githubusercontent.com/planetlabs/planet-client-python/main/docs/data/tools-clip-composite.json)
414412

415413
```console
416-
planet orders request --item-type PSScene --name "Two Scenes Clipped and Composited" \
417-
--bundle analytic_sr_udm2 --id 20220605_124027_64_242b,20220605_124025_34_242b --tools tools-clip-composite.json
414+
planet orders request PSScene analytic_sr_udm2 --name "Two Scenes Clipped and Composited" \
415+
--id 20220605_124027_64_242b,20220605_124025_34_242b --tools tools-clip-composite.json
418416
```
419417

420418
One cool little trick is that you can even stream in the JSON directly with `curl`, piping it into the request:
421419

422420
```console
423421
curl -s https://raw.githubusercontent.com/planetlabs/planet-client-python/main/docs/data/tools-clip-composite.json \
424-
| planet orders request --item-type PSScene --name "Streaming Clip & Composite" \
425-
--bundle analytic_sr_udm2 --id 20220605_124027_64_242b,20220605_124025_34_242b --tools - | planet orders create
422+
| planet orders request PSScene analytic_sr_udm2 --name "Streaming Clip & Composite" \
423+
--id 20220605_124027_64_242b,20220605_124025_34_242b --tools - | planet orders create
426424
```
427425

428426
#### Using Orders output as input
@@ -708,7 +706,7 @@ image that was published:
708706

709707

710708
```console
711-
planet orders request --name "SkySat Latest" --item-type SkySatCollect --bundle analytic \
709+
planet orders request SkySatCollect analytic --name "SkySat Latest" \
712710
--id `planet data filter | planet data search SkySatCollect --sort 'acquired desc' --limit 1 - | jq -r .id` \
713711
| planet orders create
714712
```
@@ -719,7 +717,7 @@ Or get the 5 latest cloud free images in an area and create an order that clips
719717
```console
720718
ids=`planet data filter --geom geometry.geojson --range clear_percent gt 90 | planet data \
721719
search PSScene --limit 5 - | jq -r .id | tr '\n' , | sed 's/.$//'`
722-
planet orders request --name "Clipped Scenes" --item-type PSScene --bundle analytic_sr_udm2 \
720+
planet orders request PSScene analytic_sr_udm2 --name "Clipped Scenes" \
723721
--id $ids --clip geometry.geojson | planet orders create -
724722
```
725723

request-1.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"name": "My first Order", "products": [{"item_ids": ["20220605_124027_64_242b"], "item_type": "PSScene", "product_bundle": "analytic_sr_udm2"}], "metadata": {"stac": {}}}

0 commit comments

Comments
 (0)