@@ -537,10 +537,9 @@ def validate_core_landing_page_body(
537
537
)
538
538
return False
539
539
if geometry is None :
540
- logger .fatal (
541
- " Item Search configured for validation, but `--geometry` parameter not specified"
540
+ logger .warning (
541
+ " Item Search configured for validation, but `--geometry` parameter not specified. Intersection tests will not be run "
542
542
)
543
- return False
544
543
545
544
if "children" in conformance_classes and not any (
546
545
cc_children_regex .fullmatch (x ) for x in conforms_to
@@ -697,7 +696,7 @@ def validate_api(
697
696
conforms_to = conforms_to ,
698
697
warnings = warnings ,
699
698
errors = errors ,
700
- geometry = geometry , # type:ignore
699
+ geometry = geometry ,
701
700
conformance_classes = ccs_to_validate ,
702
701
r_session = r_session ,
703
702
validate_pagination = validate_pagination ,
@@ -1130,10 +1129,6 @@ def validate_features(
1130
1129
open_assets_urls : bool = True ,
1131
1130
stac_check_config : Optional [str ] = None ,
1132
1131
) -> None :
1133
- if not geometry :
1134
- errors += f"[{ Context .FEATURES } ] Geometry parameter required for running Features validations."
1135
- return
1136
-
1137
1132
if not collection :
1138
1133
errors += f"[{ Context .FEATURES } ] Collection parameter required for running Features validations."
1139
1134
return
@@ -1383,7 +1378,7 @@ def validate_item_search(
1383
1378
conforms_to : List [str ],
1384
1379
warnings : Warnings ,
1385
1380
errors : Errors ,
1386
- geometry : str ,
1381
+ geometry : Optional [ str ] ,
1387
1382
conformance_classes : List [str ],
1388
1383
r_session : Session ,
1389
1384
validate_pagination : bool ,
@@ -1455,14 +1450,15 @@ def validate_item_search(
1455
1450
validate_item_search_collections (
1456
1451
search_url , collections_url , methods , errors , r_session
1457
1452
)
1458
- validate_item_search_intersects (
1459
- search_url = search_url ,
1460
- collection = collection ,
1461
- methods = methods ,
1462
- errors = errors ,
1463
- geometry = geometry ,
1464
- r_session = r_session ,
1465
- )
1453
+ if geometry is not None :
1454
+ validate_item_search_intersects (
1455
+ search_url = search_url ,
1456
+ collection = collection ,
1457
+ methods = methods ,
1458
+ errors = errors ,
1459
+ geometry = geometry ,
1460
+ r_session = r_session ,
1461
+ )
1466
1462
1467
1463
if validate_pagination :
1468
1464
validate_item_pagination (
@@ -2772,7 +2768,7 @@ def validate_item_pagination(
2772
2768
root_url : str ,
2773
2769
search_url : str ,
2774
2770
collection : Optional [str ],
2775
- geometry : str ,
2771
+ geometry : Optional [ str ] ,
2776
2772
methods : Set [Method ],
2777
2773
errors : Errors ,
2778
2774
use_pystac_client : bool ,
@@ -2913,14 +2909,15 @@ def validate_item_pagination(
2913
2909
if len (items ) > len ({item ["id" ] for item in items }):
2914
2910
errors += f"[{ context } ] POST pagination - duplicate items returned from paginating items"
2915
2911
2916
- search = client .search (
2917
- method = "POST" , collections = [collection ], intersects = geometry
2918
- )
2919
- if len (list (take (20000 , search .items_as_dicts ()))) == 20000 :
2920
- errors += (
2921
- f"[{ context } ] POST pagination - paged through 20,000 results. This could mean the last page "
2922
- "of results references itself, or your collection and geometry combination has too many results."
2912
+ if geometry is not None :
2913
+ search = client .search (
2914
+ method = "POST" , collections = [collection ], intersects = geometry
2923
2915
)
2916
+ if len (list (take (20000 , search .items_as_dicts ()))) == 20000 :
2917
+ errors += (
2918
+ f"[{ context } ] POST pagination - paged through 20,000 results. This could mean the last page "
2919
+ "of results references itself, or your collection and geometry combination has too many results."
2920
+ )
2924
2921
except Exception as e :
2925
2922
errors += f"pystac-client threw exception while testing pagination { e } "
2926
2923
elif collection is not None :
0 commit comments