|
18 | 18 | import click |
19 | 19 |
|
20 | 20 | from planet.reporting import AssetStatusBar |
21 | | -from planet import data_filter, DataClient, exceptions, geojson |
| 21 | +from planet import data_filter, DataClient, exceptions |
22 | 22 | from planet.clients.data import (SEARCH_SORT, |
23 | 23 | LIST_SEARCH_TYPE, |
24 | 24 | LIST_SEARCH_TYPE_DEFAULT, |
|
36 | 36 | from .io import echo_json |
37 | 37 | from .options import limit, pretty |
38 | 38 | from .session import CliSession |
| 39 | +from .validators import check_geom |
39 | 40 |
|
40 | 41 | valid_item_string = "Valid entries for ITEM_TYPES: " + "|".join( |
41 | 42 | get_data_item_types()) |
@@ -80,17 +81,6 @@ def check_item_types(ctx, param, item_types) -> Optional[List[dict]]: |
80 | 81 | raise click.BadParameter(str(e)) |
81 | 82 |
|
82 | 83 |
|
83 | | -def check_geom(ctx, param, geometry) -> Optional[dict]: |
84 | | - """Validates geometry as GeoJSON or feature ref(s).""" |
85 | | - if isinstance(geometry, dict): |
86 | | - return geojson.as_geom_or_ref(geometry) |
87 | | - geoms = {} |
88 | | - if geometry: |
89 | | - for geom in geometry: |
90 | | - geoms.update(geojson.as_geom_or_ref(geom)) |
91 | | - return geoms if geoms else None |
92 | | - |
93 | | - |
94 | 84 | def check_item_type(ctx, param, item_type) -> Optional[List[dict]]: |
95 | 85 | """Validates the item type provided by comparing it to all supported |
96 | 86 | item types.""" |
|
0 commit comments