Skip to content

Commit d50b74d

Browse files
committed
Rename --rbox to --bbox and leave --bbox as an alias for backwards compatibility
1 parent 3cf08e5 commit d50b74d

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

docs/source/cli/examples.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ list all quads. Keep in mind that there may be millions for a global mosaic.)::
7171

7272
Find all quads inside a particular area of interest::
7373
74-
planet mosaics search global_monthly_2018_09_mosaic --rbox=-95.5,29.6,-95.3,29.8
74+
planet mosaics search global_monthly_2018_09_mosaic --bbox=-95.5,29.6,-95.3,29.8
7575

76-
Note that the format of ``--rbox`` is "xmin,ymin,xmax,ymax", so longitude comes
76+
Note that the format of ``--bbox`` is "xmin,ymin,xmax,ymax", so longitude comes
7777
before latitude.
7878

7979
Get basic information (footprint, etc) for a particular mosaic quad::
@@ -91,7 +91,7 @@ are hundreds of Terabytes in size)::
9191

9292
Download all quads inside of a rectangular box for a mosaic::
9393

94-
planet mosaics download global_monthly_2018_09_mosaic --rbox=-95.5,29.6,-95.3,29.8
94+
planet mosaics download global_monthly_2018_09_mosaic --bbox=-95.5,29.6,-95.3,29.8
9595

9696
Integration With Other Tools
9797
----------------------------

planet/scripts/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def convert(self, val, param, ctx):
277277

278278

279279
class BoundingBox(click.ParamType):
280-
name = 'rbox'
280+
name = 'bbox'
281281

282282
def convert(self, val, param, ctx):
283283
try:

planet/scripts/v1.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,17 +237,19 @@ def list_mosaics(pretty):
237237

238238
@mosaics.command('search')
239239
@click.argument('name')
240-
@click.option('--rbox', type=BoundingBox(), help=(
240+
@click.option('--bbox', type=BoundingBox(), help=(
241241
'Region to query as a comma-delimited string:'
242242
' lon_min,lat_min,lon_max,lat_max'
243243
))
244+
@click.option('--rbox', type=BoundingBox(), help='Alias for --bbox')
244245
@limit_option(None)
245246
@pretty
246-
def search_mosaics(name, rbox, limit, pretty):
247+
def search_mosaics(name, bbox, rbox, limit, pretty):
247248
'''Get quad IDs and information for a mosaic'''
249+
bbox = bbox or rbox
248250
cl = clientv1()
249251
mosaic, = cl.get_mosaic_by_name(name).items_iter(1)
250-
response = call_and_wrap(cl.get_quads, mosaic, rbox)
252+
response = call_and_wrap(cl.get_quads, mosaic, bbox)
251253
echo_json_response(response, pretty, limit)
252254

253255

@@ -286,10 +288,11 @@ def quad_contributions(name, quad, pretty):
286288

287289
@mosaics.command('download')
288290
@click.argument('name')
289-
@click.option('--rbox', type=BoundingBox(), help=(
291+
@click.option('--bbox', type=BoundingBox(), help=(
290292
'Region to download as a comma-delimited string:'
291293
' lon_min,lat_min,lon_max,lat_max'
292294
))
295+
@click.option('--rbox', type=BoundingBox(), help='Alias for --bbox')
293296
@click.option('--quiet', is_flag=True, help=(
294297
'Disable ANSI control output'
295298
))
@@ -298,16 +301,17 @@ def quad_contributions(name, quad, pretty):
298301
exists=True, resolve_path=True, writable=True, file_okay=False
299302
))
300303
@limit_option(None)
301-
def download_quads(name, rbox, quiet, dest, limit):
304+
def download_quads(name, bbox, rbox, quiet, dest, limit):
302305
'''Download quads from a mosaic'''
306+
bbox = bbox or rbox
303307
cl = clientv1()
304308

305309
dl = downloader.create(cl, mosaic=True)
306310
output = downloader_output(dl, disable_ansi=quiet)
307311
output.start()
308312
try:
309313
mosaic, = cl.get_mosaic_by_name(name).items_iter(1)
310-
items = cl.get_quads(mosaic, rbox).items_iter(limit)
314+
items = cl.get_quads(mosaic, bbox).items_iter(limit)
311315
except Exception as ex:
312316
output.cancel()
313317
click_exception(ex)

0 commit comments

Comments
 (0)